Greenplum Database Expansion Practice (UP)-Preparation work

Source: Internet
Author: User
Tags uuid shebang

Any distributed system will have to face the matter of expansion, or the significance of the distribution system is greatly discounted, this article on the GP to expand the preparation process, in fact, the implementation of the expansion is a very simple process, the main thing to do is to prepare.

Preparing to create a host information file

Create 6 host information files with GP Administrator OS user gpadmin:

    • /home/gpadmin/20150523exp/currenthosts: Host name of all hosts that currently exist
    • /home/gpadmin/20150523exp/currentnodes: The host name of all hosts currently in existence, and the address used by SEG node, for example:
sdw1sdw1-1sdw1-2sdw2sdw2-1sdw2-2...
    • /home/gpadmin/20150523exp/newhosts: Host name of the new host for this expansion
    • /home/gpadmin/20150523exp/newnodes: Host name of the new host for this expansion, and the address used by SEG node
    • /home/gpadmin/20150523exp/allhosts: New Old plus host name
    • /home/gpadmin/20150523exp/allnodes: New Old plus host name, and the address used by SEG node
Operating system installation and configuration
    • Install new host OS: All configurations should be consistent with existing hosts, and in special cases (e.g. new servers no longer support the old OS), you can use the higher version OS on the new host in the OS Compatibility List of the GP itself.
    • Root login mdw (GP master), write a script/root/uetchosts20150523.sh:
#!/bin/bashEcho–e >>/etc/hostsEcho "#20150523 expand hosts Begin">>/etc/hostsEcho 192.168.1.26sdw26-1Sdw26 >>/etc/hostsEcho 192.168.2.26sdw26-2>>/etc/hostsEcho–e >>/etc/hostsEcho 192.168.1.27sdw27-1Sdw27 >>/etc/hostsEcho 192.168.2.27sdw27-2>>/etc/hosts ...Echo "#20150523 Expand hosts End">>/etc/hostsEcho–e >>/etc/hosts
    • Update the Hosts file for all existing hosts with this script to add the domain name resolution for the new host
755 /root/uetchosts20150523.shgpscp -f /home/gpadmin/currenthosts uetchosts20150523.sh =:/root/gpssh -f /home/gpadmin/currenthosts /root/uetchosts20150523.sh
    • Update the new host's Hosts:root login to the new 8 additional servers and add all the definitions of the GP host in the/etc/hosts file of the existing SEG host to the/etc/hosts
Exchanging root authorization information

Root login mdw, follow the prompts to enter the root password of the new server

source /usr/local/greenplum-db/greenplum_path.shgpssh-exkeys-e /home/gpadmin/20150523-x /home/gpadmin/20150523
Create Gpadmin User
gpssh -f /home/gpadmin/20150523exp/newhosts=> useradd gpadmin -d /home/gpadmin=> echo p@ssword | passwd gpadmin --stdin=> ll /home=> exitsu - gpadmingpssh-exkeys -e /home/gpadmin/20150523exp/currentnodes -x /home/gpadmin/20150523exp/newnodesexit
Change the operating system configuration and create a data file path
Gpscp-f/home/gpadmin/20150523exp/newhosts/etc/security/limits.conf =:/etc/security/limits.confgpscp-f/home/ gpadmin/20150523exp/newhosts/etc/security/limits.d/90-nproc.conf =:/etc/security/limits.d/90-nproc.confgpscp-f/ home/gpadmin/20150523exp/newhosts/etc/sysctl.conf =:/etc/sysctl.confgpssh-f/home/gpadmin/20150523exp/newhosts=> Sysctl–p=> Mkdir/data1/primary/data1/mirror/data2/primary/data2/mirror/data3/primary/data3/mirror/data4/primary/ Data4/mirror=> Chown-R gpadmin:gpadmin/data1' => Chown-R gpadmin:gpadmin/data2' => Chown-R gpadmin:gpadmin/data3' => Chown-R gpadmin:gpadmin/data4' => LL/=> Ll/data1/data2/data3/data4=> ExitGpssh-f/home/gpadmin/20150523exp/allhosts => Echo ' Deadline ' > /sys/block/sda/queue/scheduler => Echo ' Deadline ' > /sys/block/sdb/queue/scheduler => Echo ' Deadline ' > /sys/block/sdc/queue/scheduler => Echo ' Deadline ' > /sys/block/sr0/queue/scheduler => Exit
Install GP and set up your device
-f /home/gpadmin/20150523-u-p-f /root/20150523$GPHOME
Compiling the release UUID

If you are using some third-party packages, you will need to compile the publication in the new SEG host, where the UUID is used as an example:

Source/usr/local/greenplum-db/greenplum_path.shgpscp-f/home/gpadmin/20150523exp/newhosts/home/gpadmin/ uuid-1.6.2.tar.gz =:/home/gpadmingpssh-f/home/gpadmin/20150523exp/newhosts=> Source/usr/local/greenplum-db/greenplum_path.sh=> Cd/home/gpadmin=> Tar zxvf uuid-1.6. 2. tar.gz=> CD uuid-1.6. 2 =>./configure--prefix=/usr/local/greenplum-db--with-pgsql => Make=> Make install=> Chown-R gpadmin:gpadmin/usr/local/greenplum-db-4.3. 5.0 => ll/usr/local/greenplum-db-4.3. 5.0/libuuid*=> ll/usr/local/greenplum-db-4.3. 5.0/lib/postgresql/uuid*=> Echo "source/usr/local/greenplum-db/greenplum_path.sh" >> /home/gpadmin/.bash _profile => Cat/home/gpadmin/.bash_profile=> LL $GPHOME => Exit
Check OS configuration and Performance Check all node status
-f /root/20150523exp/allnodes

You may encounter the following issues during this process:

    • All nodes have the following alarms, which can be ignored:
20150520:15:45:48:034gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw25): on device (/dev/sdc‘256‘not‘16384‘
    • DNS and NTP with machines are not properly configured and can be resolved by scripting:
20150520::: Geneva: 035830 Gpcheck: MDW: root-[ERROR]:-gpcheck_error Host(sdw24):Potential NTPD Issue.Gpcheck Start  Time(Wed  May20 15:: xx2015) Time  on  Machine(Wed  May20 15:: Approx .2015)
gpscp -f /home/gpadmin/20150523exp/allhosts /etc/resolv.conf =:/etc/resolv.confgpssh -f /home/gpadmin/20150523exp/allhosts=> service ntpd stop=> ntpdate ntp.citicsinfo.com=> service ntpd start=> exitgpssh -h sdw22 -h sdw23 -h sdw24=> echo server ntp.citicsinfo.com >> /etc/ntp.conf=> service ntpd stop=> service ntpd start=> exit
    • The newly added machine operating system version is inconsistent with the existing machine and can be ignored
20150520:15:49:15:038134 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw27): uname -r output different among hosts: sdw25 : 2.6.32-220.el6.x86_64 != sdw27 : 2.6.32-431.el6.x86_64
Check the performance of the new node
-f /home/gpadmin/20150523-d-d-d-d-v

Check the results as long as the IO is around 1gb/s, there is no problem

Generate the input files required for expansion
su - gpadmincd /home/gpadmin/20150523-f /home/gpadmin/20150523exp/newhosts -D dw

Enter two Y, then enter two carriage return; the makefile is similar to the following name: gpexpand_inputfile_20150520_161055

Data backup
pg_dump -f /data/dailybak/dw-nodata-$(date +%Y%m%d%H%M%S) -v -F c -C --inserts -s databasename

If recovery is required, use the following statement:

-d5432 /data/dailybak/dw####_nodata

Greenplum Database Expansion Practice (UP)-Preparation work

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.