环境列表
操作系统:centos 7 64位
Hawq版本:git clonehttps://git-wip-us.apache.org/repos/asf/incubator-hawq.git
虚拟机主机列表
主机名 |
Ip |
hawq1 |
192.168.204.201 |
hawq2 |
192.168.204.202 |
hawq3 |
192.168.204.203 |
参考资料:https://cwiki.apache.org/confluence/display/HAWQ/Build+and+Install
一hawq编译安装(root用户操作hawq1, 192.168.204.201)
1操作系统环境准备
安装centos7,设置主机名,关闭防火墙,关闭selinux
chkconfig iptables off
chkconfig ip6tables off
systemctl stop firewalld.service
sestatus //查询
vi /etc/selinux/config //关闭selinux
2软件环境准备
curl -L"https://bintray.com/wangzw/rpm/rpm" -o/etc/yum.repos.d/bintray-wangzw-rpm.repo
yum install -y epel-release
yum makecache
yum install -y man passwd sudo tar whichgit mlocate links make bzip2 net-tools \
autoconf automake libtool m4 gcc gcc-c++ gdb bison flex cmake gperfmaven indent \
libuuid-devel krb5-devel libgsasl-devel expat-devel libxml2-devel \
perl-ExtUtils-Embed pam-devel python-devel libcurl-devel snappy-devel \
thrift-devel libyaml-devel libevent-devel bzip2-devel openssl-devel \
openldap-devel protobuf-devel readline-devel net-snmp-devel apr-devel \
libesmtp-devel xerces-c-devel python-pip json-c-devel libhdfs3-devel \
apache-ivy java-1.7.0-openjdk-devel \
openssh-clients openssh-server
yum install -y postgresql-devel
pip --retries=50 --timeout=300 installpg8000 simplejson unittest2 pycrypto pygresql pyyaml lockfile paramiko psi
pip --retries=50 --timeout=300 installhttp://darcs.idyll.org/~t/projects/figleaf-0.6.1.tar.gz
pip --retries=50 --timeout=300 installhttp://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download
yum erase -y postgresql postgresql-libspostgresql-devel
碰到问题:
Transaction check error:
file /usr/lib/systemd/system/blk-availability.service from install ofdevice-mapper-7:1.02.107-5.el7.x86_64 conflicts with file from packagelvm2-7:2.02.105-14.el7.x86_64
file /usr/sbin/blkdeactivate from install ofdevice-mapper-7:1.02.107-5.el7.x86_64 conflicts with file from packagelvm2-7:2.02.105-14.el7.x86_64
file /usr/share/man/man8/blkdeactivate.8.gz from install ofdevice-mapper-7:1.02.107-5.el7.x86_64 conflicts with file from packagelvm2-7:2.02.105-14.el7.x86_64
rpm -qa | grep lvm2
yum erase lvm2-2.02.105-14.el7.x86_64
3下载incubator-hawq
git clonehttps://git-wip-us.apache.org/repos/asf/incubator-hawq.git
4安装libyarn
cd depends/libyarn/
mkdir build
cd build
../bootstrap --prefix=/usr/local/
make
sudo make install
把结果*.so文件复制至/usr/lib或者如下操作
ln -s /usr/local/libyarn.so /usr/lib
ln -s /usr/local/libyarn.so.1 /usr/lib
ln -s /usr/local/libyarn.so.0.1.10 /usr/lib
ldconfig
5配置及编译hawq(注意保持网络通畅)
./configure --prefix=/hawq
make
make install
二虚拟机制作
第一部分操作完成后,保存虚拟机hawq1,然后copy成2份,然后分别打开虚拟机根据虚拟机主机列表更改主机名,IP等操作,然后互ping IP,确认虚机机之间网络通畅。
三hadoop 2.X系统安装配置(可以利用gpssh设置互信等),然后启动运行,
hadoop 2.X系统安装配置参考:http://blog.csdn.net/sunziyue/article/details/50735192
之后再配置好hawq软件中相关配置文件(hawq用户操作)。
四初始化hawq实例(hawq用户操作)
source /install/dir/greenplum_path.sh
hawq init cluster
hawq stop/restart/start cluster