Created
March 20, 2023 16:32
-
-
Save strongant/4b44c870d28e4bf07f03b660184c67db to your computer and use it in GitHub Desktop.
一键安装apollo脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 定义安装目录 | |
APOLLO_HOME=/opt/apollo | |
# 创建安装目录 | |
sudo mkdir -p $APOLLO_HOME | |
# 下载Apollo安装包 | |
sudo wget -O apollo-adminservice-1.9.2.zip https://github.com/ctripcorp/apollo/releases/download/v1.9.2/apollo-adminservice-1.9.2-github.zip | |
sudo wget -O apollo-configservice-1.9.2.zip https://github.com/ctripcorp/apollo/releases/download/v1.9.2/apollo-configservice-1.9.2-github.zip | |
sudo wget -O apollo-portal-1.9.2.zip https://github.com/ctripcorp/apollo/releases/download/v1.9.2/apollo-portal-1.9.2-github.zip | |
# 解压缩Apollo安装包 | |
sudo unzip -q apollo-adminservice-1.9.2.zip -d $APOLLO_HOME | |
sudo unzip -q apollo-configservice-1.9.2.zip -d $APOLLO_HOME | |
sudo unzip -q apollo-portal-1.9.2.zip -d $APOLLO_HOME | |
# 创建启动脚本 | |
sudo cat << EOF > $APOLLO_HOME/admin-service/admin-start.sh | |
#!/bin/bash | |
nohup java -jar $APOLLO_HOME/apollo-adminservice-1.9.2.jar >/dev/null 2>&1 & | |
EOF | |
sudo cat << EOF > $APOLLO_HOME/config-service/config-start.sh | |
#!/bin/bash | |
nohup java -jar $APOLLO_HOME/apollo-configservice-1.9.2.jar >/dev/null 2>&1 & | |
EOF | |
sudo cat << EOF > $APOLLO_HOME/portal/portal-start.sh | |
#!/bin/bash | |
nohup java -jar $APOLLO_HOME/apollo-portal-1.9.2.jar >/dev/null 2>&1 & | |
EOF | |
# 授予启动脚本执行权限 | |
sudo chmod +x $APOLLO_HOME/admin-service/admin-start.sh | |
sudo chmod +x $APOLLO_HOME/config-service/config-start.sh | |
sudo chmod +x $APOLLO_HOME/portal/portal-start.sh | |
# 启动Apollo服务 | |
sudo nohup $APOLLO_HOME/admin-service/admin-start.sh >/dev/null 2>&1 & | |
sudo nohup $APOLLO_HOME/config-service/config-start.sh >/dev/null 2>&1 & | |
sudo nohup $APOLLO_HOME/portal/portal-start.sh >/dev/null 2>&1 & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment