● 安裝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;