1、环境准备服务器分配192.168.100.101--mdw192.168.100.11--smdw192.168.100.12--sdw1192.168.100.13--sdw2 ms1与ms2之间的心跳ip配置10.10.10.1--mdw10.10.10.2--smdw 2、修改hosts文件(所有主机hosts文件必须全部修改) vi /etc/hosts192.168.100.101 mdw1
1、环境准备服务器分配192.168.100.101--mdw192.168.100.11--smdw192.168.100.12--sdw1192.168.100.13--sdw2
ms1与ms2之间的心跳ip配置10.10.10.1--mdw10.10.10.2--smdw
2、修改hosts文件(所有主机hosts文件必须全部修改)
vi /etc/hosts192.168.100.101 mdw192.168.100.11 smdw192.168.100.12 sdw1192.168.100.13 sdw2
3、关闭iptables和selinux[root@mdw ~]# service iptables stop[root@mdw ~]#[root@mdw ~]#[root@mdw ~]#[root@mdw ~]#[root@mdw ~]# chkconfig iptables --listiptables 0:鍏抽棴 1:鍏抽棴 2:鍏抽棴 3:鍏抽棴 4:鍏抽棴 5:鍏抽棴 6:鍏抽棴[root@mdw ~]# export lang=zh_cn[root@mdw ~]# chkconfig iptables --listiptables 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@mdw ~]# cat /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
[root@mdw ~]# setenforce 0
4、修改系统参数1)vi /etc/sysctl.conf[root@mdw ~]# sysctl -pnet.ipv4.ip_forward = 0net.ipv4.conf.default.rp_filter = 1net.ipv4.conf.default.accept_source_route = 0kernel.sysrq = 1kernel.core_uses_pid = 1net.ipv4.tcp_syncookies = 1error: net.bridge.bridge-nf-call-ip6tables is an unknown keyerror: net.bridge.bridge-nf-call-iptables is an unknown keyerror: net.bridge.bridge-nf-call-arptables is an unknown keykernel.msgmnb = 65536kernel.msgmax = 65536kernel.shmmax = 68719476736kernel.shmall = 4294967296error: kernel.msgmin is an unknown keyvm.overcommit_memory = 2error: net.ipv4.cp_tw_recycle is an unknown keynet.ipv4.tcp_max_syn_backlog = 4096net.ipv4.conf.all.arp_filter = 1error: invalid argument setting key net.ipv4.ip_local_port_rangenet.core.netdev_max_backlog = 10000error: xfs_mount_options is an unknown keykernel.shmmni = 4096kernel.sem = 250 512000 100 2048net.ipv4.tcp_tw_recycle = 1net.ipv4.conf.default.arp_filter = 1kernel.msgmni = 2048
2) vi /etc/security/limits.conf
* soft nofile 65536* hard nofile 65536* soft nproc 131072* hard nproc 131072
在rhel6.x版本需要修改文件 /etc/security/limits.d/90-nproc.conf,增加如下内容:* softnproc 131072 * hardnproc 131072
4、修改完系统参数后重启服务器
5、创建gpadmin用户 useradd gpadmin6、安装gp 1) 上传安装文件解压缩 2)执行安装文件
[root@mdw gpdb]# ./greenplum-db-4.2.6.3-build-2-rhel5-x86_64.bin
i have read and agree to the terms of the above emc softwarelicense agreement.
********************************************************************************do you accept the emc database license agreement? [yes|no]********************************************************************************
yes
********************************************************************************provide the installation path for greenplum database or press enter toaccept the default installation path: /usr/local/greenplum-db-4.2.6.3********************************************************************************
/home/gpadmin/gpdb/install
********************************************************************************install greenplum database into /gpadmin/gpdb/install>? [yes|no]********************************************************************************
yes
********************************************************************************[optional] provide the path to a previous installation of greenplum database,or press enter to skip this step. e.g. /usr/local/greenplum-db-4.1.1.3
this installation step will migrate any greenplum database extensions from theprovided path to the version currently being installed. this step is optionaland can be run later with:gppkg --migrate /home/gpadmin/gpdb/install********************************************************************************
extracting product to /home/gpadmin/gpdb/install
skipping migration of greenplum database extensions...
************************* *******************************************************installation complete.greenplum database is installed in /home/gpadmin/gpdb/install
greenplum database documentation is available for downloadat http://powerlink.emc.com.********************************************************************************[root@mdw gpdb]#
[root@mdw install]# source greenplum_path.sh[root@mdw install]#
3)准备allnotes文件[root@mdw install]# pwd/home/gpadmin/gpdb/install[root@mdw install]#[root@mdw install]#[root@mdw install]#[root@mdw install]# lsallnotes bin demo docs etc ext gpdb-license.txt greenplum_path.sh include lib license.thirdparty sbin share[root@mdw install]# cat allnotessdw1sdw2smdw
4)建立多机互信[root@mdw install]# gpssh-exkeys -f allnotes[step 1 of 5] create local id and authorize on local host ... /root/.ssh/id_rsa file exists ... key generation skipped
[step 2 of 5] keyscan all hosts and update known_hosts file
[step 3 of 5] authorize current user on remote hosts ... send to sdw1 ... send to sdw2 *** *** enter password for sdw2: ... send to smdw
[step 4 of 5] determine common authentication file content
[step 5 of 5] copy authentication files to all remote hosts ... finished key exchange with sdw1[error] unable to copy authentication files to sdw2 lost connection[error] unable to copy authentication files to smdw lost connection
上述报错解决办法:删除mdw /root/.ssh/目录下的内容 重新执行gpssh-exkeys -f allnotes
5)创建存放数据的目录
[root@mdw gpdb]# mkdir data[root@mdw gpdb]# mkdir data/master
[root@mdw gpdb]# chown gpadmin:gpadmin data -r[root@mdw gpdb]#[root@mdw gpdb]#[root@mdw gpdb]# ll鎬荤敤閲109588drwxr-xr-x 3 gpadmin gpadmin 4096 2鏈 20 16:21 datalrwxrwxrwx 1 root root 9 2鏈 20 16:02 greenplum-db -> ./install-rwxr-xr-x 1 root root 56782500 10鏈 8 06:45 greenplum-db-4.2.6.3-build-2-rhel5-x86_64.bin-rw-r--r-- 1 root root 55417563 11鏈25 11:44 greenplum-db-4.2.6.3-build-2-rhel5-x86_64.zipdrwxr-xr-x 11 root root 4096 2鏈 20 16:04 install-r--r--r-- 1 root root 6935 10鏈 8 06:45 readme_install[root@mdw gpdb]#
6)其他机器安装gp [root@mdw install]# cat allsegsmdwsdw1sdw2
使用gpseginstall安装
[root@mdw install]# gpseginstall -f allseg -u gpadmin20140220:16:28:05:003251 gpseginstall:mdw:root-[info]:-installation info:link_name greenplum-dbbinary_path /home/gpadmin/gpdb/installbinary_dir_location /home/gpadmin/gpdbbinary_dir_name install20140220:16:28:05:003251 gpseginstall:mdw:root-[info]:-check cluster password access20140220:16:28:06:003251 gpseginstall:mdw:root-[info]:-de-duplicate hostnames20140220:16:28:06:003251 gpseginstall:mdw:root-[info]:-master hostname: mdw20140220:16:28:07:003251 gpseginstall:mdw:root-[info]:-check for user gpadmin on cluster20140220:16:28:07:003251 gpseginstall:mdw:root-[info]:-add user gpadmin on master20140220:16:28:08:003251 gpseginstall:mdw:root-[info]:-add user gpadmin on cluster20140220:16:28:08:003251 gpseginstall:mdw:root-[info]:-chown -r gpadmin:gpadmin /home/gpadmin/gpdb/greenplum-db20140220:16:28:08:003251 gpseginstall:mdw:root-[info]:-chown -r gpadmin:gpadmin /home/gpadmin/gpdb/install20140220:16:28:08:003251 gpseginstall:mdw:root-[info]:-rm -f /home/gpadmin/gpdb/install.tar; rm -f /home/gpadmin/gpdb/install.tar.gz20140220:16:28:08:003251 gpseginstall:mdw:root-[info]:-cd /home/gpadmin/gpdb; tar cf install.tar install20140220:16:28:09:003251 gpseginstall:mdw:root-[info]:-gzip /home/gpadmin/gpdb/install.tar20140220:16:28:22:003251 gpseginstall:mdw:root-[info]:-remote command: mkdir -p /home/gpadmin/gpdb20140220:16:28:22:003251 gpseginstall:mdw:root-[info]:-remote command: rm -rf /home/gpadmin/gpdb/install20140220:16:28:23:003251 gpseginstall:mdw:root-[info]:-scp software to remote location20140220:16:28:38:003251 gpseginstall:mdw:root-[info]:-remote command: gzip -f -d /home/gpadmin/gpdb/install.tar.gz20140220:16:28:40:003251 gpseginstall:mdw:root-[info]:-md5 check on remote location20140220:16:28:42:003251 gpseginstall:mdw:root-[info]:-remote command: cd /home/gpadmin/gpdb; tar xf install.tar20140220:16:28:43:003251 gpseginstall:mdw:root-[info]:-remote command: rm -f /home/gpadmin/gpdb/install.tar20140220:16:28:44:003251 gpseginstall:mdw:root-[info]:-remote command: cd /home/gpadmin/gpdb; rm -f greenplum-db; ln -fs install greenplum-db20140220:16:28:44:003251 gpseginstall:mdw:root-[info]:-remote command: chown -r gpadmin:gpadmin /home/gpadmin/gpdb/greenplum-db20140220:16:28:45:003251 gpseginstall:mdw:root-[info]:-remote command: chown -r gpadmin:gpadmin /home/gpadmin/gpdb/install20140220:16:28:45:003251 gpseginstall:mdw:root-[info]:-rm -f /home/gpadmin/gpdb/install.tar.gzplease enter a password:confirm password:20140220:16:29:19:003251 gpseginstall:mdw:root-[info]:-changing system passwords ...20140220:16:29:20:003251 gpseginstall:mdw:root-[info]:-exchange ssh keys for user root20140220:16:29:23:003251 gpseginstall:mdw:root-[info]:-exchange ssh keys for user gpadmin20140220:16:29:24:003251 gpseginstall:mdw:root-[info]:-exception running cmd: su gpadmin -c gpssh-exkeys -f allseg20140220:16:29:24:003251 gpseginstall:mdw:root-[info]:-write() argument 2 must be string or buffer, not none20140220:16:29:24:003251 gpseginstall:mdw:root-[info]:-gppsh-exkeys failed running from within pexpect ... now try outside of pexpect[step 1 of 5] create local id and authorize on local host ... /home/gpadmin/.ssh/id_rsa file exists ... key generation skipped
[step 2 of 5] keyscan all hosts and update known_hosts file
[step 3 of 5] authorize current user on remote hosts ... send to smdw *** *** enter password for smdw: ... send to sdw1 ... send to sdw2
[step 4 of 5] determine common authentication file content
[step 5 of 5] copy authentication files to all remote hosts ... finished key exchange with smdw ... finished key exchange with sdw1 ... finished key exchange with sdw2
[info] completed successfully20140220:16:29:31:003251 gpseginstall:mdw:root-[info]:-/home/gpadmin/gpdb/greenplum-db/./sbin/gpfixuserlimts -f /etc/security/limits.conf -u gpadmin20140220:16:29:31:003251 gpseginstall:mdw:root-[info]:-remote command: . /home/gpadmin/gpdb/greenplum-db/./greenplum_path.sh; /home/gpadmin/gpdb/greenplum-db/./sbin/gpfixuserlimts -f /etc/security/limits.conf -u gpadmin20140220:16:29:32:003251 gpseginstall:mdw:root-[info]:-version string on master: gpssh version 4.2.6.3 build 220140220:16:29:32:003251 gpseginstall:mdw:root-[info]:-remote command: . /home/gpadmin/gpdb/greenplum-db/./greenplum_path.sh; /home/gpadmin/gpdb/greenplum-db/./bin/gpssh --version20140220:16:29:33:003251 gpseginstall:mdw:root-[info]:-remote command: . /home/gpadmin/gpdb/install/greenplum_path.sh; /home/gpadmin/gpdb/install/bin/gpssh --version20140220:16:29:39:003251 gpseginstall:mdw:root-[info]:-success -- requested commands completed
[root@mdw greenplum-db-4.2.6.3]# gpssh -f allnotes mkdir -p /data/d1 /data/d2 /data/m1 /data/m2[sdw1][sdw2][root@mdw greenplum-db-4.2.6.3]# gpssh -f allnotes chown gpadmin:gpadmin /data/d1 /data/d2 /data/m1 /data/m2 -r[sdw1][sdw2]
安装完成
7、数据库初始化
1)创建数据节点文件[root@mdw install]# cat notessdw1sdw22) 创建初始化参数文件[root@mdw install]# cat gpinitsystem_configarray_name=greenplumseg_prefix=gpsegport_base=50000declare -a data_directory=(/home/gpadmin/gpdb/data/d1 /home/gpadmin/gpdb/data/d2)master_hostname=mdwmaster_directory=/home/gpadmin/gpdb/data/mastermaster_port=5432trusted_shell=sshcheck_point_segments=8encoding=unicodemirror_port_base=60000replication_port_base=41000mirror_replication_port_base=51000declare -a mirror_data_directory=(/home/gpadmin/gpdb/data/m1 /home/gpadmin/gpdb/data/m2)
3) 数据初始化
su - gpadmin
[gpadmin@mdw install]$ gpinitsystem -c gpinitsystem_config -h notes
vi .bashrc
#greenplumexport master_data_directory=/data/master/gpseg-1
vi $master_data_directory/pg_hba.conf
host all all 0/0 md5
3) 数据初始化
su - gpadmin
[gpadmin@mdw install]$ gpinitsystem -c gpinitsystem_config -h notes