1、服务器要求
2、软件要求
下载
auto_hotdbinstall_HotDB2.5.*.tar.gz的HotDB Server安装包,如auto_hotdbinstall_HotDB2.5.3_v1.0_20191231.tar.gz。
部署步骤
本章命令,复制每个框的命令到shell执行即可
- 环境检查:所有服务器执行
-关闭selinux、firewalld等安全服务
#关闭selinux
setenforce 0;sed -i’s/SELINUX=enforcing/SELINUX=disabled/’ /etc/selinux/config;getenforce
#关闭防火墙
if [ -n “which systemctl2>/dev/null
” ] ;then
systemctl list-unit-files --all | egrep ‘iptables|ip6tables|firewalld’| awk ‘{print $1}’ | xargs -I{} systemctl stop {}
systemctl list-unit-files --all | egrep ‘iptables|ip6tables|firewalld’| awk ‘{print $1}’ | xargs -I{} systemctl disable {}
else
serviceiptables stop 2>/dev/null
chkconfig iptables off 2>/dev/null
serviceip6tables stop 2>/dev/null
chkconfig ip6tables off 2>/dev/null
servicefirewalld stop 2>/dev/null
chkconfig firewalld off 2>/dev/null
fi
- 检查ssh等网络环境,保证ssh服务拥有较快的速度:推荐如下配置
#配置主机名和IP的映射关系
{
owf="/etc/hosts"
localip=ip a|grep 'inet '|grep -v '127.0.0'|grep-v 'secondary'|head -1|awk '{print $2}' | cut -d'/' -f 1
#&& echo localiphostname
"
ls “{owf}" &>/dev/null&& ! grep "{myflag}” “{owf}" &>/dev/null&& mv -f "{owf}” “{owf}".bak_`date+%Y_%m_%d_%H_%M_%S` cat > "{owf}” << EOF
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
${myflag}
EOF
}
#配置sshd,禁用DNS反向解析等功能
sed -i ‘s/[1]#[[:space:]]UseDNS yes./UseDNSno/g’ /etc/ssh/sshd_config
sed -i’s/[2]#[[:space:]]GSSAPIAuthentication yes/GSSAPIAuthenticationno/g’ /etc/ssh/sshd_config
sed -i’s/[3]#*[[:space:]]PermitRootLogin./PermitRootLogin yes/g’/etc/ssh/sshd_config
service sshd restart
关闭所有设定的时间同步服务
#关闭chronyd服务和ntpd服务,因为HotDB部署时会重建时间同步服务,避免冲突
timedatectl set-ntp no 2>/dev/null
service chronyd stop 2>/dev/null &&systemctl disable chronyd 2>/dev/null
service ntpd stop 2>/dev/null注释配置的java环境变量
#以下命令有输出,请自行注释配置的java变量,因为HotDB会自行设定,避免冲突
echo $JAVA_HOME
grep -Hi java ~/.bash_profile ~/.bashrc /etc/bashrc /etc/profile.d/* /etc/profileyum预安装:所有服务器执行
#脚本会自行安装,但推荐自行预安装,保证脚本运行过程中不会因为yum不全等问题而安装失败
#安装yum,命令无输出即可
yum -y install gawk >>/dev/null
yum -y install yum-plugin-security>>/dev/null
yum -y update-minimal >>/dev/null
yum -y install initscripts >>/dev/null
yum -y install glibc.i686 >>/dev/null
yum -y install ntpdate >>/dev/null
yum -y install ntpdate initscripts grep procps coreutils xfsprogsutil-linux-ng e2fsprogs libselinux-utils chkconfig wget yum-utils gawk manlibaio perl perl-DBD-MySQL cronie xz numactl sysstat screen iotop unzip cpuspeedcpupowerutils irqbalance ethtool net-tools hdparm iproute lrzsz dos2unix glibcglibc.i686 usbutils telnet psmisc policycoreutils-python selinux-policy>>/dev/null脚本部署管理平台:于管控服务器160上执行
部署命令
#cd切换到当前auto_hotdbinstall_HotDB2.5..tar.gz包所在位置,解压并复制包于标准安装目录/usr/local/hotdb下
mkdir -p /usr/local/hotdb
tar -zxvf auto_hotdbinstall_HotDB2..tar.gz-C /usr/local/hotdb
\cp auto_hotdbinstall_HotDB2.*.tar.gz /usr/local/hotdb
#一键安装,复制下述命令执行,看到success即可,过程中有些warning可忽略
–ntpdate-server-host=192.168.0.60参数建议使用接下来即将要部署的主计算节点所在IP,我这里是192.168.0.60
sh /usr/local/hotdb/Install_Package/hotdbinstall_v*.sh
–ntpdate-server-host=192.168.0.60
–hotdb-version=2.5
–hotdb-config-port=3316
–hotdb-config-init=yes
–install-hotdb-server-management=yes
–mysql-version=5.7
–character-set-server=utf8mb4
–creat-hotdbroot-in-mysql=yes
&& echo “installed successfully”
#若想查看安装进度,打开另一个窗口,执行下面命令即可
tail -fn 1000 /usr/local/hotdb/Install_Package/hotdbinstall.log
安装成功后,启动管理平台
bash/usr/local/hotdb/hotdb-management/bin/hotdb_management restart安装失败如何清理?成功请忽略
#若安装失败,执行下述命令清空原安装后,重新执行上面的安装命令即可
service keepalived stop
bash /usr/local/hotdb/hotdb-backup/bin/hotdb_backupstop
bash /usr/local/hotdb/hotdb-management/bin/hotdb_managementstop
bash /usr/local/hotdb/hotdb-server/bin/hotdb_serverstop
service mysql stop
service ntpd stop
sleep 5s
rm -rf /usr/local/hotdb
rm -rf /data/mysql
rm -rf /etc/my.cnf
rm -rf /etc/keepalived*使用管理平台的集群部署功能部署其他所有组件
登陆HotDB管理平台
在浏览器的url输入框中填写安装管控平台的服务器IP:3324,输入默认的用户admin、密码admin,点击用户登陆,进入管理员界面进入集群部署界面
依次点击“集群管理”》》“计算节点集群”》》“集群部署”进入参数配置页面
选则“主备节点”,点击“参数配置”,进入参数配置界面,弹出环境建议提示框,关闭即可。