centos 7.7 下gpdb6.7.1 添加数据节点

[ntga@node1 ~]$ gpexpand -f /usr/local/greenplum-db/hosts_expand
20200509:12:31:26:008234 gpexpand:node1:ntga-[INFO]:-local Greenplum Version: ‘postgres (Greenplum Database) 6.7.1 build commit:a21de286045072d8d1df64fa48752b7dfac8c1b7’
20200509:12:31:26:008234 gpexpand:node1:ntga-[INFO]:-master Greenplum Version: ‘PostgreSQL 9.4.24 (Greenplum Database 6.7.1 build commit:a21de286045072d8d1df64fa48752b7dfac8c1b7) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Apr 30 2020 00:11:21’
20200509:12:31:26:008234 gpexpand:node1:ntga-[INFO]:-Querying gpexpand schema for current expansion state

System Expansion is used to add segments to an existing GPDB array.
gpexpand did not detect a System Expansion that is in progress.

Before initiating a System Expansion, you need to provision and burn-in
the new hardware. Please be sure to run gpcheckperf to make sure the
new hardware is working properly.

Please refer to the Admin Guide for more information.

Would you like to initiate a new System Expansion Yy|Nn (default=N):

y

By default, new hosts are configured with the same number of primary
segments as existing hosts.  Optionally, you can increase the number
of segments per host.

For example, if existing hosts have two primary segments, entering a value
of 2 will initialize two additional segments on existing hosts, and four
segments on new hosts.  In addition, mirror segments will be added for
these new primary segments if mirroring is enabled.

How many new primary segments per host do you want to add? (default=0):

3
Enter new primary data directory 1:
/data/sd1/primary
Enter new primary data directory 2:
/data/sd2/primary
Enter new primary data directory 3:
/data/sd3/primary

Generating configuration file…

20200509:12:32:11:008234 gpexpand:node1:ntga-[INFO]:-Generating input file…

Input configuration file was written to ‘gpexpand_inputfile_20200509_123211’.

Please review the file and make sure that it is correct then re-run
with: gpexpand -i gpexpand_inputfile_20200509_123211

20200509:12:32:11:008234 gpexpand:node1:ntga-[INFO]:-Exiting…
[ntga@node1 ~]$
[ntga@node1 ~]$ vi gpexpand_inputfile_20200509_123211

master|master|6000|/data/sd1/primary/gpseg9|14|9|p
master|master|6001|/data/sd2/primary/gpseg10|15|10|p
master|master|6002|/data/sd3/primary/gpseg11|16|11|p
master|master|6003|/data/sd1/primary/gpseg12|17|12|p
master|master|6004|/data/sd2/primary/gpseg13|18|13|p
master|master|6005|/data/sd3/primary/gpseg14|19|14|p
node1|node1|6003|/data/sd1/primary/gpseg15|20|15|p
node1|node1|6004|/data/sd2/primary/gpseg16|21|16|p
node1|node1|6005|/data/sd3/primary/gpseg17|22|17|p
node2|node2|6003|/data/sd1/primary/gpseg18|23|18|p
node2|node2|6004|/data/sd2/primary/gpseg19|24|19|p
node2|node2|6005|/data/sd3/primary/gpseg20|25|20|p
node3|node3|6003|/data/sd1/primary/gpseg21|26|21|p
node3|node3|6004|/data/sd2/primary/gpseg22|27|22|p
node3|node3|6005|/data/sd3/primary/gpseg23|28|23|p
保留新添加的主机名3个,其余删除掉。
执行下面步骤开始添加
[ntga@node1 ~]$ gpexpand -i gpexpand_inputfile_20200509_123211
20200509:12:35:16:008269 gpexpand:node1:ntga-[INFO]:-local Greenplum Version: ‘postgres (Greenplum Database) 6.7.1 build commit:a21de286045072d8d1df64fa48752b7dfac8c1b7’
20200509:12:35:17:008269 gpexpand:node1:ntga-[INFO]:-master Greenplum Version: ‘PostgreSQL 9.4.24 (Greenplum Database 6.7.1 build commit:a21de286045072d8d1df64fa48752b7dfac8c1b7) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Apr 30 2020 00:11:21’
20200509:12:35:17:008269 gpexpand:node1:ntga-[INFO]:-Querying gpexpand schema for current expansion state
20200509:12:35:17:008269 gpexpand:node1:ntga-[INFO]:-Heap checksum setting consistent across cluster
20200509:12:35:17:008269 gpexpand:node1:ntga-[INFO]:-Syncing Greenplum Database extensions
20200509:12:35:17:008269 gpexpand:node1:ntga-[INFO]:-The packages on master are consistent.
20200509:12:35:17:008269 gpexpand:node1:ntga-[INFO]:-Locking catalog
20200509:12:35:18:008269 gpexpand:node1:ntga-[INFO]:-Locked catalog
20200509:12:35:18:008269 gpexpand:node1:ntga-[INFO]:-Creating segment template
20200509:12:35:20:008269 gpexpand:node1:ntga-[INFO]:-Copying postgresql.conf from existing segment into template
20200509:12:35:20:008269 gpexpand:node1:ntga-[INFO]:-Copying pg_hba.conf from existing segment into template
20200509:12:35:20:008269 gpexpand:node1:ntga-[INFO]:-Creating schema tar file
20200509:12:35:22:008269 gpexpand:node1:ntga-[INFO]:-Distributing template tar file to new hosts
20200509:12:35:25:008269 gpexpand:node1:ntga-[INFO]:-Configuring new segments (primary)
20200509:12:35:25:008269 gpexpand:node1:ntga-[INFO]:-{‘master’: ‘/data/sd1/primary/gpseg9:6000:true:false:14:9:👎,/data/sd2/primary/gpseg10:6001:true:false:15:10:👎,/data/sd3/primary/gpseg11:6002:true:false:16:11:👎’}
20200509:12:35:41:008269 gpexpand:node1:ntga-[INFO]:-Cleaning up temporary template files
20200509:12:35:42:008269 gpexpand:node1:ntga-[INFO]:-Cleaning up databases in new segments.
20200509:12:35:44:008269 gpexpand:node1:ntga-[INFO]:-Unlocking catalog
20200509:12:35:44:008269 gpexpand:node1:ntga-[INFO]:-Unlocked catalog
20200509:12:35:44:008269 gpexpand:node1:ntga-[INFO]:-Creating expansion schema
20200509:12:35:45:008269 gpexpand:node1:ntga-[INFO]:-Populating gpexpand.status_detail with data from database template1
20200509:12:35:45:008269 gpexpand:node1:ntga-[INFO]:-Populating gpexpand.status_detail with data from database postgres
20200509:12:35:46:008269 gpexpand:node1:ntga-[INFO]:-Populating gpexpand.status_detail with data from database ntga
20200509:12:35:46:008269 gpexpand:node1:ntga-[INFO]😗***********************************************
20200509:12:35:46:008269 gpexpand:node1:ntga-[INFO]:-Initialization of the system expansion complete.
20200509:12:35:46:008269 gpexpand:node1:ntga-[INFO]:-To begin table expansion onto the new segments
20200509:12:35:46:008269 gpexpand:node1:ntga-[INFO]:-rerun gpexpand
20200509:12:35:46:008269 gpexpand:node1:ntga-[INFO]😗***********************************************
20200509:12:35:46:008269 gpexpand:node1:ntga-[INFO]:-Exiting…

以上已经添加成功,需要在重新分布下数据
gpexpand: error: no such option: -D
[ntga@node1 ~]$ gpexpand -d 00:05:00 -n 6
20200509:12:37:39:008565 gpexpand:node1:ntga-[INFO]:-local Greenplum Version: ‘postgres (Greenplum Database) 6.7.1 build commit:a21de286045072d8d1df64fa48752b7dfac8c1b7’
20200509:12:37:39:008565 gpexpand:node1:ntga-[INFO]:-master Greenplum Version: ‘PostgreSQL 9.4.24 (Greenplum Database 6.7.1 build commit:a21de286045072d8d1df64fa48752b7dfac8c1b7) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Apr 30 2020 00:11:21’
20200509:12:37:39:008565 gpexpand:node1:ntga-[INFO]:-Querying gpexpand schema for current expansion state
20200509:12:37:41:008565 gpexpand:node1:ntga-[INFO]:-Expanding ntga.public.test3
20200509:12:37:41:008565 gpexpand:node1:ntga-[INFO]:-Expanding ntga.public.test2
20200509:12:37:41:008565 gpexpand:node1:ntga-[INFO]:-Expanding ntga.public.test
20200509:12:37:42:008565 gpexpand:node1:ntga-[INFO]:-Finished expanding ntga.public.test2
20200509:12:37:42:008565 gpexpand:node1:ntga-[INFO]:-Finished expanding ntga.public.test
20200509:12:37:42:008565 gpexpand:node1:ntga-[INFO]:-Finished expanding ntga.public.test3
20200509:12:37:45:008565 gpexpand:node1:ntga-[INFO]:-EXPANSION COMPLETED SUCCESSFULLY
20200509:12:37:45:008565 gpexpand:node1:ntga-[INFO]:-Exiting…
[ntga@node1 ~]$
[ntga@node1 ~]$ psql
psql (9.4.24)
Type “help” for help.

ntga=# select * from test;
id | name
----±-----
1 | a
3 | c
2 | b
(3 rows)
ntga=# select * from gp_segment_configuration
;
dbid | content | role | preferred_role | mode | status | port | hostname | address | datadir
------±--------±-----±---------------±-----±-------±-----±---------±--------±--------------------------
2 | 0 | p | p | n | u | 6000 | node1 | node1 | /data/sd1/primary/gpseg0
5 | 3 | p | p | n | u | 6000 | node2 | node2 | /data/sd1/primary/gpseg3
8 | 6 | p | p | n | u | 6000 | node3 | node3 | /data/sd1/primary/gpseg6
3 | 1 | p | p | n | u | 6001 | node1 | node1 | /data/sd2/primary/gpseg1
6 | 4 | p | p | n | u | 6001 | node2 | node2 | /data/sd2/primary/gpseg4
9 | 7 | p | p | n | u | 6001 | node3 | node3 | /data/sd2/primary/gpseg7
4 | 2 | p | p | n | u | 6002 | node1 | node1 | /data/sd3/primary/gpseg2
7 | 5 | p | p | n | u | 6002 | node2 | node2 | /data/sd3/primary/gpseg5
10 | 8 | p | p | n | u | 6002 | node3 | node3 | /data/sd3/primary/gpseg8
13 | -1 | p | p | s | u | 5432 | node1 | node1 | /data/sd1/master/gpseg-1
14 | 9 | p | p | n | u | 6000 | master | master | /data/sd1/primary/gpseg9
15 | 10 | p | p | n | u | 6001 | master | master | /data/sd2/primary/gpseg10
16 | 11 | p | p | n | u | 6002 | master | master | /data/sd3/primary/gpseg11
(13 rows)

ntga=#
ntga=#
ntga=#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值