[单机搭建]Ubuntu-GreenPlum

安装greenplum单机版:

1.关闭SELINUX

vim /etc/selinux/config

SELINUX=disabled

2.关闭防火墙

systemctl stop firewalld.service #停止防火墙

systemctl disable firewalld.service #在开机时禁用服务

3.安装单机版GP

gp安装准备

3.1改机器名

#查机器名

unmame -a

#改名为bigdata

3.2创建gpaadmin用户和用户组(也可以不创建)

groupadd -g 3030 gpadmin

//mkdir /home/gpdata

    useradd -u 3030 gpadmin -g gpadmin -d /home/hadoop/gpdata

    passwd gpadmin

    (密码bigdata2018)

    #补充知识点:删除 groupdel gpadmin userdel gpadmin

3.3配置内核参数

vim /etc/sysctl.conf

以下面内容覆盖原有内容:

kernel.shmmax = 500000000

kernel.shmmni = 4096

kernel.shmall = 4000000000

kernel.sem = 250 512000 100 2048

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_tw_recycle = 1

net.ipv4.tcp_max_syn_backlog = 4096

net.ipv4.conf.all.arp_filter = 1

net.ipv4.ip_local_port_range = 10000 65535

net.core.netdev_max_backlog = 10000

net.core.rmem_max = 2097152

net.core.wmem_max = 2097152

vm.overcommit_memory = 2

使生效

sysctl -p

3.4  vim /etc/security/limits.conf

以下面内容覆盖:

• soft nofile 65536

• hard nofile 65536

• soft nproc 131072

• hard nproc 131072

3.5CentOS7需要加入服务logind

echo “RemoveIPC=no” >> /etc/systemd/logind.conf

service systemd-logind restart

3.6重启服务器reboot

4.gp安装

4.1设置host

vim /etc/hosts

添加:172.16.250.106 bigdata

172.16.250.106 这里更改成你自己的ip地址

vim /etc/sysconfig/network

添加:hostname=bigdata

4.2 开始安装(使用root安装)
使用的安装包是 greenplum-db-6.0.0-ubuntu18.04-amd64.deb
sudo dpkg –i greenplum-db-6.0.0-ubuntu18.04-amd64.deb
即可,默认的安装目录是:
/usr/local/greenplum-db
赋权限
chown -R gpadmin:gpadmin -R /usr/local/greenplum*

4.3创建instance需要的目录

mkdir -p /home/gpdata

mkdir -p /home/gpdata/master

mkdir -p /home/gpdata/gp1

mkdir -p /home/gpdata/gp2

mkdir -p /home/gpdata/gp3

mkdir -p /home/gpdata/gp4

#修改目录属主

chown -R gpadmin:gpadmin /home/gpdata

chown -R gpadmin:gpadmin /home/gpdata/master

chown -R gpadmin:gpadmin /home/gpdata/gp*

4.4切换用户gpadmin

su gpadmin

进入$开头的bash环境

vim .bash_profile

添加以下:

source /usr/local/greenplum-db-6.2.1/greenplum_path.sh

export MASTER_DATA_DIRECTORY=/home/gpdata/master/gpseg-1

export PGPORT=2345

export PGUSER=gpadmin

export PGDATABASE=gpdb

vim .bashrc

source /usr/local/greenplum-db-6.2.1/greenplum_path.sh

export MASTER_DATA_DIRECTORY=/home/gpdata/master/gpseg-1

export PGPORT=5432

export PGUSER=gpadmin

export PGDATABASE=gpdb

4.5设置子节点的host

在软件安装目录下

vim all_hosts_file

bigdata

添加一行bigdata(单机版只有一个host)

在此,需要安装一个python(见python安装文档)

4.6权限互通

source /usr/local/greenplum-db-6.2.1/greenplum_path.sh

python2.7 bin/gpssh-exkeys -f all_hosts_file

4.6 编辑gp初始化文件

cd /usr/local/greenplum-db-6.0.0

cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_singlenode /usr/local/greenplum-db/gpconfigs

内容如下:

ARRAY_NAME=”GPDB”

SEG_PREFIX=gpseg

PORT_BASE=40000

# Define Data Directory

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

MASTER_HOSTNAME=ubuntu18

MASTER_PORT=5432

MASTER_DIRECTORY=/home/gpadmin/gpdata/master

DATABASE_NAME=sordb

ENCODING=UNICODE

4.7 进行初始化

gpinitsystem -c gpconfigs -h all_hosts_file

4.8配置pg_hba.conf,然后gpstop、gpstart,添加如下内容

分类上一篇:     分类下一篇:

Leave a Reply