logo

한국어

Download Vertica: https://my.vertica.com/download/vertica/community-edition/

HPE Application Defender가 설치되기 전에 Vertica DB가 먼저 설치 되고 DB 생성까지 완료 되어야 한다.
 

■ 구성 목표 및 환경

Vertica DB는 아래 3개의 클러스터를 구성하며 OS는 CentOS 6.9 x86_64를 사용한다.

10.10.10.41 : Vertica DB #1
10.10.10.42 : Vertica DB #2
10.10.10.43 : Vertica DB #3

 

■ Vertica DB 설치
 

1. Vertica DB #1,#2,#3에서 아래의 스크립트를 root 권한으로 실행한다.

#!/bin/bash
###########################################################
#
# Vertica Database 설치 스크립트 (root로 실행)
#
# 이 스크립트는 CentOS 6.9 x86_64에서 테스트 되었음.
#
# Vertica #2, #3은 vertica rpm이 기 설치되어 있을 경우
# rpm -e vertica 를 실행하여 rpm을 삭제한다.
#
###########################################################
UIDGID=8000

###########################################################
#
# 사용자 추가
#
###########################################################
groupdel verticadba
groupdel dbadmin
userdel -r dbadmin
groupadd -g ${UIDGID} verticadba
adduser -u ${UIDGID} -g verticadba -c "Vertica Database" -d /home/dbadmin dbadmin
echo "################################################"
echo "#"
echo "# PLEASE, ENTER NEW dbadmin PASSWORD."
echo "#"
echo "################################################"
passwd dbadmin
chown -R dbadmin:verticadba /opt

###########################################################
#
# 시스템 셋팅
#
###########################################################
echo "SELINUX=disabled" >> /etc/selinux/config
echo "" >> /etc/sysctl.conf
echo "# Vertica DB Section" >> /etc/sysctl.conf
echo "vm.swappiness = 1" >> /etc/sysctl.conf
echo "kernel.pid_max = 524288" | tee -a /etc/sysctl.conf
echo "vm.max_map_count = 252472" | tee -a /etc/sysctl.conf
echo "fs.file-max = 65536" | tee -a /etc/sysctl.conf
sysctl -p

echo "# Vertica DB Section" >> /etc/pam.d/su
echo "session         required        pam_limits.so" >> /etc/pam.d/su

echo "# Vertica DB Section" >> /etc/security/limits.conf
echo "dbadmin   -       nproc   4096" >> /etc/security/limits.conf
echo "dbadmin   -       nice    0" >> /etc/security/limits.conf
echo "dbadmin   soft    nofile  65536" >> /etc/security/limits.conf
echo "dbadmin   hard    nofile  65536" >> /etc/security/limits.conf

echo "" >> /etc/rc.d/rc.local
echo "# Vertica DB Section" >> /etc/rc.d/rc.local
echo "echo deadline > /sys/block/sda/queue/scheduler" >> /etc/rc.d/rc.local
echo "echo always > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.d/rc.local
echo "/sbin/blockdev --setra 2048 /dev/sda" >> /etc/rc.d/rc.local
echo "/sbin/blockdev --setra 2048 /dev/mapper/vg_centos6-lv_root" >> /etc/rc.d/rc.local
echo "/usr/sbin/setenforce 0" >> /etc/rc.d/rc.local
echo "if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then" >> /etc/rc.d/rc.local
echo "   echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled" >> /etc/rc.d/rc.local
echo "fi" >> /etc/rc.d/rc.local

echo "">> /home/dbadmin/.bash_profile
echo "# Vertica DB Section">> /home/dbadmin/.bash_profile
echo "PATH=/opt/vertica/bin:/opt/vertica/sbin:/opt/vconsole/bin:/opt/vconsole/sbin:\$PATH">> /home/dbadmin/.bash_profile
echo "export PATH">> /home/dbadmin/.bash_profile
echo "export TZ=\"Asia/Seoul\"">> /home/dbadmin/.bash_profile

###########################################################
#
# 패키지 설치
#
###########################################################
yum -y install dialog
yum -y install ntp
yum -y install pstack
yum -y install mcelog
yum -y install sysstat
yum -y install tzdata
chown -R dbadmin:verticadba /opt
chkconfig --level 2345 ntpd on
chkconfig --level 2345 iptables off

###########################################################
#
# 시간 동기화
#
###########################################################
rdate -s time.bora.net
hwclock --systohc

clear
echo "################################################"
echo "#"
echo "# PLEASE, REBOOT THIS SYSTEM"
echo "#"
echo "################################################"

 

2. Vertica DB #1에서 아래의 스크립트를 실행하여 Vertica RPM 패키지를 설치한다.

#!/bin/bash
###########################################################
#
# Vertica Database 설치 스크립트 (root로 실행)
#
# 이 스크립트는 CentOS 6.9 x86_64에서 테스트 되었음.
#
###########################################################

###########################################################
#
# 패키지 설치
#
###########################################################
rpm -Uvh vertica-console-9.0.1-0.x86_64.RHEL6.rpm
rpm -Uvh vertica-9.0.1-0.x86_64.RHEL6.rpm:\Program Files\totalcmd\wincmd.ini߾䓈ﶌ߾䎀ﶌ߾䎠ﶌ߾

 

3. Vertica DB #1에서 아래의 스크립트를 실행하여 ssh 키를 만들고 #2와 #3에 분배한다.

#!/bin/sh
###########################################################
#
# Vertica Database ssh key 설치 스크립트 (root로 실행)
#
# 이 스크립트는 CentOS 6.9 x86_64에서 테스트 되었음.
#
###########################################################
VERTICA2_IP=10.10.10.42
VERTICA3_IP=10.10.10.43

mkdir -p ~/.ssh

echo ssh-keygen
ssh-keygen -q -t rsa -f ~/.ssh/vid_rsa -N ''
cat ~/.ssh/vid_rsa.pub > ~/.ssh/vauthorized_keys2
cat ~/.ssh/vid_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/*

clear
echo ssh-mkdir: root@${VERTICA2_IP} password ?
ssh root@${VERTICA2_IP} "mkdir -p ~/.ssh"
echo ssh-mkdir: root@${VERTICA3_IP} password ?
ssh root@${VERTICA3_IP} "mkdir -p ~/.ssh"

clear
echo scp: root@${VERTICA2_IP} password ?
scp -r ~/.ssh/vauthorized_keys2 root@${VERTICA2_IP}:~/.ssh/.
echo scp: root@${VERTICA3_IP} password ?
scp -r ~/.ssh/vauthorized_keys2 root@${VERTICA3_IP}:~/.ssh/.

clear
echo ssh-cat: root@${VERTICA2_IP} password ?
ssh root@${VERTICA2_IP} "cat ~/.ssh/vauthorized_keys2 >> ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys"
echo ssh-cat: root@${VERTICA3_IP} password ?
ssh root@${VERTICA3_IP} "cat ~/.ssh/vauthorized_keys2 >> ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys"

clear
echo ssh-rm
ssh -i ~/.ssh/vid_rsa root@${VERTICA2_IP} "rm ~/.ssh/vauthorized_keys2"
ssh -i ~/.ssh/vid_rsa root@${VERTICA3_IP} "rm ~/.ssh/vauthorized_keys2"

rm ~/.ssh/vauthorized_keys2

clear
echo "VerticaDB Private Key file: ~/.ssh/vid_rsa"

 

4. Vertica DB #1,#2,#3을 모두 리부팅 한다.

 

5. https://10.10.10.41:5450에서 접속하여 아래와 같은 과정으로 클러스터와 DB를 생성한다.

vertica_install00.png

 

vertica_install01.png

 

vertica_install02.png

 

vertica_install03.png

 

vertica_install04.png

 

vertica_install05.png

 

vertica_install06.png

 

vertica_install07.png

 

vertica_install08.png

 

vertica_install09.png

 

vertica_install10.png

 

vertica_install11.png

 

vertica_install12.png