源码编译安装greenplum 5.0

借鉴:http://www.cnblogs.com/scoter2008/p/5928972.html


基于Centos 7


编译前的准备工作:

关闭防火墙

systemctl start firewalld.service#启动firewall
systemctl stop firewalld.service#停止firewall
systemctl disable firewalld.service#禁止firewall开机启动
systemctl enable firewalld.service#允许firewall开机启动

关闭selinux

sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config

 在/etc/sysctl.conf文件中加入有关共享内存与网络参数配置

net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 1
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
kernel.sem = 250 512000 100 2048
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.shmall = 4194304
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
net.core.somaxconn = 1024

在/etc/security/limits.conf中加入限制参数

* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
执行sysctl -p让配置生效


安装greenplum所需的库

yum install -y curl-devel bzip2-devel python-devel openssl-devel wget perl-ExtUtils-Embed libxml2-devel openldap-devel pam pam-devel
yum install -y gcc-c++ libtool libaio bison vim-common.x86_64 vim-enhanced.x86_64 flex net-tools.x86_64 apr-devel readline-devel libevent-devel
安装python库

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install psi lockfile paramiko setuptools epydoc psutil
pip install --upgrade setuptools


创建用户gpadmin:

useradd gpadmin


configure源码,进入源码目录:

./configure --prefix=/usr/local/greenplum-5.0 --with-gssapi --with-pgport=9900 --with-libedit-preferred --with-perl --with-python --with-openssl --with-pam --with-krb5 --with-ldap --with-libxml --enable-cassert --enable-debug --enable-testutils --enable-debugbreak --enable-depend --

make -j20

make install

之后使用root用户执行:chown -R -v gpadmin:gpadmin  /usr/local/greenplum-5.0

进入gpadmin用户:

su gpadmin

echo '. /usr/local/gp-5.0/greenplum_path.sh' >> ~:.bashrc
echo 'export MASTER_DATA_DIRECTORY=/home/gpadmin/master/gpseg-1' >> ~.bashrc



编译安装Greenplum数据库,您可以按照以下步骤进行操作: 1. 首先,确保您的系统满足Greenplum的要求。Greenplum支持在Linux系统上运行,如CentOS或Ubuntu。您应该有root访问权限以安装软件包并更改系统设置。 2. 下载Greenplum软件包。您可以从Greenplum官方网站(https://greenplum.org/)下载最新版本的软件包。选择适合您的操作系统和架构的版本。 3. 解压软件包。将下载的软件包解压到您选择的目录中。您可以使用命令行或图形界面工具进行解压。 4. 创建一个用户组和一个用户来运行Greenplum。建议为Greenplum创建一个专用用户和组,以提供更好的安全性和管理。您可以使用以下命令创建用户组和用户: ``` sudo groupadd gpadmin sudo useradd -m -g gpadmin gpadmin ``` 5. 设置环境变量。编辑gpadmin用户的bash配置文件(通常是~/.bashrc或~/.bash_profile),添加以下行: ``` export MASTER_DATA_DIRECTORY=/data/gpdata # 定义Greenplum的数据目录 export PATH=$PATH:/usr/local/greenplum/bin # 添加Greenplum可执行文件路径 ``` 确保将路径`/usr/local/greenplum/bin`替换为您解压缩软件包的路径。 6. 执行安装脚本。使用gpadmin用户登录,并执行以下命令安装Greenplum: ``` cd /path/to/greenplum ./configure --prefix=/usr/local/greenplum make sudo make install ``` 请确保将`/path/to/greenplum`替换为您解压缩软件包的路径。 7. 初始化Greenplum集群。执行以下命令初始化Greenplum集群: ``` source /usr/local/greenplum/greenplum_path.sh # 加载Greenplum环境变量 gpseginstall -f /path/to/hostfile # 使用主机文件安装Greenplum段 ``` 请确保将`/path/to/hostfile`替换为包含所有Greenplum段主机的文本文件路径。 8. 启动Greenplum集群。执行以下命令启动Greenplum集群: ``` gpstart -a ``` 9. 验证安装。您可以使用以下命令验证Greenplum是否成功安装: ``` ps -ef | grep postgres ``` 如果看到与Greenplum相关的进程,则表示安装成功。 这些是编译安装Greenplum的基本步骤。请注意,这只是一个简要的指南,具体步骤可能因您的系统和需求而有所不同。有关更详细的说明,请参阅Greenplum官方文档或在社区中寻求帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值