Greenplum【环境搭建 01】CentOS Linux release 7.5 环境单机版详细安装配置步骤+问题解决(含安装包资源)
生活随笔
收集整理的這篇文章主要介紹了
Greenplum【环境搭建 01】CentOS Linux release 7.5 环境单机版详细安装配置步骤+问题解决(含安装包资源)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
安裝文件
greenplum-db-6.13.0-rhel7-x86_64.rpm
鏈接:https://pan.baidu.com/s/1-Wep7oQ4GTQpwdr7Y7sOhw
提取碼:emhd
1.查看環(huán)境
- 防火墻:
開了以后需要各種設置,很可能造成各種外部的連接不成功,比如ftp、telnet、ssh…(有些問題并不是浮在表面,你根本不知道是防火墻的鍋),簡單起見云服務器可以關閉防火墻而使用容易配置的安全組。
- SELinux:
SELinux策略是白名單原則,需要非常清楚安裝軟件使用的權限才能配置好(配置麻煩不說,頭疼的是你不知道需要什么權限),而Linux已經有了比較完善的Security Best Practice。在Linux上部署工具有更多的實踐經驗和可行方案去保證系統(tǒng)的安全,即便是沒有SELinux,是故大家普遍選擇關閉SELinux。
# 查看防火墻是否關閉,未關閉使用(systemctl stop firewalld) systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)# 查看selinux狀態(tài),未關閉修改(SELINUX=disabled) cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted2.修改配置
# 未設置 /etc/sysctl.conf /etc/security/limits.conf3.添加組及用戶
添加組及用戶是很重要的,很多操作必須在特定用戶下執(zhí)行,之前安裝postgresql遇到很多這方面的坑,大家小心。
groupadd gpadmin useradd -r -m -g gpadmin gpadmin # 給 gpadmin 用戶設置密碼 passwd gpadmin # 刪除組 groupdel gpadmin 刪除用戶 userdel gpadmin echo "RemoveIPC=no" >> /etc/systemd/logind.conf service systemd-logind restart4.安裝
[root@tcloud greenplum]# rpm -Uvh greenplum-db-6.13.0-rhel7-x86_64.rpm error: Failed dependencies:apr is needed by greenplum-db-6-6.13.0-1.el7.x86_64apr-util is needed by greenplum-db-6-6.13.0-1.el7.x86_64krb5-devel is needed by greenplum-db-6-6.13.0-1.el7.x86_64libevent is needed by greenplum-db-6-6.13.0-1.el7.x86_64# 報依賴缺失,直接使用 yum install,所需依賴自動安裝。 [root@tcloud greenplum]# yum install -y greenplum-db-6.13.0-rhel7-x86_64.rpm # 默認安裝到/usr/local下 lrwxrwxrwx 1 root root 30 Jul 5 10:00 greenplum-db -> /usr/local/greenplum-db-6.13.0 drwxr-xr-x 11 root root 4096 Jul 5 10:00 greenplum-db-6.13.0 # 賦權 chown -R gpadmin /usr/local/greenplum* chgrp -R gpadmin /usr/local/greenplum*# 使環(huán)境變量生效 source /usr/local/greenplum-db/greenplum_path.sh5.初始化準備
# 創(chuàng)建實例目錄(主節(jié)點及segment實例存儲文件夾gpnode個數(shù)視服務器情況而定) mkdir -p /home/greenplum/gpdata/master mkdir -p /home/greenplum/gpdata/gpnode1 mkdir -p /home/greenplum/gpdata/gpnode2 mkdir -p /home/greenplum/gpdata/gpnode3 mkdir -p /home/greenplum/gpdata/gpnode4# 修改目錄屬主 chown -R gpadmin:gpadmin /home/greenplum/ chown -R gpadmin:gpadmin /home/greenplum/gpdata chown -R gpadmin:gpadmin /home/greenplum/gpdata/master chown -R gpadmin:gpadmin /home/greenplum/gpdata/gpnode*6.以下使用gpadmin用戶操作
su gpadmin# ----環(huán)境變量配置 # postgresql默認端口號5432 這里使用2345 cat <<EOF >> /home/greenplum/.bashrc source /usr/local/greenplum-db/greenplum_path.sh export PGPORT=2345 export PGUSER=gpadmin export MASTER_DATA_DIRECTORY=/home/greenplum/gpdata/master/gpseg-1 export PGDATABASE=gpdb # export LD_PRELOAD=/lib64/libz.so.1 ps EOF source /home/greenplum/.bashrc# ----節(jié)點host配置(單機版值配置一個master節(jié)點) cat <<EOF >> /home/greenplum/hostfile_exkeys tcloud EOF# ----ssh權限互通設置 gpssh-exkeys -f /home/greenplum/hostfile_exkeys# ----設置節(jié)點服務器(單機版就是master節(jié)點) cat <<EOF >> /home/greenplum/seg_hosts_file tcloud EOF# ----編輯gp初始化文件 cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config /home/greenplum/gpinitsystem_configvim /home/greenplum/gpinitsystem_config # 以下為配置文件內容 declare -a DATA_DIRECTORY=(/home/greenplum/gpdata/gpnode1 /home/greenplum/gpdata/gpnode2) MASTER_HOSTNAME=tcloud MASTER_PORT=2345 MASTER_DIRECTORY=/home/greenplum/gpdata/master DATABASE_NAME=gpdb# ---- 初始化(-s xx代表備用主節(jié)點是xx機器 單機無需配置) gpinitsystem -c gpinitsystem_config -h seg_hosts_file初始化,輸入Y繼續(xù)…
7.使用設置
# psql登錄修改密碼 psql -p 2345 # 修改數(shù)據庫密碼 alter role gpadmin with password 'xxxxxx'; # 遠程連接配置 vim /home/greenplum/gpdata/master/gpseg-1/pg_hba.conf # 添加: host all gpadmin 0.0.0.0/0 md5 # 重新加載配置文件 gpstop -u
重新加載配置文件報錯
8.其他命令
gpstart #正常啟動 gpstop #正常關閉 gpstop -M fast #快速關閉 gpstop –r #重啟總結
第二部分的配置文件沒有進行修改,這部分要根據實際情況進行配置,本文旨在單機安裝gp數(shù)據庫,具體使用方法需要更多的學習??
總結
以上是生活随笔為你收集整理的Greenplum【环境搭建 01】CentOS Linux release 7.5 环境单机版详细安装配置步骤+问题解决(含安装包资源)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微信公众号 Spring Cloud 相
- 下一篇: 【Windows环境】Fiddler发送