Greenplum6.0 설치

7066 단어
컨디션
이름:
설명
운영 체제
CentOS7 x86_64
greenplum
greenplum-db-6.0.0-rhel7-x86_64.rpm
다운로드 주소
무리를 이루다
Host
IP
기능
test1
172.20.0.23
master
test2
172.20.0.26
segment
test3
172.20.0.27
segment
수정/etc/hosts
노드마다 수정
vim /etc/hosts

172.20.0.23 test1 test1
172.20.0.26 test2 test2
172.20.0.27 test3 test3


/etc/sysconfig/network 수정
노드마다 수정
vim /etc/sysconfig/network

NETWORKING=yes
HOSTNAME= host  

/etc/security/limits 수정conf
vim /etc/security/limits.conf 
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

/etc/sysctl 수정conf
vim /etc/sysctl.conf

kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 500 1024000 200 4096
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.all.arp_filter = 1
net.ipv4.ip_local_port_range = 10000 65535
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
vm.swappiness = 10
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
vm.dirty_background_ratio = 0
vm.dirty_ratio=0
vm.dirty_background_bytes = 1610612736
vm.dirty_bytes = 4294967296
vm.overcommit_memory = 2     ###          ,  oracle    ###   1


구성 적용
sysctl -p

/etc/security/limits 수정d/90-nproc.conf
vim /etc/security/limits.d/90-nproc.conf

*          soft    nproc     131072
root       soft    nproc     unlimited

방화벽을 닫다
  : systemctl start firewalld

  : systemctl stop firewalld

    : systemctl status firewalld 

      : systemctl disable firewalld

      : systemctl enable firewalld

/etc/selinux/config 수정
vim  /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

다른 노드로 파일 복사
scp /etc/sysctl.conf test2:/etc
scp /etc/security/limits.d/90-nproc.conf test2:/etc/security/limits.d
scp /etc/selinux/config test2:/etc/selinux


gpadmin 사용자 만들기
groupadd -g 530 gpadmin
useradd -g 530 -u 530 -m -d /home/gpadmin -s /bin/bash gpadmin
chown -R gpadmin:gpadmin /home/gpadmin
passwd gpadmin   
echo "gpadmin" | passwd --stdin gpadmin

master 설치 greenplum
rpm -ivh greenplum-db-6.0.0-rhel7-x86_64.rpm
#         /usr/local,         gpadmin    :
chown -R gpadmin:gpadmin /usr/local


hostlist 만들기
su - gpadmin
mkdir -p /home/gpadmin/conf
vim /home/gpadmin/conf/hostlist

test1
test2
test3

seg 만들기hosts
vim /home/gpadmin/conf/seg_hosts
 
test2
test3

기밀 해제 구성(노드당)
ssh-keygen -t rsa

cat ~/.ssh/id_rsa.pub | ssh -o stricthostkeychecking=no gpadmin@test1 "cat - >> ~/.ssh/authorized_keys"
cat ~/.ssh/id_rsa.pub | ssh -o stricthostkeychecking=no gpadmin@test2 "cat - >> ~/.ssh/authorized_keys"
cat ~/.ssh/id_rsa.pub | ssh -o stricthostkeychecking=no gpadmin@test3 "cat - >> ~/.ssh/authorized_keys"
#   ssh  
chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys

greenplum 설정 ssh 비밀 면제 연결
su root
source /usr/local/greenplum-db/greenplum_path.sh 
gpssh-exkeys -f /home/gpadmin/conf/hostlist

segment 설치 그린plum
사용 권한
chown -R gpadmin:gpadmin /usr/local
chown -R gpadmin:gpadmin /opt

각 노드로 압축, 전송
tar -cf gp.tar greenplum-db-5.0.0/

scp gp.tar test2:/usr/local
scp gp.tar test3:/usr/local

대량 압축 풀기
source /usr/local/greenplum-db/greenplum_path.sh

gpssh -f /home/gpadmin/conf/seg_hosts

cd /usr/local

tar -xf gp.tar
#   greenplum      greenplum-db      
ln -s /urs/local/greenplum-db-6.0.0 greenplum-db

ll

exit

데이터베이스 초기화
source /usr/local/greenplum-db/greenplum_path.sh
gpssh -f /home/gpadmin/conf/hostlist #        
 
#        /opt/greenplum/data      (             )
 mkdir -p /opt/greenplum/data/master
 mkdir -p /opt/greenplum/data/primary
 mkdir -p /opt/greenplum/data/mirror
 mkdir -p /opt/greenplum/data2/primary
 mkdir -p /opt/greenplum/data2/mirror


환경 변수 구성
vim /home/gpadmin/.bash_profile

#     
source /usr/local/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/opt/greenplum/data/master/gpseg-1
export GPPORT=5432
export PGDATABASE=gp_sydb

#       
scp /home/gpadmin/.bash_profile test2:/home/gpadmin/


source .bash_profile

NTP 구성
gpssh -f /home/gpadmin/conf/hostlist -v -e 'sudo ntpd'
gpssh -f /home/gpadmin/conf/hostlist -v -e 'sudo /etc/init.d/ntpd start && sudo chkconfig --level 35 ntpd on'

각 노드의 연결성을 검사하다
cd /usr/local/greenplum-db/bin
gpcheckperf -f /home/gpadmin/conf/hostlist -r N -d /tmp

수정/usr/local/greenplum-db/greenplumpath.sh
vim /usr/local/greenplum-db/greenplum_path.sh
# libgpopt.so.3     /usr/local/greenplum-db-6.0.0/lib
LD_LIBRARY_PATH=$GPHOME/lib:libgpopt.so.3     :${LD_LIBRARY_PATH-}
export LD_LIBRARY_PATH

초기화
cd /usr/local/greenplum-db/docs/cli_help/gpconfigs
cp gpinitsystem_config initgp_config
vim initgp_config  
 
#                     
#                    (  4-8 ,     4 ,primary mirror       )
declare -a DATA_DIRECTORY=(/opt/greenplum/data/primary /opt/greenplum/data/primary  /opt/greenplum/data2/primary /opt/greenplum/data2/primary)
declare -a MIRROR_DATA_DIRECTORY=(/opt/greenplum/data/mirror /opt/greenplum/data/mirror  /opt/greenplum/data2/mirror /opt/greenplum/data2/mirror)
 
ARRAY_NAME=”gp_sydb”                                        #4.2.1             
MASTER_HOSTNAME=test1                                   #     
MASTER_DIRECTORY=/opt/greenplum/data/master                 #      4.1         
MASTER_DATA_DIRECTORY=/opt/greenplum/data/master/gpseg-1    # 4.1      
DATABASE_NAME=gp_sydb                                       #4.2.1             
MACHINE_LIST_FILE=/home/gpadmin/conf/seg_hosts              #  3.2.2       

gpinitsystem -c initgp_config

데이터베이스 작업
gpstop -M fast
gpstart -a
psql -d postgres



\l #      

\c #      

\d #    

\d tablename #      


좋은 웹페이지 즐겨찾기