Cenos7安装mqtt服务器apache-artemis shell 脚本安装

#!/bin/bash
#Cenos7安装mqtt服务器apache-artemis
wget https://mirrors.tuna.tsinghua.edu.cn/apache/activemq/activemq-artemis/2.22.0/apache-artemis-2.22.0-bin.tar.gz --no-check-certificate
tar -zxvf apache-artemis-2.22.0-bin.tar.gz
mv apache-artemis-2.22.0/ /opt/
# java 需要升级到高版本
java -version
wget https://repo.huaweicloud.com/java/jdk/13+33/jdk-13_linux-x64_bin.tar.gz
mkdir /usr/local/java/
tar -zxvf jdk-13_linux-x64_bin.tar.gz -C /usr/local/java/
#vi /etc/profile
#export JAVA_HOME=/usr/local/java/jdk-13
#export JRE_HOME=${JAVA_HOME}/jre
#export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
#export PATH=${JAVA_HOME}/bin:$PATH
#cat >> /etc/profile11111<< EOF
##java
#export JAVA_HOME=/usr/local/java/jdk-13
#export JRE_HOME=${JAVA_HOME}/jre
#export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
#export PATH=${JAVA_HOME}/bin:$PATH
#EOF
echo "#java -version">> /etc/profile
echo "JAVA_HOME=/usr/local/java/jdk-13">> /etc/profile
echo 'JRE_HOME=${JAVA_HOME}/jre'>> /etc/profile
echo 'CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib'>> /etc/profile
echo 'PATH=${JAVA_HOME}/bin:$PATH'>> /etc/profile
source /etc/profile
java -version

cd /opt/apache-artemis-2.22.0/bin/
./artemis create --user admin --password admin --role admins --allow-anonymous true /opt/artemis
cd /opt/artemis/etc/
#vi bootstrap.xml
# localhost 替换为0.0.0.0
#vi jolokia-access.xml
# localhost 替换为0.0.0.0
#关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
"/opt/artemis/bin/artemis-service" start


猜你喜欢

转载自blog.csdn.net/lizhihua0625/article/details/124748300