Install Classic
sudo wget -c https://dlcdn.apache.org\
/activemq/5.17.1/apache-activemq-5.17.1-bin.tar.gz -P /opt/cli/
sudo tar -xvzf /opt/cli/apache-activemq-5.17.1-bin.tar.gz -C /opt/cli/
sudo rm -rf /opt/cli/apache-activemq-5.17.1-bin.tar.gz
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
vim /opt/cli/apache-activemq-5.17.1/conf/jetty.xml
#:%s/127.0.0.1/0.0.0.0/gc
sudo vim /opt/cli/apache-activemq-5.17.1/bin/env
#%s/#JAVA_HOME=""/JAVA_HOME="\/usr\/lib\/jvm\/java-11-openjdk-amd64"/gc
sudo addgroup --quiet --system activemq
sudo adduser --quiet --system --ingroup activemq --no-create-home --disabled-password activemq
sudo chown -R activemq:activemq /opt/cli/apache-activemq-5.17.1
sudo tee -a /etc/systemd/system/activemq.service >/dev/null <<'EOF'
[Unit]
Description=Apache ActiveMQ
After=network-online.target
[Service]
Type=forking
User=activemq
Group=activemq
WorkingDirectory=/opt/cli/apache-activemq-5.17.1/bin
ExecStart=/opt/cli/apache-activemq-5.17.1/bin/activemq start
ExecStop=/opt/cli/apache-activemq-5.17.1/bin/activemq stop
Restart=on-abort
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable activemq.service
sudo systemctl status activemq.service
sudo systemctl start activemq.service
|
tail -f -n 100 /opt/cli/apache-activemq-5.17.1/data/activemq.log
console : http://127.0.0.1:8161/admin/
username: admin
password: admin
|
Install Artemis
sudo wget -c https://dlcdn.apache.org/activemq\
/activemq-artemis/2.23.1/apache-artemis-2.23.1-bin.tar.gz -P /opt/cli/
sudo tar -xvzf /opt/cli/apache-artemis-2.23.1-bin.tar.gz -C /opt/cli/
sudo rm -rf /opt/cli/apache-artemis-2.23.1-bin.tar.gz
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64;\
EXPORT_OSTYPE_FIND=' export OSTYPE';\
EXPORT_OSTYPE_FILL=" export OSTYPE\n\
;;\n\
Linux*) linux=true\n\
JAVA_HOME=\"$JAVA_HOME\"";\
sudo sed -i "s|$EXPORT_OSTYPE_FIND|$EXPORT_OSTYPE_FILL|" /opt/cli/apache-artemis-2.23.1/bin/artemis
sudo addgroup --quiet --system artemis
sudo adduser --quiet --system --ingroup artemis --no-create-home --disabled-password artemis
sudo chown -R artemis:artemis /opt/cli/apache-artemis-2.23.1
sudo /opt/cli/apache-artemis-2.23.1/bin/artemis create /usr/lib/apache-artemis
:'
Creating ActiveMQ Artemis instance at: /usr/lib/apache-artemis
--user:
Please provide the default username:
admin
--password: is mandatory with this configuration:
Please provide the default password:
--allow-anonymous | --require-login:
Allow anonymous access?, valid values are Y,N,True,False
Y
Auto tuning journal ...
done! Your system can make 125 writes per millisecond, your journal-buffer-timeout will be 8000
You can now start the broker by executing:
"/usr/lib/apache-artemis/bin/artemis" run
Or you can run the broker in the background using:
"/usr/lib/apache-artemis/bin/artemis-service" start
'
sudo chown -R artemis:artemis /usr/lib/apache-artemis
sudo tee -a /etc/systemd/system/artemis.service >/dev/null <<'EOF'
[Unit]
Description=Apache Artemis
After=network-online.target
[Service]
Type=forking
User=artemis
Group=artemis
WorkingDirectory=/var/lib/apache-artemis/bin
ExecStart=/var/lib/apache-artemis/bin/artemis-service start
ExecStop=/var/lib/apache-artemis/bin/artemis-service stop
UMask=0007
RestartSec=10
Restart=on-abort
[Install]
WantedBy=multi-user.target
EOF
Knowledge
sudo ufw allow 8161/tcp
netstat -an|find "61616"
netstat -nl|grep 61616
References