greenplum add mirror to master and segment

greenplum add mirror to master

This article is to add standby master node greenplum existing system, if the system did not install gp, gp install the system documentation for installation instructions please refer greenplum

  1. Enable master image
    that can be used to add gpinitsystem when greenplum system initialization, this paper is mainly to add standby master greenplum Existing System

  2. Adding a standby master system to an existing gp
    system parameters, please "System Configuration" in accordance with the installation instructions in greenplum

2.1 greenplum install software standby node
installation 2.1.1 Binary

root]# unzip greenplum-db-<version>-<platform>.zip

root]# /bin/bash greenplum-db-<version>-<platform>.bin

Enter all default

root]# chown -R gpadmin /usr/local/greenplum*
root]# chgrp -R gpadmin /usr/local/greenplum*

2.1.2 Use gpadmin user logon master node, ssh-free exchange of confidential documents

gpdmin]$ gpssh-exkeys -f hostfile_all
gpdmin]$ cat hostfile_all
LOCAL-81-67
LOCAL-81-68
LOCAL-81-69
LOCAL-81-70
LOCAL-192-168-97-63.boyaa.com

3 Initialize the master STANDBY
3.1 users log on using a master node gpadmin greenplum system

3.2 gpinitstandby initialization gp standby node

gpdmin]$ gpinitstandby  -s LOCAL-192-168-97-63.boyaa.com

Note: -s represents the directory must be used with master node directory specified hostname standby node remains consistent

Check the standby state of the node 4

[gpadmin@LOCAL-81-67 ~]$ psql -c 'SELECT procpid, state FROM pg_stat_replication;'
procpid | state 
---------+-----------
1750 | streaming

It indicates normal synchronous state is streaming

greenplum add mirror to segment

There are two ways to create a mirror, one is created in the mirror gp initialization time, do not do too much to explain here
there is a way that after initialization, and then add a mirror, record here the steps
needed attention to the fact that : greenplum currently only allows the addition of mirror, and can not be deleted mirror, so before adding a mirror, it is best to do some backup gp

create mirrored storage directory:
more hostfile_gpssh_segonly
segdb1
segdb2
segdb3
segdb4

gpssh -f hostfile_gpssh_segonly -e 'mkdir -p /home/gpdata1/mirror'
gpssh -f hostfile_gpssh_segonly -e 'mkdir -p / home/gpdata2/mirror'
gpssh -f hostfile_gpssh_segonly -e 'mkdir -p / home/gpdata3/mirror'
gpssh -f hostfile_gpssh_segonly -e 'mkdir -p / home/gpdata4/mirror'

Increased production mirrored profile
gpaddmirrors -o mirror_config_file
You need to enter the address of the mirror directory
/ home/gpdata1/mirror
/ home/gpdata2/mirror
/ home/gpdata3/mirror
/ home/gpdata4/mirror

View generated image configuration file:
more mirror_config_file
filespaceOrder=
mirror0=0:gpsegment-a2:41000:42000:43000:/ home/gpdata1/mirror/gp0
mirror1=1:gpsegment-a2:41001:42001:43001:/ home/gpdata2/mirror/gp1
mirror2=2:gpsegment-a2:41002:42002:43002:/ home/gpdata3/mirror/gp2
mirror3=3:gpsegment-a2:41003:42003:43003:/ home/gpdata4/mirror/gp3
mirror4=4:gpsegment-a3:41000:42000:43000:/ home/gpdata1/mirror/gp4
mirror5=5:gpsegment-a3:41001:42001:43001:/ home/gpdata2/mirror/gp5
mirror6=6:gpsegment-a3:41002:42002:43002:/ home/gpdata3/mirror/gp6
mirror7=7:gpsegment-a3:41003:42003:43003:/ home/gpdata4/mirror/gp7
mirror8=8:gpsegment-a4:41000:42000:43000:/ home/gpdata1/mirror/gp8
mirror9=9:gpsegment-a4:41001:42001:43001:/ home/gpdata2/mirror/gp9
mirror10=10:gpsegment-a4:41002:42002:43002:/ home/gpdata3/mirror/gp10
mirror11=11:gpsegment-a4:41003:42003:43003:/ home/gpdata4/mirror/gp11
mirror12=12:gpsegment-a1:41000:42000:43000:/ home/gpdata1/mirror/gp12
mirror13=13:gpsegment-a1:41001:42001:43001:/ home/gpdata2/mirror/gp13
mirror14=14:gpsegment-a1:41002:42002:43002:/ home/gpdata3/mirror/gp14
mirror15=15:gpsegment-a1:41003:42003:43003:/ home/gpdata4/mirror/gp15

Add Mirror
gpaddmirrors -i mirror_config_file

View synchronization status mirroring:
gpstate -e

Original articles published 0 · won praise 27 · views 80000 +

Guess you like

Origin blog.csdn.net/yimenglin/article/details/102975964