ActiveMQ: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(47 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Install Artemis== | ==Classic== | ||
===Install=== | |||
---- | |||
<source lang="bash"> | |||
sudo apt -qq update;\ | |||
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64;\ | |||
bash <(curl -s 'https://cdn.chorke.org/exec/cli/bash/install/apache-activemq/5.17.1.sh.txt') | |||
</source> | |||
===Remove=== | |||
---- | |||
<source lang="bash"> | |||
sudo systemctl stop activemq.service;\ | |||
sudo systemctl disable activemq.service;\ | |||
sudo rm -rf /opt/cli/apache-activemq-5.17.1;\ | |||
sudo rm -rf /etc/systemd/system/activemq.service;\ | |||
sudo systemctl daemon-reload | |||
</source> | |||
===Hacking=== | |||
---- | |||
<source lang="bash"> | |||
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 | |||
</source> | |||
<source lang="bash"> | |||
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 | |||
</source> | |||
<source lang="bash"> | |||
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 | |||
</source> | |||
{| | |||
| | |||
<source lang="bash"> | |||
sudo systemctl daemon-reload | |||
sudo systemctl enable activemq.service | |||
sudo systemctl status activemq.service | |||
sudo systemctl start activemq.service | |||
</source> | |||
| | |||
sudo 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 | |||
|} | |||
==Artemis== | |||
===Install=== | |||
---- | |||
<source lang="bash"> | |||
sudo apt -qq update;\ | |||
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64;\ | |||
bash <(curl -s 'https://cdn.chorke.org/exec/cli/bash/install/apache-artemis/2.23.1.sh.txt') | |||
</source> | |||
===Remove=== | |||
---- | |||
<source lang="bash"> | |||
sudo systemctl stop artemis.service;\ | |||
sudo systemctl disable artemis.service;\ | |||
sudo rm -rf /etc/systemd/system/artemis.service;\ | |||
sudo rm -rf /opt/cli/apache-artemis-2.23.1;\ | |||
sudo rm -rf /var/apache-artemis;\ | |||
sudo systemctl daemon-reload | |||
</source> | |||
===Hacking=== | |||
---- | |||
<source lang="bash"> | <source lang="bash"> | ||
sudo wget -c https://dlcdn.apache.org/activemq\ | sudo wget -c https://dlcdn.apache.org/activemq\ | ||
Line 6: | Line 104: | ||
sudo rm -rf /opt/cli/apache-artemis-2.23.1-bin.tar.gz | sudo rm -rf /opt/cli/apache-artemis-2.23.1-bin.tar.gz | ||
</source> | </source> | ||
<source lang="bash"> | |||
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 | |||
</source> | |||
<source lang="bash"> | |||
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 | |||
</source> | |||
<source lang="bash"> | |||
sudo /opt/cli/apache-artemis-2.23.1/bin/artemis create /var/apache-artemis | |||
:' | |||
Creating ActiveMQ Artemis instance at: /var/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 | |||
' | |||
</source> | |||
<source lang="bash"> | |||
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|" /var/apache-artemis/bin/artemis | |||
sudo sed -i "s@http://localhost:8161@http://0.0.0.0:8161@" /var/apache-artemis/etc/bootstrap.xml | |||
sudo sed -i "s@*://localhost*@*://*@" /var/apache-artemis/etc/jolokia-access.xml | |||
sudo chown -R artemis:artemis /var/apache-artemis | |||
sudo /var/apache-artemis/bin/artemis run | |||
sudo chown -R artemis:artemis /var/apache-artemis | |||
</source> | |||
<source lang="bash"> | |||
sudo chown -R artemis:artemis /var/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/apache-artemis/bin | |||
ExecStart=/var/apache-artemis/bin/artemis-service start | |||
ExecStop=/var/apache-artemis/bin/artemis-service stop | |||
UMask=0007 | |||
RestartSec=10 | |||
Restart=on-abort | |||
[Install] | |||
WantedBy=multi-user.target | |||
EOF | |||
</source> | |||
{| | |||
| | |||
<source lang="bash"> | |||
sudo systemctl daemon-reload | |||
sudo systemctl enable artemis.service | |||
sudo systemctl status artemis.service | |||
sudo systemctl start artemis.service | |||
</source> | |||
| | |||
sudo tail -f -n 100 /var/apache-artemis/log/artemis.log | |||
'''console :''' http://127.0.0.1:8161/console/ | |||
'''username:''' admin | |||
'''password:''' admin | |||
|} | |||
==Knowledge== | |||
sudo ufw allow 8161/tcp | |||
netstat -an|find "61616" | |||
netstat -nl|grep 61616 | |||
==References== | ==References== | ||
Line 11: | Line 205: | ||
| valign="top" | | | valign="top" | | ||
* [https://medium.com/@hasnat.saeed/setup-activemq-artemis-on-ubuntu-18-04-76bb4975308b ActiveMQ » Artemis » Setup on Ubuntu 18.04] | * [https://medium.com/@hasnat.saeed/setup-activemq-artemis-on-ubuntu-18-04-76bb4975308b ActiveMQ » Artemis » Setup on Ubuntu 18.04] | ||
* [https://www.vultr.com/docs/install-apache-activemq-on-ubuntu-20-04/ ActiveMQ » Classic » Setup on Ubuntu 20.04] | |||
* [https://tecadmin.net/how-to-install-apache-activemq-on-ubuntu-22-04/ ActiveMQ » Classic » Setup on Ubuntu 22.04] | |||
* [https://activemq.apache.org/getting-started ActiveMQ » Classic » Getting Started] | |||
* [https://activemq.apache.org/components/artemis/download/ ActiveMQ » Artemis » Download] | * [https://activemq.apache.org/components/artemis/download/ ActiveMQ » Artemis » Download] | ||
* [https://activemq.apache.org/components/classic/download/ ActiveMQ » Classic » Download] | * [https://activemq.apache.org/components/classic/download/ ActiveMQ » Classic » Download] | ||
Line 18: | Line 215: | ||
| valign="top" | | | valign="top" | | ||
* [https://kb.novaordis.com/index.php/Setting_Environment_Variable_for_a_systemd_Service Setting Environment Variable SystemD Service] | |||
* [https://unix.stackexchange.com/questions/303056/ Setting Environment Variable in SystemD] | |||
* [https://activemq.apache.org/components/artemis/documentation/latest/protocols-interoperability.html ActiveMQ » Documents » Protocols] | |||
* [https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html ActiveMQ » Documents » Settings] | * [https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html ActiveMQ » Documents » Settings] | ||
* [https://activemq.apache.org/components/artemis/documentation/latest/using-server.html ActiveMQ » Documents » Server] | * [https://activemq.apache.org/components/artemis/documentation/latest/using-server.html ActiveMQ » Documents » Server] | ||
Line 29: | Line 229: | ||
|- | |- | ||
| valign="top" | | | valign="top" | | ||
* [https://superuser.com/questions/513159/ Systemd » Safe Remove Services] | |||
| valign="top" | | | valign="top" | |
Latest revision as of 10:19, 25 January 2024
Classic
Install
sudo apt -qq update;\
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64;\
bash <(curl -s 'https://cdn.chorke.org/exec/cli/bash/install/apache-activemq/5.17.1.sh.txt')
Remove
sudo systemctl stop activemq.service;\
sudo systemctl disable activemq.service;\
sudo rm -rf /opt/cli/apache-activemq-5.17.1;\
sudo rm -rf /etc/systemd/system/activemq.service;\
sudo systemctl daemon-reload
Hacking
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
|
sudo 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 |
Artemis
Install
sudo apt -qq update;\
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64;\
bash <(curl -s 'https://cdn.chorke.org/exec/cli/bash/install/apache-artemis/2.23.1.sh.txt')
Remove
sudo systemctl stop artemis.service;\
sudo systemctl disable artemis.service;\
sudo rm -rf /etc/systemd/system/artemis.service;\
sudo rm -rf /opt/cli/apache-artemis-2.23.1;\
sudo rm -rf /var/apache-artemis;\
sudo systemctl daemon-reload
Hacking
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 /var/apache-artemis
:'
Creating ActiveMQ Artemis instance at: /var/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
'
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|" /var/apache-artemis/bin/artemis
sudo sed -i "s@http://localhost:8161@http://0.0.0.0:8161@" /var/apache-artemis/etc/bootstrap.xml
sudo sed -i "s@*://localhost*@*://*@" /var/apache-artemis/etc/jolokia-access.xml
sudo chown -R artemis:artemis /var/apache-artemis
sudo /var/apache-artemis/bin/artemis run
sudo chown -R artemis:artemis /var/apache-artemis
sudo chown -R artemis:artemis /var/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/apache-artemis/bin
ExecStart=/var/apache-artemis/bin/artemis-service start
ExecStop=/var/apache-artemis/bin/artemis-service stop
UMask=0007
RestartSec=10
Restart=on-abort
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable artemis.service
sudo systemctl status artemis.service
sudo systemctl start artemis.service
|
sudo tail -f -n 100 /var/apache-artemis/log/artemis.log console : http://127.0.0.1:8161/console/ username: admin password: admin |
Knowledge
sudo ufw allow 8161/tcp netstat -an|find "61616" netstat -nl|grep 61616