一、前期准备工作
二、Vertica安装
三、集群性能评估
192.168.1.137 DB01 192.168.1.138 DB02 192.168.1.139 DB03 192.168.1.140 DB04
在节点1配置/etc/hosts,添加上面信息。
在节点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'
ssh-keygen -q -t rsa -N "" -f ~/.ssh/id_rsa ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected] ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected] ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected] ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected] cluster_run_all_nodes "hostname ; date"
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 Speed: 1000Mb/s
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"
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"
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"
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"
cluster_run_all_nodes "hostname; rsync --version | grep version" cluster_run_all_nodes "hostname; /usr/bin/python -V"
--选择<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"
--同步/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"
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
cluster_run_all_nodes "hostname;mkdir -p /data/verticadb" cluster_run_all_nodes "hostname;chown -R dbadmin:verticadba /data/verticadb"
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