基於【CentOS-7+ Ambari 2.7.0 + HDP 3.0】搭建HAWQ數據倉庫03 —— 安裝HAWQ3.0.0

一、 HAWQ2.3.0環境準備【全部主機節點】:

1, vim /etc/sysctl.conf,編輯如下內容:
kernel.shmmax= 1000000000
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= 0
net.ipv4.ip_forward= 0
net.ipv4.conf.default.accept_source_route= 0
net.ipv4.tcp_tw_recycle= 1
net.ipv4.tcp_max_syn_backlog= 200000
net.ipv4.conf.all.arp_filter= 1
net.ipv4.ip_local_port_range= 1281 65535
net.core.netdev_max_backlog= 200000
vm.overcommit_memory= 2
fs.nr_open= 3000000
kernel.threads-max= 798720
kernel.pid_max= 798720
#increase network
net.core.rmem_max=2097152
net.core.wmem_max=2097152
保存退出後,使用命令“sysctl -p” 使之生效:
sysctl -p

2, vim /etc/security/limits.conf 編輯如下內容:
* soft nofile 2900000
* hard nofile 2900000
* soft nproc 131072
* hard nproc 131072
重新登錄以使配置生效,或者使用命令臨時設置一下:
ulimit -n 10240

3, 添加gpadmin用戶(greeplum admin縮寫),使用/opt/gpadmin作爲主目錄
useradd --home=/opt/gpadmin/ --no-create-home --comment "HAWQ admin" gpadmin
echo gpadmin | passwd --stdin gpadmin
mkdir /opt/gpadmin
chown gpadmin:gpadmin /opt/gpadmin

2,添加gpadmin到/etc/sudoers,編輯該文件,添加如下行
gpadmin ALL=(ALL) NOPASSWD:ALL

3, 配置gpadmin用戶的ssh【免密互訪】
4, 準備軟件包依賴項:
libgsasl is needed by apache-hawq-2.3.0.0-el7.x86_64
protobuf >= 2.5.0 is needed by apache-hawq-2.3.0.0-el7.x86_64
net-snmp-libs is needed by apache-hawq-2.3.0.0-el7.x86_64
thrift >= 0.9.1 is needed by apache-hawq-2.3.0.0-el7.x86_64
boost >= 1.53.0 is needed by apache-hawq-2.3.0.0-el7.x86_64
其中gcc gcc-c++ protobuf net-snmp-libs boots可直接安裝。而安裝libgsasl需要添加一個包含libgsasl庫的源:新建/etc/yum.repos.d/fedora.repo文件,添加如下內容:
[epel-repo]
name=epel
baseurl=http://dl.fedoraproject.org/pub/epel/6/x86_64/
enabled=1
gpgcheck=0
執行安裝:
yum install gcc gcc-c++ -y
yum install protobuf -y
yum install net-snmp-libs -y
yum install boost -y
yum install libgsasl-devel -y

C)下載安裝thrift 0.9.1
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/t/thrift-0.9.1-15.el7.x86_64.rpm
rpm -ivh thrift-0.9.1-15.el7.x86_64.rpm

 

二、 下載安裝包apache-hawq-rpm-2.3.0.0-incubating.tar.gz,並解壓縮
cd Downloads
wget http://mirrors.tuna.tsinghua.edu.cn/apache/incubator/hawq/2.3.0.0-incubating/apache-hawq-rpm-2.3.0.0-incubating.tar.gz
tar -zxvf apache-hawq-rpm-2.3.0.0-incubating.tar.gz

三、 安裝服務端
1, 安裝
rpm -ivh --prefix=/opt/gpadmin apache-hawq-2.3.0.0-el7.x86_64.rpm
**移除安裝
yum remove apache-hawq -y

2 HAWQ的參數配置
配置HAWQ的集羣及其它參數
cd /usr/hawq/etc
vi hawq-site.xml
# 修改如下參數
參數名 值
hadoop.security.authentication simple
hawq_master_address_host ep-bd01
hawq_dfs_url ep-bd01:8020/hawq
hawq_rm_memory_limit_perseg 64GB
hawq_rm_yarn_address ep-bd01:8032
hawq_dfs_url ep-bd01:8020/hawq
hawq_global_rm_type yarn
hawq_rm_yarn_scheduler_address ep-bd01:8030
hawq_acl_type standalone
hawq_master_directory /opt/gpadmin/data/masterdd
hawq_segment_directory /opt/gpadmin/data/segmentdd

vi yarn-site.xml
# 修改如下參數
參數名 值
hadoop.security.authentication simple


2, 建立dfs/hawq
sudo -u hdfs hdfs dfs -mkdir /hawq
sudo -u hdfs hdfs dfs -chown gpadmin:gpadmin /hawq
3, 建立data目錄
sudo -u gpadmin mkdir -p /opt/gpadmin/data/masterdd /opt/gpadmin/data/segmentdd

4, 複製文件到其他節點
su - gpadmin
scp -r /opt/gpadmin/apache-hawq ep-bd[02-05]:/opt/gpadmin/.
或者,複製安裝包到其他節點,直接rpm安裝
5,初始化cluster【注意,這裏必須進入/opt/gpadmin/apache-hawq/bin】
su - gpadmin
cd /opt/gpadmin/apache-hawq/bin
source ../greenplum_path.sh
./hawq init cluster
# 初始化cluster失敗,調整之後,再次執行初始化之前需要
#刪除dfs目錄中內容:
sudo -u hdfs hdfs dfs -rm -r -f /hawq/*
#刪除數據目錄中內容
ssh ep-bd01 rm -rf /opt/gpadmin/data/masterdd/*
ssh ep-bd02 rm -rf /opt/gpadmin/data/masterdd/*
ssh ep-bd03 rm -rf /opt/gpadmin/data/masterdd/*
ssh ep-bd04 rm -rf /opt/gpadmin/data/masterdd/*
ssh ep-bd05 rm -rf /opt/gpadmin/data/masterdd/*

# 啓動停止重啓hawq
hawq stop/restart/start cluster

 

 


四、 結論,目前實驗結果,再CDH5.15.0 + clouderaManager上,HAWQ2.3.0安裝失敗,遇到的錯誤是:
20180810:07:37:14:228498 hawq_init:ep-bd05:gpadmin-[INFO]:-Check if hdfs path is available
20180810:07:37:15:228498 hawq_init:ep-bd05:gpadmin-[INFO]:-5 segment hosts defined
20180810:07:37:15:228498 hawq_init:ep-bd05:gpadmin-[INFO]:-Set default_hash_table_bucket_number as: 30
20180810:07:37:19:228498 hawq_init:ep-bd05:gpadmin-[INFO]:-Start to init master node: 'ep-bd05'
20180810:07:37:55:228498 hawq_init:ep-bd05:gpadmin-[INFO]:-Create filespace failed, please check your hdfs settings
20180810:07:37:55:228498 hawq_init:ep-bd05:gpadmin-[ERROR]:-Master init failed, exit
查看hawqAdminLogs/hawq_init
-bash-4.2$ tail -n50 /opt/gpadmin/hawqAdminLogs/hawq_init_20180809.log

The database cluster will be initialized with locale en_US.utf8.

fixing permissions on existing directory /opt/gpadmin/data/masterdd ... ok
creating subdirectories ... ok
selecting default max_connections ... 1280
selecting default shared_buffers/max_fsm_pages ... 125MB/200000
creating configuration files ... ok
creating template1 database in /opt/gpadmin/data/masterdd/base/1 ... 2018-08-08 23:37:20.293049 GMT,,,p228906,th43207168,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
loading file-system persistent tables for template1 ...
2018-08-08 23:37:28.839281 GMT,,,p228924,th-132474368,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
initializing pg_authid ... 2018-08-08 23:37:30.252699 GMT,,,p228929,th-2094233088,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
initializing dependencies ... 2018-08-08 23:37:31.512330 GMT,,,p228933,th-1622263296,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
creating system views ... 2018-08-08 23:37:33.061497 GMT,,,p228953,th180423168,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
loading system objects' descriptions ... 2018-08-08 23:37:34.574413 GMT,,,p228957,th-461190656,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
creating conversions ... 2018-08-08 23:37:36.217812 GMT,,,p228963,th1733323264,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
setting privileges on built-in objects ... 2018-08-08 23:37:44.302853 GMT,,,p228983,th443902464,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
creating information schema ... 2018-08-08 23:37:45.339870 GMT,,,p228987,th1975183872,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
2018-08-08 23:37:48.277031 GMT,,,p228994,th-1036756480,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
creating HAWQ schema ... 2018-08-08 23:37:49.269230 GMT,,,p228998,th1524197888,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok
vacuuming database template1 ... 2018-08-08 23:37:50.841277 GMT,,,p229002,th902355456,,,,0,,,seg-10000,,,,,"WARNING","01000","""fsync"": can not be set by the user and will be ignored.",,,,,,,,"set_config_option","guc.c",10106,
ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

/opt/gpadmin/apache-hawq/bin/postgres -D /opt/gpadmin/data/masterdd
or
/opt/gpadmin/apache-hawq/bin/pg_ctl -D /opt/gpadmin/data/masterdd -l logfile start

waiting for server to start... done
server started
ERROR: filespace "dfs_system" already exists
Create filespace failed, please check your hdfs settings
20180809:07:37:55:228498 hawq_init:ep-bd05:gpadmin-[INFO]:-Create filespace failed, please check your hdfs settings
20180809:07:37:55:228498 hawq_init:ep-bd05:gpadmin-[ERROR]:-Master init failed, exit
-bash-4.2$

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章