2017년 4월 24일 월요일

kylin 1.6 설치하기

참조URL: http://kylin.apache.org/docs20/install/index.html

1. kylin사용자 생성
# useradd kylin
# passwd kylin
Changing password for user kylin.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

2. hadoopkylin사용자 생성
hadoopsuperuserhdfs이다. hdfs계정으로 kylin 사용자 생성
root 사용자 생성이 필요
# sudo -u hdfs hadoop fs -mkdir /user/kylin
# sudo -u hdfs hadoop fs -chown kylin /user/kylin
# sudo -u hdfs hadoop fs -mkdir /kylin
# sudo -u hdfs hadoop fs -chown kylin:hdfs /kylin
# sudo -u hdfs hadoop fs -ls /
Found 10 items
drwxrwxrwx   - yarn   hadoop          0 2017-04-18 18:14 /app-logs
drwxr-xr-x   - hdfs   hdfs            0 2017-04-19 09:02 /apps
drwxr-xr-x   - yarn   hadoop          0 2017-04-18 18:14 /ats
drwxr-xr-x   - hdfs   hdfs            0 2017-04-18 18:14 /hdp
drwxr-xr-x   - kylin  hdfs            0 2017-04-21 18:56 /kylin
drwxr-xr-x   - mapred hdfs            0 2017-04-18 18:14 /mapred
drwxrwxrwx   - mapred hadoop          0 2017-04-18 18:14 /mr-history
drwxrwxrwx   - spark  hadoop          0 2017-04-21 18:56 /spark-history
drwxrwxrwx   - hdfs   hdfs            0 2017-04-19 09:07 /tmp
drwxr-xr-x   - hdfs   hdfs            0 2017-04-21 18:48 /user

3. Kylin설치파일을 특정위치에 푼다.
# mkdir -p /data01/kylin
# chown kylin:kylin /data01/kylin
# su kylin
$ tar xzvf apache-kylin-1.6.0-hbase1.x-bin.tar.gz
$ cp -r apache-kylin-1.6.0-hbase1.x-bin/* /data01/kylin/

4. KYLIN_HOME지정
$ vi ~/.bash_profile
KYLIN_HOME=/data01/kylin

export KYLIN_HOME

$ KYLIN_HOME=/data01/kylin
$ export KYLIN_HOME
$ echo $KYLIN_HOME
/data01/kylin

5. 환경 적합도 확인
$ cd $KYLIN_HOME
$ ./bin/check-env.sh
KYLIN_HOME is set to /data01/kylin
Please make sure the user has the privilege to run hive shell

hive shell이 안깔렸다.

hbase master노드에 client들을 설치한다.
























$ bin/check-env.sh
KYLIN_HOME is set to /data01/kylin
$
아무 에러가 없다.

6. kylin 기동
$ bin/kylin.sh start
KYLIN_HOME is set to /data01/kylin
kylin.security.profile is set to testing
KYLIN_HOME is set to /data01/kylin
WARNING: Use "yarn jar" to launch YARN applications.

Logging initialized using configuration in file:/etc/hive/2.4.2.0-258/0/hive-log4j.properties
HCAT_HOME not found, try to find hcatalog path from hadoop home
hive dependency:
…..
A new Kylin instance is started by kylin, stop it using "kylin.sh stop"
Please visit http://<ip>:7070/kylin
You can check the log at /data01/kylin/logs/kylin.log
$

id: admin
pwd: KYLIN



8. KYLIN ODBC추가




2017년 4월 15일 토요일

centos 7 에서 postgresql 9.2 설치


1. postgresql-server rpm 설치

# yum install postgresql-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package postgresql-server.x86_64 0:9.2.18-1.el7 will be installed
--> Processing Dependency: postgresql-libs(x86-64) = 9.2.18-1.el7 for package: postgresql-server-9.2.18-1.el7.x86_64
--> Processing Dependency: postgresql(x86-64) = 9.2.18-1.el7 for package: postgresql-server-9.2.18-1.el7.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql-server-9.2.18-1.el7.x86_64
--> Running transaction check
---> Package postgresql.x86_64 0:9.2.18-1.el7 will be installed
---> Package postgresql-libs.x86_64 0:9.2.18-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
 Package                             Arch                     Version                        Repository                                Size
============================================================================================================================================
Installing:
 postgresql-server                   x86_64                   9.2.18-1.el7                   birepos                                  3.8 M
Installing for dependencies:
 postgresql                          x86_64                   9.2.18-1.el7                   birepos                                  3.0 M
 postgresql-libs                     x86_64                   9.2.18-1.el7                   birepos                                  232 k

Transaction Summary
============================================================================================================================================
Install  1 Package (+2 Dependent packages)


2. data directory설정

# vi /usr/lib/systemd/system/postgresql.service
Environment=PGDATA=/data01/pgsql/data

3. data directory생성

# mkdir -p /data01/pgsql/data
# cd /data01
# chown -R postgres pgsql
# chgrp -R postgres pgsql

4. db생성

# cd /usr/bin
# postgresql-setup initdb
Initializing database ... OK
# cat /var/lib/pgsql/initdb.log
이 데이터베이스 시스템에서 만들어지는 파일들은 그 소유주가 "postgres" id
지정될 것입니다. 또한 이 사용자는 서버 프로세스의 소유주가 됩니다.

The database cluster will be initialized with locale "ko_KR.UTF-8".
The default database encoding has accordingly been set to "UTF8".
initdb: could not find suitable text search configuration for locale "ko_KR.UTF-8"
기본 텍스트 검색 구성이 "simple"()로 설정됩니다.

이미 있는 /data01/pgsql/data 디렉터리의 액세스 권한을 고치는 중 ...완료
하위 디렉터리 만드는 중 ...완료
max_connections 초기값을 선택하는 중 ...100
기본 shared_buffers를 선택하는 중... 32MB
환경설정 파일을 만드는 중 ...완료
/data01/pgsql/data/base/1 안에 template1 데이터베이스를 만드는 중 ...완료
pg_authid 초기화 중 ...완료
의존성 정보 초기화 중 ...완료
시스템 뷰들을 만드는 중 ... 완료
시스템 개체들 설명 자료 입력 중 ...완료
creating collations ... 완료
인코딩 변환규칙(conversion)들을 만드는 중 ...완료
사전을 만드는 중... 완료
내장개체들의 액세스 권한을 설정 중 ... 완료
information schema 만드는 중 ...완료
loading PL/pgSQL server-side language ... 완료
template1 데이터베이스 청소 중 ...완료
template1 데이터베이스를 template0 데이터베이스로 복사 중 ...완료
template1 데이터베이스를 postgres 데이터베이스로 복사 중 ...완료

작업완료. 이제 다음 명령을 이용해서 서버를 가동 할 수 있습니다:

    /usr/bin/postgres -D /data01/pgsql/data
또는
    /usr/bin/pg_ctl -D /data01/pgsql/data -l logfile start

5. 기동
# systemctl enable postgresql
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql.service to /usr/lib/systemd/system/postgresql.service.
# systemctl start postgresql
# systemctl status postgresql
postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
[root@bidevkylinm2 bin]# systemctl start postgresql
[root@bidevkylinm2 bin]# systemctl status postgresql
postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2017-04-15 13:49:31 KST; 3s ago
  Process: 3011 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=0/SUCCESS)
  Process: 3005 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 3014 (postgres)
   CGroup: /system.slice/postgresql.service
           ├─3014 /usr/bin/postgres -D /data01/pgsql/data -p 5432
           ├─3015 postgres: logger process
           ├─3017 postgres: checkpointer process
           ├─3018 postgres: writer process
           ├─3019 postgres: wal writer process
           ├─3020 postgres: autovacuum launcher process
           └─3021 postgres: stats collector process

Apr 15 13:49:30 bidevkylinm2.bikylinclust systemd[1]: Starting PostgreSQL database server...
Apr 15 13:49:31 bidevkylinm2.bikylinclust systemd[1]: Started PostgreSQL database server.
# su - postgres
Last login: Sat Apr 15 13:42:39 KST 2017 on pts/0
-bash-4.2$ psql
psql (9.2.18)
Type "help" for help.

postgres=#




6. 인증 방식 변경
# su - postgres -c "psql --command '\password postgres'"
Enter new password:
Enter it again:

# vi /data01/pgsql/data/pg_hba.conf
# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             0.0.0.0/0            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5


# systemctl restart postgresql

7. listen ip 설정
# cp /data01/pgsql/data/postgresql.conf /data01/pgsql/data/postgresql.conf.bak
# vi /data01/pgsql/data/postgresql.conf
listen_addresses = '*' 



8. 서버 기동
# systemctl restart postgresql