2021-05-12 14:32:11
Vertica 7.1安裝最佳實踐(RHEL6.4)
2020-06-16 17:35:02
一、前期準備工作
- 1.1各節點IP和主機名
- 1.2上傳指令碼並設定環境變數
- 1.3新增信任
- 1.4前期準備檢查並調整
二、Vertica安裝
三、叢集效能評估
一、前期準備工作:
1.1各節點IP和主機名
192.168.1.137 DB01 192.168.1.138 DB02 192.168.1.139 DB03 192.168.1.140 DB04
在節點1設定/etc/hosts,新增上面資訊。
1.2上傳指令碼並設定環境變數
在節點1上傳兩個安裝指令碼到/usr/local/bin
cluster_copy_all_nodes
#!/bin/bash SELF=`hostname` if [ -z "$NODE_LIST" ]; then echo echo Error: NODE_LIST environment variable must be set in .bash_profile exit 1 fi for i in $NODE_LIST; do if [ ! $i = $SELF ]; then if [ $1 = "-r" ]; then scp -oStrictHostKeyChecking=no -r $2 $i:$3 else scp -oStrictHostKeyChecking=no $1 $i:$2 fi fi done wait
cluster_run_all_nodes
#!/bin/bash if [ -z "$NODE_LIST" ]; then echo echo Error: NODE_LIST environment variable must be set in .bash_profile exit 1 fi if [[ $1 = '--background' ]]; then shift for i in $NODE_LIST; do ssh -oStrictHostKeyChecking=no -n $i "$@" & done else for i in $NODE_LIST; do ssh -oStrictHostKeyChecking=no $i "$@" done fi wait
設定節點1的環境變數
vi /root/.bash_profile
export NODE_LIST='DB01 DB02 DB03 DB04'
1.3新增信任
1
2
3
4
5
6
7
8
|
ssh - keygen - q - t rsa - N "" - f ~ / .ssh / id_rsa ssh - copy - id - i / root / .ssh / id_rsa.pub root@ 192.168 . 1.137 ssh - copy - id - i / root / .ssh / id_rsa.pub root@ 192.168 . 1.138 ssh - copy - id - i / root / .ssh / id_rsa.pub root@ 192.168 . 1.139 ssh - copy - id - i / root / .ssh / id_rsa.pub root@ 192.168 . 1.140 cluster_run_all_nodes "hostname ; date" |
1.4前期準備檢查並調整
1.4.1 同步檢查系統版本,執行級別,掛載目錄結構,網絡卡資訊
1
2
3
4
|
cluster_run_all_nodes "hostname;cat /etc/RedHat-release" cluster_run_all_nodes "hostname; /sbin/runlevel " cluster_run_all_nodes "hostname; df -h" cluster_run_all_nodes "hostname; ethtool eth0 | grep Speed" |
1.4.2 同步指令碼,校對主機名,同步/etc/hosts
1
2
3
4
5
6
|
cluster_copy_all_nodes / root / .bash_profile / root / cluster_copy_all_nodes / usr / local / bin / cluster_run_all_nodes / usr / local / bin / cluster_copy_all_nodes / usr / local / bin / cluster_copy_all_nodes / usr / local / bin / cluster_run_all_nodes "hostname; /bin/hostname -f; grep HOSTNAME /etc/sysconfig/network" cluster_copy_all_nodes / etc / hosts / etc / cluster_run_all_nodes "hostname; cat /etc/hosts" |
1.4.3 同步時間、時區、NTP服務狀態
1
2
3
4
5
6
7
|
cluster_run_all_nodes 'hostname;date' cluster_run_all_nodes "date 032411082015.00" cluster_run_all_nodes "hwclock -r" cluster_run_all_nodes "hwclock -w" cluster_run_all_nodes "hostname; echo ${TZ}; echo ${LANG}" cluster_run_all_nodes "hostname; cat /etc/sysconfig/clock" cluster_run_all_nodes "hostname; /sbin/chkconfig --list ntpd" |
1.4.4 同步Selinux設定,防火牆設定
1
2
3
4
5
6
7
|
cluster_run_all_nodes "hostname; grep 'SELINUX=' /etc/selinux/config" cluster_run_all_nodes "hostname; setenforce 0" vi / etc / selinux / config disabled cluster_copy_all_nodes / etc / selinux / config / etc / selinux / cluster_run_all_nodes "hostname; /sbin/chkconfig --list iptables" cluster_run_all_nodes "hostname; /sbin/chkconfig --level 0123456 iptables off" cluster_run_all_nodes "service iptables stop" |
1.4.5 同步CPU、記憶體設定
1
2
3
4
5
|
cluster_run_all_nodes "hostname; grep processor /proc/cpuinfo | wc -l" cluster_run_all_nodes "hostname; grep MHz /proc/cpuinfo | sort -u" cluster_run_all_nodes "hostname; grep MemTotal /proc/meminfo" cluster_run_all_nodes "hostname; /sbin/chkconfig --list cpuspeed" cluster_run_all_nodes "/sbin/chkconfig --level 0123456 cpuspeed off;/sbin/service cpuspeed stop" |
1.4.6 同步檢查rsync、python版本
1
2
|
cluster_run_all_nodes "hostname; rsync --version | grep version" cluster_run_all_nodes "hostname; /usr/bin/python -V" |
1.4.7 同步IO設定
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
- - 選擇<deadline> cluster_run_all_nodes "hostname; /sbin/modinfo cciss | grep version" cluster_run_all_nodes "hostname; cat /sys/block/sda/queue/scheduler" - - cluster_run_all_nodes "hostname; cat /sys/block/sdb/queue/scheduler" cluster_run_all_nodes "hostname; echo deadline > /sys/block/sda/queue/scheduler" - - cluster_run_all_nodes "hostname; echo deadline > /sys/block/sdb/queue/scheduler" cluster_run_all_nodes "echo 'deadline > /sys/block/sda/queue/scheduler' >> /etc/rc.d/rc.local" - - cluster_run_all_nodes "echo 'deadline > /sys/block/sdb/queue/scheduler' >> /etc/rc.d/rc.local" cluster_run_all_nodes "grep scheduler /etc/rc.d/rc.local" noop anticipatory [deadline] cfq - - 修改 / sys / kernel / mm / redhat_transparent_hugepage / enabled cluster_run_all_nodes "hostname; cat /sys/kernel/mm/redhat_transparent_hugepage/enabled" cluster_run_all_nodes "hostname; echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled" cluster_run_all_nodes "echo 'never > /sys/kernel/mm/redhat_transparent_hugepage/enabled' >> /etc/rc.d/rc.local" cluster_run_all_nodes "grep hugepage /etc/rc.d/rc.local" always [never] - - 修改 / sys / kernel / mm / redhat_transparent_hugepage / defrag cluster_run_all_nodes "hostname; cat /sys/kernel/mm/redhat_transparent_hugepage/defrag" cluster_run_all_nodes "hostname; echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag" cluster_run_all_nodes "echo 'never > /sys/kernel/mm/redhat_transparent_hugepage/defrag' >> /etc/rc.d/rc.local" cluster_run_all_nodes "grep hugepage /etc/rc.d/rc.local" always [never] - - 修改 / sys / kernel / mm / redhat_transparent_hugepage / khugepaged / defrag cluster_run_all_nodes "hostname; cat /sys/kernel/mm/redhat_transparent_hugepage/khugepaged/defrag" cluster_run_all_nodes "hostname; echo no > /sys/kernel/mm/redhat_transparent_hugepage/khugepaged/defrag" cluster_run_all_nodes "echo 'no > /sys/kernel/mm/redhat_transparent_hugepage/khugepaged/defrag' >> /etc/rc.d/rc.local" cluster_run_all_nodes "grep hugepage /etc/rc.d/rc.local" yes [no] - - 修改 / proc / sys / vm / swappiness cluster_run_all_nodes "hostname; cat /proc/sys/vm/swappiness" cluster_run_all_nodes "hostname; echo 0 > /proc/sys/vm/swappiness" cluster_run_all_nodes "echo '0 > /proc/sys/vm/swappiness' >> /etc/rc.d/rc.local" cluster_run_all_nodes "grep swappiness /etc/rc.d/rc.local" - - 修改readahead cluster_run_all_nodes "hostname; /sbin/blockdev --getra /dev/sda" cluster_run_all_nodes "hostname; /sbin/blockdev --setra 8192 /dev/sda" cluster_run_all_nodes "echo '/sbin/blockdev --setra 8192 /dev/sda' >> /etc/rc.d/rc.local" cluster_run_all_nodes "grep blockdev /etc/rc.d/rc.local" |
1.4.8 同步系統設定
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
- - 同步 / etc / security / limits.conf vi / etc / security / limits.conf * soft nofile 655360 * hard nofile 655360 dbadmin - nice 0 dbadmin soft nproc 145209 dbadmin hard nproc 145209 cluster_run_all_nodes "hostname; ulimit -n 655360" cluster_run_all_nodes "hostname; ulimit -n" cluster_copy_all_nodes / etc / security / limits.conf / etc / security / - - 同步 / etc / sysctl.conf vm.max_map_count = 9293346 vm.min_free_kbytes = 65535 fs. file - max = 13226642 net.core.rmem_default = 262144 net.core.rmem_max = 262144 net.core.wmem_default = 262144 net.core.wmem_max = 262144 cluster_copy_all_nodes / etc / sysctl.conf / etc / cluster_run_all_nodes "hostname;sysctl -p /etc/sysctl.conf" - - 同步 / etc / pam.d / su session required pam_limits.so cluster_copy_all_nodes / etc / pam.d / su / etc / pam.d / cluster_run_all_nodes "hostname; grep session /etc/pam.d/su" |
二、Vertica安裝
1
2
3
|
rpm - ivh vertica - 7.1 . 0 - 3.x86_64 .RHEL5.rpm / opt / vertica / sbin / install_vertica - s DB01,DB02,DB03,DB04 - r / usr2 / vertica - 7.1 . 0 - 3.x86_64 .RHEL5.rpm - - failure - threshold = HALT - u dbadmin - p vertica |
1
2
|
cluster_run_all_nodes "hostname;mkdir -p /data/verticadb" cluster_run_all_nodes "hostname;chown -R dbadmin:verticadba /data/verticadb" |
三、叢集效能評估
1
2
3
4
5
6
|
cluster_run_all_nodes "hostname; /opt/vertica/bin/vcpuperf" > /tmp/vcpuperf . log cluster_run_all_nodes "hostname; /opt/vertica/bin/vioperf /data" > /tmp/vioperf_data . log su - dbadmin /opt/vertica/bin/vnetperf > /tmp/vnetperf . log |
本文永久更新連結地址:http://www.linuxidc.com/Linux/2016-08/134558.htm
相關文章