vertica單節點安裝教程

卡卡西村長發表於2018-12-10

【準備】

1、CentOS 7.6的映象盤(下載地址:官網)

2、vertica-9.1.0-0.x86_64.RHEL6(下載地址:https://pan.baidu.com/s/1IjWBUTku_zMpccF2VQ9iDw 密碼:qd7p)

3、外網環境

【安裝過程】

1、安裝CentOS 7.6
minimal installation模式即可

注意!根目錄“/”掛載的檔案系統必須是ext4,不能是預設的xfs!

2、配置網路,能夠訪問外網

3、安裝依賴包
[root@localhost ~]# yum install pstack mcelog sysstat dialog ntp -y

4、關閉防火牆
[root@localhost ~]# systemctl mask firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# systemctl stop firewalld

5、設定SELINUX
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled
[root@localhost ~]# setenforce 0

6、確認Python版本,要求2.7版本以上
[root@localhost ~]# which python
/usr/bin/python
[root@localhost ~]# python --version
Python 2.7.5
[root@localhost ~]#

7、安裝rsync,要求3.0.5版本以上
[root@localhost ~]# yum install rsync -y
[root@localhost ~]# rsync --version
rsync version 3.1.2 protocol version 31

8、確認pts
[root@localhost ~]# ls /dev |grep pts
pts

9、確認磁碟分割槽
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 39G 0 part
├─centos-root 253:0 0 37G 0 lvm /
└─centos-swap 253:1 0 2G 0 lvm [SWAP]
sr0 11:0 1 1024M 0 rom

10、確認磁碟型別,"/dev/mapper/centos-root /"必須是ext4
[root@localhost ~]# cat /etc/fstab
/dev/mapper/centos-root / ext4 defaults 1 1
UUID=d91f7088-7e3d-4995-8c01-22ab932ef85a /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0

11、修改I/O scheduler
[root@localhost ~]# echo deadline > /sys/block/sda/queue/scheduler
[root@localhost ~]# echo deadline > /dev/sda2

12、安裝JDK1.8
[root@localhost ~]# yum install java-1.8.0-openjdk.x86_64 -y
[root@localhost ~]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

13、安裝依賴的一組服務
[root@localhost ~]# yum install gdb mcelog sysstat chrony ntp ntpdate -y

[root@localhost ~]# systemctl start chronyd
[root@localhost ~]# systemctl status chronyd
[root@localhost ~]# systemctl start ntpd.service
[root@localhost ~]# systemctl enable ntpd.service

14、調整引數
[root@localhost ~]# vi /etc/sysctl.conf
vm.swappiness = 1
[root@localhost ~]# echo 1 > /proc/sys/vm/swappiness

15、解壓縮vertica 9.1
[root@localhost ~]# rpm -ivh vertica-9.1.0-0.x86_64.RHEL6.rpm
[root@localhost ~]# ls /opt/vertica/

16、安裝vertica(192.168.248.128是本機IP)
[root@localhost ~]# /opt/vertica/sbin/install_vertica --host 192.168.248.128 --rpm vertica-9.1.0-0.x86_64.RHEL6.rpm --failure-threshold FAIL --point-to-point

如果提示有WARN或FATAL,按照提示解決。

例如:

HINT (S0305): https://my.vertica.com/docs/9.1.x/HTML/index.htm#cshid=S0305
TZ is unset for dbadmin. Consider updating .profile or .bashrc

解決:sh -c "echo 'export TZ=Asia/Shanghai' >> /home/dbadmin/.bash_profile"

 

如果可以正常安裝,會提示輸入一個資料庫密碼。

17、初始化資料庫
[root@localhost ~]# su - dbadmin
[dbadmin@localhost ~]$ cd /opt/vertica/bin/
[dbadmin@localhost bin]$ ./admintools
1、提示輸入License File Path時,因為用的是社群版license,不用填,直接回車,
2、Accept EULA
3、Configuration Menu
4、Create Database
5、輸入Database Name: bigdata
6、輸入密碼和確認密碼
7、選擇主機IP,因為是單節點安裝,直接選擇預設的那個IP
8、確認資料例項安裝目錄,不用改,直接用預設的,/home/dbadmin
9、會出現一個k-safe的提示,這是隻有一個節點導致的,直接忽略,繼續下一步
10、安裝成功
*** Creating database: bigdata ***
Creating database bigdata
Starting bootstrap node v_bigdata_node0001 (192.168.248.128)
Starting nodes:
v_bigdata_node0001 (192.168.248.128)
Starting Vertica on all nodes. Please wait, databases with a large catalog may take a while to initialize.
Node Status: v_bigdata_node0001: (DOWN)
Node Status: v_bigdata_node0001: (DOWN)
Node Status: v_bigdata_node0001: (DOWN)
Node Status: v_bigdata_node0001: (DOWN)
Node Status: v_bigdata_node0001: (UP)
Automatically installing extension packages
Package: place
Success: package place successfully installed
Package: ParquetExport
Success: package ParquetExport successfully installed
Package: logsearch
Success: package logsearch successfully installed
Package: flextable
Success: package flextable successfully installed
Package: MachineLearning
Success: package MachineLearning successfully installed
Package: kafka
Success: package kafka successfully installed
Package: AWS
Success: package AWS successfully installed
Package: txtindex
Success: package txtindex successfully installed
Package: voltagesecure
Success: package voltagesecure successfully installed
Package: approximate
Success: package approximate successfully installed

18、測試連線
[dbadmin@localhost bin]$ vsql -h 127.0.0.1 -d bigdata -U dbadmin
User name: dbadmin
Password: ******
Welcome to vsql, the Vertica Analytic Database interactive terminal.

Type: \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit

bigdata=>

測試成功!

 

如果要帶上密碼,可以用“-w”,如下:

vsql -h 127.0.0.1 -d bigdata -U dbadmin  -w XXXXXX

 ---------------------------------------------------------------

社群版vertica預設只允許處理1TB的原始資料(raw data)。

可以透過“select get_compliance_status();”命令來檢視當前的使用情況:

 

​當資料庫處理的原始資料過多時,可以透過刪除舊資料來釋放一些空間。刪除後,使用“select get_compliance_status();”命令檢視並不能馬上看到有變化,這時,需要使用資料庫【管理員】賬號先執行“select audit_license_size();”命令進行重新統計,然後就可以看到最新的使用情況了。

如果資料超過了license授權的1TB限制,會報錯並影響正常使用。

 

---------------------------------------

如果IP發生了改變,參照這裡:

https://www.vertica.com/docs/8.1.x/HTML/index.htm#Authoring/AdministratorsGuide/ManageNodes/ReMapIPs/ReMapIPOverview.htm

 

如果要增加的新的節點,參照這裡:

https://www.vertica.com/docs/8.1.x/HTML/index.htm#Authoring/AdministratorsGuide/ManageNodes/AddingHostsToACluster.htm

 

相關文章