技术文章 | Deepgreen/Greenplum删除节点步骤

本文来源于阿里云-云栖社区,原文点击这里


Greenplum和Deepgreen官方都没有给出删除节点的方法和建议,但实际上,我们可以对节点进行删除。由于不确定性,删除节点极有可能导致其他的问题,所以还行做好备份,谨慎而为。下面是具体的步骤:

1.查看数据库当前状态(12个实例)

[gpadmin@sdw1 ~]$ gpstate
20170816:12:53:25:097578 gpstate:sdw1:gpadmin-[INFO]:-Starting gpstate with args:
20170816:12:53:25:097578 gpstate:sdw1:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.3.99.00 build Deepgreen DB'
20170816:12:53:25:097578 gpstate:sdw1:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.3.99.00 build Deepgreen DB) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) compiled on Jul  6 2017 03:04:10'
20170816:12:53:25:097578 gpstate:sdw1:gpadmin-[INFO]:-Obtaining Segment details from master...
20170816:12:53:25:097578 gpstate:sdw1:gpadmin-[INFO]:-Gathering data from segments...
..
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-Greenplum instance status summary
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-----------------------------------------------------
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Master instance                                = Active
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Master standby                                 = No master standby configured
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total segment instance count from metadata     = 12
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-----------------------------------------------------
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Primary Segment Status
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-----------------------------------------------------
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total primary segments                         = 12
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total primary segment valid (at master)        = 12
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total primary segment failures (at master)     = 0
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total number of postmaster.pid files missing   = 0
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total number of postmaster.pid files found     = 12
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs missing    = 0
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs found      = 12
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total number of /tmp lock files missing        = 0
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total number of /tmp lock files found          = 12
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total number postmaster processes missing      = 0
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Total number postmaster processes found        = 12
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-----------------------------------------------------
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Mirror Segment Status
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-----------------------------------------------------
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-   Mirrors not configured on this array
20170816:12:53:27:097578 gpstate:sdw1:gpadmin-[INFO]:-----------------------------------------------------

2.并行备份数据库

使用 gpcrondump 命令备份数据库,这里不赘述,不明白的可以翻看文档。

3.关闭当前数据库

[gpadmin@sdw1 ~]$ gpstop -M fast
20170816:12:54:10:097793 gpstop:sdw1:gpadmin-[INFO]:-Starting gpstop with args: -M fast
20170816:12:54:10:097793 gpstop:sdw1:gpadmin-[INFO]:-Gathering information and validating the environment...
20170816:12:54:10:097793 gpstop:sdw1:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20170816:12:54:10:097793 gpstop:sdw1:gpadmin-[INFO]:-Obtaining Segment details from master...
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.99.00 build Deepgreen DB'
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:---------------------------------------------
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-Master instance parameters
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:---------------------------------------------
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   Master Greenplum instance process active PID   = 31250
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   Database                                       = template1
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   Master port                                    = 5432
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   Master directory                               = /hgdata/master/hgdwseg-1
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   Shutdown mode                                  = fast
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   Timeout                                        = 120
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   Shutdown Master standby host                   = Off
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:---------------------------------------------
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-Segment instances that will be shutdown:
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:---------------------------------------------
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   Host   Datadir                     Port    Status
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg0    25432   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg1    25433   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg2    25434   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg3    25435   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg4    25436   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg5    25437   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg6    25438   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg7    25439   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg8    25440   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg9    25441   u
20170816:12:54:11:097793 gpstop:sdw1:gpadmin-[INFO]:-   sdw1   /hgdata/primary/hgdwseg10   25442   u

>>>展开全文

你可能感兴趣的:(技术文章)