#!/bin/bash
install_mysql_cli(){
rpm -qa|grep mariadb|xargs rpm -e --nodeps
cd /data/src
mkdir /data/app/mysql/data -p
tar -xf mysql-5.7.31-1.el7.x86_64.rpm-bundle.tar
rpm -ivh mysql-community-common-5.7.31-1.el7.x86_64.rpm mysql-community-libs-5.7.31-1.el7.x86_64.rpm mysql-community-client-5.7.31-1.el7.x86_64.rpm
}
install(){
cd /data/src
unzip nacos-server-1.4.3_2.zip -d /data/app/nacos-server-1.4.3_2
sed -i '/\$HOME\/jdk\/java/iset JAVA_HOME=\/data\/app\/jdk1.8.0_341' /data/app/nacos-server-1.4.3_2/bin/startup.sh
sed -i 's/$HOME\/jdk\/java/\/data\/app\/jdk1.8.0_341/g' /data/app/nacos-server-1.4.3_2/bin/startup.sh
sed -i -e '31 s/^/#/' -i -e '32 s/^/#/' -i -e '33 s/^/#/' /data/app/nacos-server-1.4.3_2/bin/startup.sh
sed -i 's/export MODE=\"cluster\"/export MODE=\"standalone\"/' /data/app/nacos-server-1.4.3_2/bin/startup.sh
echo "Please input mysql address:"
read mysql_addr
sed -i "s/127.0.0.1/$mysql_addr/g" /data/app/nacos-server-1.4.3_2/conf/application.properties
sed -i 's/db.password.0=root/db.password.0=zte@1234/' /data/app/nacos-server-1.4.3_2/conf/application.properties
chmod 777 /data/app/nacos-server-1.4.3_2/bin/*.sh
ln -sf /data/app/jdk1.8.0_341/bin/javac /usr/bin/javac
ln -sf /data/app/jdk1.8.0_341/bin/jar /usr/bin/jar
ln -sf /data/app/jdk1.8.0_341/bin/java //bin/java
mysql -uroot -pzte@1234 -h$mysql_addr -Dnacos < /data/app/nacos-server-1.4.3_2/conf/nacos-mysql.sql
mysql -uroot -pzte@1234 -h$mysql_addr -Dnacos < /data/app/nacos-server-1.4.3_2/conf/schema.sql
}
auto_start(){
cat>>/etc/systemd/system/nacos.service<<EOF
[Unit]
Description=nacos
After=network.target
[Service]
Type=forking
ExecStart=/data/app/nacos-server-1.4.3_2/bin/startup.sh -m standalone
ExecReload=/data/app/nacos-server-1.4.3_2/bin/shutdown.sh
ExecStop=/data/app/nacos-server-1.4.3_2/bin/shutdown.sh
PrivateTmp=true
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable nacos
systemctl start nacos
}
chk_install(){
batchNo=$(systemctl status nacos|grep Active)
if [[ $batchNo == *"active (running)"* ]];then
echo "nacos install complete."
else
echo "nacos install has problem."
fi
}
main(){
install_mysql_cli
install $1
auto_start
chk_install
}
main "$@"
没有合适的资源?快使用搜索试试~ 我知道了~
服务器部署中间件及依赖包的脚本,在centos 7.6系统可用
需积分: 0 1 下载量 172 浏览量
2023-10-11
19:40:46
上传
评论
收藏 4KB GZ 举报
温馨提示
#!/bin/bash get_char(){ SAVEDSTTY=`stty -g` stty -echo stty cbreak dd if=/dev/tty bs=1 count=1 2> /dev/null stty -raw stty echo stty $SAVEDSTTY } wt(){ SCRIPT=$(whiptail --title "CheckList" --menu \ "Choosed deploy mode" 15 60 2 \ "01-single" "Single deploy mode." \ "02-distribute" "Distribute deploy mode." 3>&1 1>&2 2>&3) exitstatus=$? if [ $exitstatus = 0 ]; then echo "Your chooses are:" $SCRIPT read -r -p "Are You Sure? [Y/n] " input case $input
资源推荐
资源详情
资源评论
收起资源包目录
00-autoinstall.tar.gz (27个子文件)
00-autoinstall
distribute
05-jdk-install.sh 610B
11-mqtt-install.sh 1KB
09-mongo-install.sh 606B
00-autoinstall.sh 2KB
03-cmake-install.sh 429B
12-nacos-install.sh 2KB
01-rpm-install.sh 249B
06-redis-install.sh 839B
08-taos-install.sh 495B
07-mysql-install.sh 2KB
04-cJson-install.sh 429B
02-openssl-install.sh 653B
10-nginx-install.sh 381B
single
05-jdk-install.sh 610B
11-mqtt-install.sh 1KB
09-mongo-install.sh 540B
00-autoinstall.sh 1KB
03-cmake-install.sh 429B
12-nacos-install.sh 2KB
01-rpm-install.sh 249B
06-redis-install.sh 761B
08-taos-install.sh 495B
07-mysql-install.sh 2KB
04-cJson-install.sh 429B
02-openssl-install.sh 653B
10-nginx-install.sh 381B
main.sh 1KB
共 27 条
- 1
资源评论
weixin_55563511
- 粉丝: 2
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功