greenplum單節點安裝

wanghao2979發表於2021-03-25

官方網址:



根據文件:

Greenplum Installation => Platform Requirements => Software Dependencies  安裝作業系統依賴包


yum install apr apr-util bash bzip2 curl krb5 libcurl libevent libxml2 libyaml zlib openldap openssh openssl openssl-libs perl readline rsync R sed tar zip gcc c++



配置作業系統:

Greenplum Installation => Configuring Your Systems


1.Make sure your host systems meet the requirements described in Platform Requirements.


2.Disable SELinux and firewall software.


vi /etc/selinux/config

SELINUX=disabled


3.Set the required operating system parameters.


Set the parameters in the /etc/sysctl.conf file and reload with sysctl -p:


# kernel.shmall = _PHYS_PAGES / 2 # See Shared Memory Pages

kernel.shmall = 197951838

# kernel.shmmax = kernel.shmall * PAGE_SIZE 

kernel.shmmax = 810810728448

kernel.shmmni = 4096

vm.overcommit_memory = 2 # See Segment Host Memory

vm.overcommit_ratio = 95 # See Segment Host Memory


net.ipv4.ip_local_port_range = 10000 65535 # See Port Settings

kernel.sem = 500 2048000 200 4096

kernel.sysrq = 1

kernel.core_uses_pid = 1

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.msgmni = 2048

net.ipv4.tcp_syncookies = 1

net.ipv4.conf.default.accept_source_route = 0

net.ipv4.tcp_max_syn_backlog = 4096

net.ipv4.conf.all.arp_filter = 1

net.core.netdev_max_backlog = 10000

net.core.rmem_max = 2097152

net.core.wmem_max = 2097152

vm.swappiness = 10

vm.zone_reclaim_mode = 0

vm.dirty_expire_centisecs = 500

vm.dirty_writeback_centisecs = 100

vm.dirty_background_ratio = 0 # See System Memory

vm.dirty_ratio = 0

vm.dirty_background_bytes = 1610612736

vm.dirty_bytes = 4294967296



4.System Resources Limits


Set the following parameters in the /etc/security/limits.conf file:


* soft nofile 524288

* hard nofile 524288

* soft nproc 131072

* hard nproc 131072


5.IPC Object Removal


Disable RemoveIPC. Set this parameter in /etc/systemd/logind.conf on the Greenplum Database host systems.

RemoveIPC=no


The setting takes effect after restarting the systemd-login service or rebooting the system. To restart the service, run this command as the root user.


service systemd-logind restart


6.add gpadmin user


# groupadd gpadmin

# useradd gpadmin -r -m -g gpadmin

# passwd gpadmin

New password: <changeme>

Retype new password: <changeme>



安裝 greenplum 資料庫軟體

Greenplum Installation => Installing the Greenplum Database Software


1.Installing Greenplum Database


rpm -ivh open-source-greenplum-db-6.15.0-rhel7-x86_64.rpm


2.Enabling Passwordless SSH


Log in to the master host as the gpadmin user.

Source the path file in the Greenplum Database installation directory.

$ source /usr/local/greenplum-db-<version>/greenplum_path.sh


Run the gpssh-exkeys utility with your hostfile_exkeys file to enable n-n passwordless SSH for the gpadmin user.

$ gpssh-exkeys -f hostfile_exkeys



初始化 greenplum 資料庫


Greenplum Installation => Initializing a Greenplum Database System


1.Creating the Greenplum Database Configuration File


[gpadmin@gp1 greenplum-db]$ pwd

/usr/local/greenplum-db

[gpadmin@gp1 greenplum-db]$ cat gpinitsystem_configbak | grep ^[a-zA-Z]

ARRAY_NAME="Greenplum"

SEG_PREFIX=gpseg

PORT_BASE=6000

declare -a DATA_DIRECTORY=(/home/gpadmin/gpdata/gp1 /home/gpadmin/gpdata/gp2 /home/gpadmin/gpdata/gp3 /home/gpadmin/gpdata/gp4)

MASTER_HOSTNAME=gp1

MASTER_DIRECTORY=/home/gpadmin/gpdata/master

MASTER_PORT=5432

TRUSTED_SHELL=ssh

CHECK_POINT_SEGMENTS=8

ENCODING=UNICODE

DATABASE_NAME=gpdb

MACHINE_LIST_FILE=/usr/local/greenplum-db/hostlist



2.Running the Initialization Utility


bin/gpinitsystem -c gpinitsystem_configbak -h hostlist



登入驗證


[gpadmin@gp1 greenplum-db]$ psql -U gpadmin -d gpdb

psql (9.4.24)

Type "help" for help.


gpdb=# select * from version();

                                                                                                      version                                                                                

                      

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------

 PostgreSQL 9.4.24 (Greenplum Database 6.15.0 build commit:4e6288c9e9fca634b007a978fba3ce25aae26aed Open Source) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on

 Mar 11 2021 18:31:50

(1 row)


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7569309/viewspace-2764904/,如需轉載,請註明出處,否則將追究法律責任。

相關文章