Greenplum installation detailed process

  Today, I helped other projects install GP again, plus the previous two times, this is the third time, although there is a record every time, but this installation still found that some steps were omitted, record it in detail here, you need to The children's shoes can learn from.

1. Prepare

  There are 4 servers prepared here, 1 for master, 1 for standby, and 4 for storage. In order to keep the real IP address and host name secret, they have been replaced by "stage name".

copy code
OS:Red Hat Enterprise Linux Server release 6.4 (Santiago)
GP:greenplum-db-4.3.6.2-build-1-RHEL5-x86_64.zip
JDK:1.7+

192.168.1.100  bj-gp-node1(segment master)
192.168.1.101  bj-gp-node2(segment standby)
192.168.1.102  bj-gp-node3(segment)
192.168.1.103  bj-gp-node4(segment)
copy code

Greenplum official website download address: http://gpn.greenplum.com/download.php (Note: You need to register to download)

 

2. System parameter configuration

  Modification of system parameter configuration needs to be performed on each node server

2.1. Modify Linux kernel parameters

copy code
[root@bj-gp-node1 ~]# vi /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.
#
# Use '/sbin/sysctl -a' to list all possible parameters.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Disable netfilter on bridges
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
kernel.msgmni = 2048

kernel.sem = 250 512000 100 2048

# Controls the maximum shared segment size, in bytes
#kernel.shmmax = 68719476736
kernel.shmmax = 500000000
kernel.shmmni = 4096

# Controls the maximum number of shared memory segments, in pages
#kernel.shmall = 4294967296
kernel.shmall = 4000000000

net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_max_syn_backlog=4096
net.ipv4.ip_local_port_range = 1025 65535
net.core.netdev_max_backlog=10000
vm.overcommit_memory=2
net.ipv4.conf.all.arp_filter = 1
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
copy code

 

2.2. Modify the maximum limit of Linux

copy code
[root@bj-gp-node1 ~]# vi /etc/security/limits.conf
#greenplum configs
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
copy code

 

2.3.I/O tuning optimization

[root@bj-gp-node1 ~]# vi /boot/grub/menu.lst
#greenplum configs
elevator=deadline

 

2.4. Add all nodes to HOST

[root@bj-gp-node1 ~]# vi /etc/hosts
192.168.1.100  bj-gp-node1
192.168.1.101  bj-gp-node2
192.168.1.102  bj-gp-node3
192.168.1.103  bj-gp-node4

 

2.5. Turn off the firewall

[root@bj-gp-node1 ~]# chkconfig --list iptables
[root@bj-gp-node1 ~]# chkconfig --level 0123456 iptables off

 

2.6. Setting SELINUX

[root@bj-gp-node1 ~]# vi /etc/selinux/config
SELINUX=disabled

 

2.7. Restart the system to make the configuration take effect

[root@bj-gp-node1 ~]# reboot

 

3. GP installation

  GP installation operations are performed on the master node master

3.1. Create gpadmin user

[root@bj-gp-node1 ~]# useradd gpadmin
[root@bj-gp-node1 ~]# passwd gpadmin

 

3.2. Setting up the gpadmin user environment

copy code
[gpadmin@bj-gp-node1 ~]$ cd /home/gpadmin
[gpadmin @ bj-gp-node1 ~] $ vi .bashrc
[gpadmin @ bj-gp-node1 ~] $ vi .bash_profile

Both .bashrc and .bash_profile add the following two lines at the end
source /usr/local/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/data1/gpdata/master/gpseg-1
copy code

After setting, remember to source it to make it take effect immediately

 

3.3. Upload and unzip the installation package

Upload greenplum-db-4.3.6.2-build-1-RHEL5-x86_64.zip to the master's /opt/ directory

[root@bj-gp-node1 opt]# /bin/bash greenplum-db-4.3.6.2-build-1-RHEL5-x86_64.bin

Enter Enter or yes as prompted. This step will extract the installation package to /usr/local/ and establish a soft connection greenplum-db

 

3.4. Prepare node server information file

These two files will be used in subsequent batch installations. If the contents of all_host and all_segment are the same, only one file can be created

copy code
[root@bj-gp-node1 opt]# mkdir -p /opt/gpinit/
[root@bj-gp-node1 gpinit]# touch all_host
[root@bj-gp-node1 gpinit]# touch all_segment
all_host and all_segment content:
bj-gp-node1
bj-gp-node2
bj-gp-node3
bj-gp-node4
copy code

 

3.5. Establish trust between node servers

[root@bj-gp-node1 local]# gpssh-exkeys -f /opt/gpinit/all_host

Enter the root password as prompted, remember that you cannot enter the gpadmin password in this step, because a directory needs to be created under /usr/local during batch installation, and root privileges are required

 

3.6. Batch installation

[root@bj-gp-node1 local]# gpseginstall -f /opt/gpinit/all_host -u gpadmin -p gpadmin

This step is actually to package the greenplum on the master and transfer it to the host in all_host through the scp command, and give the permission of the directory gpadmin

 

3.7. Check batch installation

[root@bj-gp-node1 local]# gpssh -f /opt/gpinit/all_host -e ls -l $GPHOME

If the directory of each node in the returned result is consistent, it is successful

 

3.8. Create a storage directory

copy code
master
[root@bj-gp-node1 local]# mkdir -p /data1/gpdata/master
[root@bj-gp-node1 local]# chown gpadmin:gpadmin /data1/gpdata/master

segment
[root@bj-gp-node1 local]# gpssh -f /opt/gpinit/all_host -e 'mkdir -p /data1/gpdata/primary'
[root@bj-gp-node1 local]# gpssh -f /opt/gpinit/all_host -e 'chown gpadmin:gpadmin /data1/gpdata/primary'

mirror
[root@bj-gp-node1 local]# gpssh -f /opt/gpinit/all_segment -e 'mkdir -p /data1/gpdata/mirror'
[root@bj-gp-node1 local]# gpssh -f /opt/gpinit/all_segment -e 'chown gpadmin:gpadmin /data1/gpdata/mirror'
 
copy code

 

3.9. Set Clock Synchronization

copy code
vi /etc/ntp.conf Add the following two lines to the first line of the server
server 192.168.1.1
server 192.168.1.2
Restart the ntpd service /etc/init.d/ntpd restart
View ntp synchronization ntpq -p
Enable chkconfig --level 0123456 ntpd on after the ntpd service restarts the server
copy code

 

3.10. Create GP initialization file

[gpadmin@bj-gp-node1 ~]$ mkdir /home/gpadmin/gpconfigs
[gpadmin@bj-gp-node1 ~]$ cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config /home/gpadmin/gpconfigs/gpinitsystem_config
[gpadmin@tj-soc-c04-csfb1 gpconfigs]$ chmod 775 gpinitsystem_config

 

3.10 Modify GP initialization file

copy code
[gpadmin@bj-gp-node1 gpconfigs]$ vi gpinitsystem_config

# FILE NAME: gpinitsystem_config

# Configuration file needed by the gpinitsystem

################################################
#### REQUIRED PARAMETERS
################################################

#### Name of this Greenplum system enclosed in quotes.
ARRAY_NAME="BJ Greenplum DW"

#### Naming convention for utility-generated data directories.
SEG_PREFIX=gpseg

#### Base number by which primary segment port numbers
#### are calculated.
PORT_BASE=40000

#### File system location(s) where primary segment data directories
#### will be created. The number of locations in the list dictate
#### the number of primary segments that will get created per
#### physical host (if multiple addresses for a host are listed in
#### the hostfile, the number of segments will be spread evenly across
#### the specified interface addresses).
declare -a DATA_DIRECTORY=(/data1/gpdata/primary /data1/gpdata/primary)

#### OS-configured hostname or IP address of the master host.
MASTER_HOSTNAME=bj-gp-node1

#### File system location where the master data directory
#### will be created.
MASTER_DIRECTORY=/data1/gpdata/master

#### Port number for the master instance.
MASTER_PORT=5432

#### Shell utility used to connect to remote hosts.
TRUSTED_SHELL=ssh

#### Maximum log file segments between automatic WAL checkpoints.
CHECK_POINT_SEGMENTS=8

#### Default server-side character set encoding.
ENCODING=UNICODE

################################################
#### OPTIONAL MIRROR PARAMETERS
################################################

#### Base number by which mirror segment port numbers
#### are calculated.
MIRROR_PORT_BASE=50000

#### Base number by which primary file replication port
#### numbers are calculated.
REPLICATION_PORT_BASE=41000

#### Base number by which mirror file replication port
#### numbers are calculated.
MIRROR_REPLICATION_PORT_BASE=51000

#### File system location(s) where mirror segment data directories
#### will be created. The number of mirror locations must equal the
#### number of primary locations as specified in the
#### DATA_DIRECTORY parameter.
declare -a MIRROR_DATA_DIRECTORY=(/data1/gpdata/mirror /data1/gpdata/mirror)


################################################
#### OTHER OPTIONAL PARAMETERS
################################################

#### Create a database of this name after initialization.
DATABASE_NAME=bj_gp

#### Specify the location of the host address file here instead of
#### with the the -h option of gpinitsystem.
#MACHINE_LIST_FILE=/home/gpadmin/gpconfigs/hostfile_gpinitsystem

 
copy code

 

3.11. Initialize GP

[gpadmin@bj-gp-node1 ~]$ gpinitsystem -c /home/gpadmin/gpconfigs/gpinitsystem_config -h /opt/gpinit/all_host
You need to enter once in the middle: Y

 

If no ERROR is reported, the GP database is installed. Here are some additional operations

 

4. Additional items

4.1 Increase standby

Only one master in a gp cluster will definitely make people feel uneasy. Fortunately, there is a backup. When the master goes down, the standby will be automatically enabled as the master. Let's see how to add the standby.

copy code
Execute on the standby server
[root@bj-gp-node2 ~]# mkdir /data1/gpdata/master
[root@bj-gp-node2 ~]# chown gpadmin:gpadmin /data1/gpdata/master

Execute on the master server  
[gpadmin@bj-gp-node1 ~]$ gpinitstandby -s bj-gp-node2
Enter Y once in the middle
copy code

 

4.2. Increase mirror

Mirror is a mirror, also called data backup. Mirror is very important for data storage, because our server is not sure when something goes wrong. It is much better to have mirror, because the probability of two storage nodes going down at the same time is still very small. If you forgot to configure mirror in the GP initialization file, please add it as follows

[gpadmin@bj-gp-node1 ~]$ gpaddmirrors -p 1000
During the running process, you need to enter the mirror path twice: /data1/gpdata/mirror

 

4.3. Setting access rights

Open /data1/gpdata/master/gpseg-1/pg_hba.conf and add the client ip or network segment in the format below

#user define
host    all     all     192.168.1.0/24   trust
host    all     all     127.0.0.1/28    trust

 

4.4. Access method

It can be accessed through the gpAdmin desktop client or the command line. Let's talk about the command line access method. Loach is the user added later.

[gpadmin@bj-gp-node1 ~]$ psql -d tj_csfb -h bj-gp-node1 -p 5432 -U gpadmin
[gpadmin@bj-gp-node1 ~]$ psql -d tj_csfb -h bj-gp-node1 -p 5432 -U loach

 

4.5. Create User

After logging in through the command line, execute the following command

CREATE ROLE loach WITH LOGIN;
ALTER ROLE loach WITH PASSWORD 'loach';

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326021374&siteId=291194637