一、環境準備:
作業系統:centos-7-x86_64-minimal-1810.iso
資料庫:greenplum-db-6.2.1-rhel7-x86_64.rpm
集群配置:1 master,1 primary segment , 1個mirror segment
二、安裝linux系統後配置
2.1 基本配置
關閉防火牆:
systemctl stop firewalld
禁止防火牆開機啟動:
systemctl disable firewalld
修改主機名:
hostnamectl set-hostname master
配置主機網域名稱:/etc/hosts
192.168.111.111 master
關閉selinux:/etc/selinux/config
selinux=disabled
2.2 修改核心:/etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.all.arp_filter = 1
net.ipv4.ip_local_port_range = 1025 65535
net.core.netdev_max_backlog= 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
net.core.somaxconn = 2048
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmni = 2048
kernel.msgmax = 65536
kernel.msgmnb = 65536
kernel.shmmni = 4096
kernel.shmmax = 500000000
kernel.shmall = 4000000000
kernel.sem = 250 64000 100 512
vm.overcommit_memory = 2
2.3 修改檔案描述符檔案:/etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
sysctl -p使配置生效
三、安裝資料庫
3.1 安裝命令:
rpm -uvh greenplum-db-6.2.1-rhel7-x86_64.rpm
或者yum -y install greenplum-db-6.2.1-rhel7-x86_64.rpm
3.2 建立gpadmin使用者並授權:
useradd gpadmin
passwd gpadmin (密碼設為gpadmin123)
chown -r gpadmin /usr/local/greenplum*
chgrp -r gpadmin /usr/local/greenplum*
3.3 切換到gpadmin使用者,並建立資料目錄:
mkdir -p /data/gpdata/master
mkdir -p /data/gpdata/primary
mkdir -p /data/gpdata/mirror
3.4 設定gpadmin使用者的環境變數:.bash_profile和.bashrc
source /usr/local/greenplum-db/greenplum_path.sh
export master_data_directory=/data/gpdata/master/gpseg-1
export pgport=5432
export pguser=gpadmin
export pgdatabase=gpdb
使環境變數生效:
source .bash_profile .bashrc
3.5 新增節點伺服器檔案(本例是單機,故只需要寫乙個):/home/gpadmin/seg_hosts
master
3.6 設定ssh免密:
ssh-keygen
ssh-copy-id master
gpssh-exkeys -f /home/gpadmin/seg_hosts
四、初始化資料庫
4.1 複製配置檔案
cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config /home/gpadmin/initgreenplum
declare -a data_directory=(/data/gpdata/primary)
master_hostname=master
master_directory=/data/gpdata/master
master_port=5432
mirror_port_base=7000
database_name=gpdb
declare -a mirror_data_directory=(/data/gpdata/mirror)
machine_list_file=/home/gpadmin/seg_hosts
4.3 執行初始化命令
gpinitsystem -c /home/gpadmin/initgreenplum
4.4 psql登入修改密碼
psql -p 2345
修改資料庫密碼
alter role gpadmin with password '1234';
退出: \q
4.5 遠端連線配置
vim /data/gpdata/master/gpseg-1/postgresql.conf
修改:#listen_addresses = '*',去#注釋
vim /data/gpdata/master/gpseg-1/pg_hba.conf
新增:host all gpadmin 0.0.0.0/0 md5
gpstop -u
其他啟停命令
gpstart #正常啟動
gpstop #正常關閉
gpstop -m fast #快速關閉
gpstop –r #重啟
Centos7單機安裝torque
1 修改主機名稱 vi etc hosts 127.0.0.1 sce2 wget 3 在root使用者下,解壓檔案 tar zxvf torque 4.2.9.tar.gz cd torque 4.2.9 4 編譯安裝 yum install libxml2 devel openssl devel...
centos7安裝MongoDB 單機
軟體所在位置 root 236 mongodb linux x86 64 3.6.13 pwd usr local mongodb linux x86 64 3.6.13 root 236 mongodb linux x86 64 3.6.13 vi etc profile export mongo...
centos7單機安裝kafka
基礎要求作業系統 centos 7x 64位 kafka版本 kafka 2.11 0.8.2.1 提取碼 ns3c 1 關閉selinux 開放防火牆9092埠 root wzy x vi etc selinux config root wzy x tail 2 etc selinux confi...