Greenplum cluster installation configuration (production environment)
Cluster system initialization information:
Https://blog.51cto.com/michaelkang/2167195
In this paper, sensitive information is replaced!
Download the software package:
Cd / workspace/gpdb/
Wget dl.#kjh#.com/greenplum-db-5.10.2-rhel7-x86_64.rpm
RPM mode
Installed to / usr/local/greenplum-db/ by default (executed in master as root)
Rpm-Uvh greenplum-db-5.10.2-rhel7-x86_64.rpm
Establish a node trust relationship to get through the password-free login of master to each node (executed in master as root) source / usr/local/greenplum-db/greenplum_path.shgpssh-exkeys-f / workspace/gpdb/gp-all.txt installs each node And set up gpadmin users (executed by root in master) gpseginstall-f / workspace/gpdb/gp-all.txt-u gpadmin-p gpadmin after installation check source / usr/local/greenplum-db/greenplum_path.shgpcheck-f / workspace/gpdb/gp-all.txt-m gpnode615.kjh.com gpnode616.kjh.com\-s gpnode611.kjh.com gpnode612.kjh.com gpnode613.kjh.com gpnode614.kjh.com create service installation folder (root user master node execution)
# gpssh tool can execute the same command on multiple machines at the same time, similar to ansible function
/ usr/local/gpdata: master data directory
/ data/gpdata: sg data directory
/ data01/gpdata: sg data directory
Gpssh-f / workspace/gpdb/gp-all.txt= > groupadd-g 1888 gpadminuseradd-g 1888-u 1888-m-d / home/gpadmin-s / bin/bash gpadminchown-R gpadmin.gpadmin / home/gpadminecho "gpadmin" | passwd-- stdin gpadminmkdir-p / usr/local/gpdata/gpmastermkdir-p / data/gpdata/primarymkdir-p / data01/gpdata/primarymkdir / data/gpdata/mirrormkdir / data01/gpdata/mirrorchown-R gpadmin:gpadmin / usr/local/gpdatachown-R gpadmin:gpadmin / data/gpdatachown-R gpadmin:gpadmin / Data01/gpdata Verification = > df-h | grep data [gpnode611.kjh.com] / dev/sdb 894G 33M 894G 1% / data01 [gpnode611.kjh.com] / dev/sda 894G 33M 894G 1% / data [gpnode612.kjh.com] / dev/sda 932G 33M 932G 1% / data01 [gpnode612.kjh.com] / dev/sdb 894G 33M 894G 1% / data [gpnode614.kjh.com] / dev / sda 932G 33M 932G 1% / data01 [gpnode614.kjh.com] / dev/sdb 932G 33M 932G 1% / data [gpnode613.kjh.com] / dev/sdb 932G 33M 932G 1% / data [gpnode613.kjh.com] / dev/sda 932G 33M 932G 1% / data01 setting up gpadmin account environment (gpadmin account operation Master node configuration) modify .bashrcsu-gpadmin cat > > / home/gpadmin/.bashrc/home/gpadmin/.bash_ profile [info]:-Master Configuration= > [INFO]:-- = > [INFO]:-Master instance name = PT Greenplum Data Platform= > [INFO]:-Master hostname = gpnode615.kjh.com= > [INFO]:- Master port = 5432 = > [INFO]:-Master instance dir = / usr/local/gpdata/gpmaster/gpseg-1= > [INFO]:-Master LOCALE = en_US.utf8.= > [INFO]:-Master IP address [4] = 172.20.6.15 = > [INFO]:-Master IP address [5] = 172.20.6.221. . = > [INFO]:-Standby Master = gpnode616.kjh.com= > [INFO]:-Primary segment # = 4 = > [INFO]:-Standby IP address =:: 1 = > [INFO]:-Standby IP address = 172.20.6.16 = > [INFO]:-Standby IP address = 172.20.6.220. .. = > [INFO]:-- = > [INFO]:-Greenplum Primary Segment Configuration= > [INFO]:-- = > [INFO]:-gpnode611.kjh.com / data/gpdata/primary / gpseg0 40000 2 0 41000 = > [INFO]:-gpnode611.kjh.com / data/gpdata/primary/gpseg1 40001 3 1 41001 = > [INFO]:-gpnode611.kjh.com / data01/gpdata/primary/gpseg2 40002 4 2 41002 = > [INFO]:-gpnode614.kjh.com / Data01/gpdata/primary/gpseg14 40002 16 14 41002 = > [INFO]:-gpnode614.kjh.com / data01/gpdata/primary/gpseg15 40003 17 15 41003 = > [INFO]:-- = > [INFO]:-Greenplum Mirror Segment Configuration= > [INFO]:- -- = > [INFO]:-gpnode612.kjh.com / data/gpdata/mirror/gpseg0 50000 18 0 51000 = > [INFO]:-gpnode612.kjh.com / data/gpdata/mirror/gpseg1 50001 19 1 51001.= > [INFO]: -gpnode611.kjh.com / data01/gpdata/mirror/gpseg14 50002 32 14 51002 = > [INFO]:-gpnode611.kjh.com / data01/gpdata/mirror/gpseg15 50003 33 15 51003 check the configuration is correct Confirm whether to execute or not?
Continue with Greenplum creation Yy | Nn (default=N):
Y
Output initialization completion summary information: = > = > [INFO]:-- = > [INFO]:-Parallel process exit status= > [INFO]:-- -= > [INFO]:-Total processes marked as completed = 16 = > [INFO]:-Total processes marked as killed = 0 = > [INFO]:-Total processes marked as failed = 0 = > [INFO]:-= > [INFO]:-Commencing Parallel build of mirror segment instances..= > = > [INFO]:-- = > [INFO]:-Parallel process exit status= > [INFO]:- -- = > [INFO]:-Total processes marked as completed = 16 = > [INFO]:-Total processes marked as killed = 0 = > [INFO]:-Total processes marked as failed = 0 = > [INFO]:-- -. Slightly = > = >]:-Process results...= >]:-Successful segment starts = 32 = >]:-Failed segment starts = 0 = >]:-Skipped segment starts (segments are marked down in configuration) = 0 = >]:-- -- = >]:-Successfully started 32 of 32 segment instances = >]: -. = >]: -- = >]:-Greenplum standby master initialization parameters= >]:-= >]:-Greenplum master hostname = gpnode615.kjh.com= >]:-Greenplum Master data directory = / usr/local/gpdata/gpmaster/gpseg-1= >]:-Greenplum master port = 5432 = >]:-Greenplum standby master hostname = gpnode616.kjh.com= >]:-Greenplum standby master port = 5432 = >]:-Greenplum standby master data directory = / usr/local/gpdata/gpmaster/gpseg-1= >]:-Greenplum update system catalog = On Cluster initialization output information is as follows: = >:-Greenplum Database Instance successfully created= >]:-= >]:-To complete the environment configuration Please = >]:-update gpadmin .bashrc file with the following= >]:-1. Ensure that the greenplum_path.sh file is sourced= >]:-2. Add "export MASTER_DATA_DIRECTORY=/usr/local/gpdata/gpmaster/gpseg-1" = >]:-to access the Greenplum scripts for this instance:= >]:-or, use-d / usr/local/gpdata/gpmaster/gpseg-1 option for the Greenplum scripts= >]:-Example gpstate-d / usr/local/gpdata/gpmaster/gpseg-1= >]:-Script log file = / home/gpadmin/gpAdminLogs/gpinitsystem_20180903.log= >]:-To remove instance Run gpdeletesystem utility= >]:-Standby Master gpnode616.kjh.com has been configured= >]:-To activate the Standby Master Segment in the event of Master= >]:-failure review options for gpactivatestandby= >]:-= >]:-The Master / usr/local/gpdata/gpmaster/gpseg-1/pg_hba.conf post Gpinitsystem= >]:-has been configured to allow all hosts within this new= >]:-array to intercommunicate. Any hosts external to this= >]:-new array must be explicitly added to this file= >]:-Refer to the Greenplum Admin support guide which is= >]:-located in the / usr/local/greenplum-db/./docs directory= >]:-system login initialization settings: psql modifies data Library password: psql-d testgpdb gpdb=# alter user gpadmin with password 'gpadmin' Gpdb=#\ qremote login # psql-p 5432-d testgpdb # query the current version of select * from version () Set listening IP and Portvi ${MASTER_DATA_DIRECTORY} / postgresql.conf# setting listening IP (* use cautiously in production environment) listen_addresses ='${host ip address} 'port = 5432 monitoring records # setting database whitelist vi ${MASTER_DATA_DIRECTORY} / pg_hba.conf# add the following record, allowing the user password mode and the range of IP addresses that can be logged in # TYPE DATABASE USER CIDR-ADDRESS METHODhost all gpadmin 0.0.0.0 md5# test login psql-p 5432-h 172.20.6.15-U gpadmin-d testgpdb so that the cluster configuration is complete.
You can use the commands in this article to view the cluster status:
Https://blog.51cto.com/michaelkang/2169857
Reference Information:
Https://gpdb.docs.pivotal.io/43170/install_guide/init_gpdb.html
Https://gp-docs-cn.github.io/docs/utility_guide/admin_utilities/gprecoverseg.html