vertica单节点安装教程

时间:2023-02-11 23:32:55

【准备】

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 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
vsql: warning: extra command-line argument "dbadmin" ignored
vsql: Warning: The -u option is deprecated. Use -U.
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=>

测试成功!

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

社区版vertica默认只允许处理1TB的原始数据(raw data)。

可以通过“select get_compliance_status();”命令来查看当前的使用情况,例如:

vertica单节点安装教程

​当数据库处理的原始数据过多时,可以通过删除旧数据来释放一些空间。删除后,使用“select get_compliance_status();”命令查看并不能马上看到有变化,这时,需要使用数据库【管理员】账号先执行“select audit_license_size();”命令进行重新统计,然后就可以看到最新的使用情况了。

如果数据超过了license授权的1TB限制,会报错并影响正常使用。