● 安装OushuDB
hawq ssh -h caps3 -e "yum install -y hawq"
● 配置caps3机器
拷贝/etc/sysctl.conf到caps3
hawq scp -r -h caps3 /etc/sysctl.conf =:/etc/
并使得配置生效
hawq ssh -h caps3 -e "sysctl -p"
拷贝capm1上/etc/security/limits.d/gpadmin.conf中的配置文件到caps3:
hawq scp -r -h caps3 /etc/security/limits.d/gpadmin.conf =:/etc/security/limits.d
● 创建OushuDB目录
#创建segment元数据目录hawq ssh -h caps3 -e 'mkdir -p /data1/hawq/segmentdd'#创建临时文件目录hawq ssh -h caps3 -e 'mkdir -p /data1/hawq/tmp'hawq ssh -h caps3 -e 'mkdir -p /data2/hawq/tmp'hawq ssh -h caps3 -e 'chown -R gpadmin:gpadmin /data1/hawq'hawq ssh -h caps3 -e 'chown -R gpadmin:gpadmin /data2/hawq'
● 修改/usr/local/hawq/etc/slaves
添加caps3到/usr/local/hawq/etc/slaves
caps1caps2caps3
● 拷贝capm1上/usr/local/hawq/etc中的配置文件到caps3:
hawq scp -r -h caps3 /usr/local/hawq/etc =:/usr/local/hawq
● 初始化caps3上的OushuDB
ssh caps3su - gpadminsource /usr/local/hawq/greenplum_path.shhawq init segment
● 检查caps3是否已加入HAWQ集群
在capm1节点,查看gp_segment_configuration中是不是已经有caps3
su - gpadmin
$ psql -d postgres
psql (8.2.15)
Type "help" for help.
postgres=# select * from gp_segment_configuration;