下载
auto_hotdbinstall_HotDB2.5.*.tar.gz的HotDB Server安装包,如auto_hotdbinstall_HotDB2.5.3_v1.0_20191231.tar.gz。
环境检查:所有服务器执行
-关闭selinux、firewalld等安全服务
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服务拥有较快的速度:推荐如下配置
{
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 localip myflag=" l o c a l i p m y f l a g = " localip hostname"
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
}
sed -i ‘s/[[1]](https://www.modb.pro/db/81337#fn1) # [[:space:]] UseDNS yes. /UseDNSno/g’ /etc/ssh/sshd_config
sed -i’s/[[2]](https://www.modb.pro/db/81337#fn2) # [[:space:]] GSSAPIAuthentication yes/GSSAPIAuthenticationno/g’ /etc/ssh/sshd_config
sed -i’s/[[3]](https://www.modb.pro/db/81337#fn3) #*[[:space:]] PermitRootLogin. /PermitRootLogin yes/g’/etc/ssh/sshd_config
service sshd restart
关闭所有设定的时间同步服务
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环境变量
echo $JAVA_HOME
grep -Hi java ~/.bash_profile ~/.bashrc /etc/bashrc /etc/profile.d/* /etc/profile
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上执行
部署命令
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
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
安装失败如何清理?成功请忽略
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*
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞0
添加新评论0 条评论