1操作系统环境
1-RedHat Enterprise Linux 4.0 or higher(RHEL4 or RHEL5)
2-CentOS 5.0 or higher
3-Solaris x86 v10 update 4
1.2硬件环境
1-2 dual-core CPUs (typically Xeon or Opteron)
2-16 GB of RAM
3-2 Gigabit Ethernet interfaces
4-1 SATA RAID disk controller per 8 drives
5-16 SATA 400 GB hard drives
二、系统安装与初始化
2.1安装前准备
1-在/etc/sysctl.conf 文件中加入有关共享内存与网络参数配置
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 64000 100 512
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_max_syn_backlog=4096
net.core.netdev_max_backlog=10000
vm.overcommit_memory=2
2-在/etc/security/limits.conf 中加入限制参数
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
3-创建一个包括所有segment机器名的hosts文件:
seg_hosts与包括master与segment的机器名的hosts文件放在/home/gpadmin/下面。
2.2Master主机上的安装配置
2.2.1安装
1-到greenplum网站下载安装文件,根据服务器与操作系统的类弄选相应的安装包
下载网址:http://gpn.greenplum.com/download.php(注:要求注册后方可下载)。
2-解压安装包:
Unzip greenplum-db-3[1].2.0.2-RHEL4-x86_64生成greenplum-db-3.2.0.2-RHEL4-x86_64.bin文件
3-运行安转包:
/bin/bash greenplum-db-3.2.0.2-RHEL4-x86_64.bin
安装过程需要做license确认
安装目录确认,默认是: /home/gpadmin/greenplum-db-3.2.0.2
安装完成
2.2.2配置
1-创建greenplum用户:
# useradd gpadmin
# passwd gpadmin
# New password: <gpadmin_password>
# Retype new password: <gpadmin_password>
2-创建greenplum组(可选):
# groupadd gpadmin
# usermod -g gpadmin gp_user1
# usermod -g gpadmin gp_user2
3-创建greenplum_db像征目录:
ln -s /home/gpadmin/greenplum-db-3.2.0.0 /home/gpadmin/greenplum-db
4-改变greenplum安转目录的owner
# chown -R gpadmin /home/gpadmin/greenplum-db
# chgrp -R gpadmin /home/gpadmin/greenplum-db
5-配置环境变量:
将 /home/gpadmin/greenplum-db/greenplum_path.sh中的内容加到/etc/profile里,
同是追加到greenplum用户gpadmin的.bash_profile里.
5-创建master主机上的数据存放目录:
mkdir /home/gpadmin/gpdb_p1
chown gpadmin /home/gpadmin/gpdb_p1
chgrp gpadmin /home/gpadmin/gpdb_p1
2.3在segment上安装配置greenplum数据库
2.3.1安装
1-改变root用户下的SSH keys
# gpssh-exkeys -f /home/gpadmin/hosts(注:会要求输入每个segment的root用户的密码)
2-创建segment主机上的gpadmin用户:
创建用户:# gpssh -f /home/gpadmin/seg_hosts
‘/usr/sbin/useradd gpadmin -d /home/gpadmin -s /bin/bash’
密码修改:# gpssh -f /home/gpadmin/seg_hosts
‘echo "gpadmin_password" | passwd gpadmin –stdin’
3-效验segment下用户被创建:
# gpssh -f seg_hosts ls -l /home
4-改变gpadmin用户下的ssh keys
$ su – gpadmin
$ gpssh-exkeys -f /home/gpadmin/keyhosts(注:会要求输入gpadmin用户的密码)
1-在root用户下创建安转包:
# gtar -cvf /home/gpadmin/gp.tar /home/gpadmin/greenplum-db-3.2.0.0
2-从master主机上复制安装包到segment主机
# gpscp -f /home/gpadmin/hosts /home/gpadmin/gp.tar =: /home/gpadmin
3-session同步: # gpssh -f /home/gpadmin/hosts
4-在segment主机上解压安装文件
=> gtar –directory /home/gpadmin -xvf /home/gpadmin/gp.tar
5-确认文件被正确安装:
=> ls /home/gpadmin/greenplum-db-3.2.0.0
6-创建greenplum_db像征目录:
=> ln -s /home/gpadmin/greenplum-db-3.2.0.0 /home/gpadmin/greenplum-db
7-改变segment主机上安转目录的owner
=> chown -R gpadmin /home/gpadmin/greenplum-db
=> chgrp -R gpadmin /home/gpadmin/greenplum-db
8-删除segment上的压缩安装包
=> rm /home/gpadmin/gp.tar
2.3.2配置
1:创建数据目录:
=> mkdir /home/gpadmin/data(主segment数据目录)
=> mkdir /home/gpadmin/data/gpdb_p0(第0个segment数据目录)
=> mkdir /home/gpadmin/data/gpdb_p1
=> mkdir /home/gpadmin/data/gpdb_p2
=> mkdir /home/gpadmin/data/gpdb_p3
=> mkdir /home/gpadmin/mdata(镜像segment数据目录)
=> mkdir /home/gpadmin/mdata/gpdb_p0
=> mkdir /home/gpadmin/mdata/gpdb_p1
=> mkdir /home/gpadmin/mdata/gpdb_p2
=> mkdir /home/gpadmin/mdata/gpdb_p3
2:改变目录owner:
=> chown -R gpadmin /home/gpadmin/data
=> chgrp -R gpadmin /home/gpadmin/data
=> chown -R gpadmin /home/gpadmin/mdata
=> chgrp -R gpadmin /home/gpadmin/mdata
4:退出gpssh
=> exit
5:同步时钟:
$ gpssh -f seg_hosts -v date
$ gpssh -f seg_hosts -v ntpd
2.4系统性能效验
1-运行gpcheckos 来检查刚配的segment机器的操作系统情况
gpcheckos -f /home/gpadmin/seg_hosts
2-运行gpcheckos -h test177.sqa 来检查master机器。
3-计算数据仓库存贮容量,磁盘做RAID10的情况:(U:user data)
计算方法:(raw_capacity * .09) / 2 = formatted_disk_space
如果做segment镜像的话,存贮容量: (2 * U) + U/3 = formatted_disk_space
如果不做segment镜像的话,容量为: U + U/3 = formatted_disk_space
4-硬件性能效验:
gpcheckperf -f /home/gpadmin/hosts -d /home/gpadmin/data1 -d /home/gpadmin/data2 -v
5-网络性能效验:
gpchecknet -f /home/gpadmin/hosts -d /home/gpadmin/data1
gpchecknet -f /home/gpadmin/hosts -r n -d /home/gpadmin/data1(测试最大,最小以及平均值等)
2.5初始化系统
1-复制一个配置文件模板
$ cp $GPHOME/docs/cli_help/gp_init_config_example
/home/gpadmin/gp_init_config
2-修改配置参数
注意下面的参数
ARRAY_NAME="Greenplum"
MACHINE_LIST_FILE=/home/gpadmin/seg_hosts
SEG_PREFIX=gp
PORT_BASE=50000
declare -a DATA_DIRECTORY=
(home/gpadmin/data1/gpdb_p1 /home/gpadmin/data1/gpdb_p2
/home/gpadmin/data2/gpdb_p3 /home/gpadmin/data2/gpdb_p4)
MASTER_HOSTNAME=test177.sqa
MASTER_DIRECTORY=/home/gpadmin/gpdb_p1
MASTER_PORT=5432
3-运行配置文件初始化greenplum数据库
1:$ gpinitsystem -c /home/gpadmin/gp_init_config
gpinitsystem -c /home/gpadmin/gp_init_config
如果有备份master服务器则
$ gpinitsystem -c /home/gpadmin/gp_init_config -s standby_master_hostname
4-将MASTER_DATA_DIRECTORY加入环境中
修改gpadmin用户的.bash_profile以及/etc/profile,加入
MASTER_DATA_DIRECTORY=/gpdata/gp-1
export MASTER_DATA_DIRECTORY