/
ActiveMQ のインストール (Ubuntu)
ActiveMQ のインストール (Ubuntu)
はじめに
このページでは ActiveMQ のインストール手順について説明します。
以下は、 Ubuntu 18.04 にて実施した手順を紹介します。
1.JAVA_HOME 環境変数の設定
JAVA_HOME を設定していない場合は、次のコマンドを実行して JAVA_HOME の環境変数を設定します。
実行コマンド
$ echo "JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")" | sudo tee -a /etc/profile \ && source /etc/profile
2.実行用ユーザの作成
次のコマンドで activemq の実行用ユーザを作成します。
実行コマンド
$ sudo useradd activemq
3.ActiveMQ のインストール
ActiveMQ のログとデータディレクトリを作成します
実行コマンド
$ sudo mkdir -p /var/log/activemq \ && sudo mkdir -p /var/lib/activemq
ActiveMQ の TAR ファイルをダウンロードします。
実行コマンド
$ sudo curl -LkOf https://archive.apache.org/dist/activemq/5.15.14/apache-activemq-5.15.14-bin.tar.gz
破損がないか確認します。(ハッシュ値は ダウンロードページ に記載されています)
実行コマンド
$ sha512sum apache-activemq-5.15.14-bin.tar.gz
実行結果
5708ed926988e4796a8badaed3dafd32bcbc47890169df2712568ad706858370b20e5cd9a4e3298521692151e63a5ac6d06866b3ad188aa0e36b28e370240d5c apache-activemq-5.15.14-bin.tar.gz
TAR ファイルを展開します
実行コマンド
$ sudo tar zxvf apache-activemq-5.15.14-bin.tar.gz -C /opt/
シンボリックリンクを作成します
実行コマンド
$ sudo ln -s /opt/apache-activemq-5.15.14 /opt/activemq
ログ出力先を変更します
実行コマンド
$ sudo vi /opt/activemq/conf/log4j.properties
vi コマンド実行後に実施するVimコマンド
:%s/${activemq.data}/\/var\/log\/activemq/g
編集内容
# File appender log4j.appender.logfile=org.apache.log4j.RollingFileAppender log4j.appender.logfile.file=/var/log/activemq/activemq.log ←変更 log4j.appender.logfile.maxFileSize=1024KB log4j.appender.logfile.maxBackupIndex=5 log4j.appender.logfile.append=true log4j.appender.logfile.layout=org.apache.log4j.PatternLayout log4j.appender.logfile.layout.ConversionPattern=%d | %-5p | %m | %c | %t%n ########### # Audit log ########### log4j.additivity.org.apache.activemq.audit=false log4j.logger.org.apache.activemq.audit=INFO, audit log4j.appender.audit=org.apache.log4j.RollingFileAppender log4j.appender.audit.file=/var/log/activemq/audit.log ←変更 log4j.appender.audit.maxFileSize=1024KB log4j.appender.audit.maxBackupIndex=5 log4j.appender.audit.append=true log4j.appender.audit.layout=org.apache.log4j.PatternLayout log4j.appender.audit.layout.ConversionPattern=%-5p | %m | %t%n
ログ及びデータ格納先を変更します
実行コマンド
$ sudo vi /opt/activemq/bin/linux-x86-64/wrapper.conf
編集内容
#******************************************************************** # Wrapper Properties #******************************************************************** #wrapper.debug=TRUE set.default.ACTIVEMQ_HOME=../.. set.default.ACTIVEMQ_BASE=../.. set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf set.default.ACTIVEMQ_DATA=/var/lib/activemq ←変更 wrapper.working.dir=. (中略) #******************************************************************** # Wrapper Logging Properties #******************************************************************** # Format of output for the console. (See docs for formats) wrapper.console.format=PM # Log Level for console output. (See docs for log levels) wrapper.console.loglevel=INFO # Log file to use for wrapper output logging. wrapper.logfile=/var/log/activemq/wrapper.log ←変更 (省略)
env ファイルを編集して、実行ユーザ及び pid ファイルの設定を追記します
実行コマンド
$ sudo vi /opt/activemq/bin/env
編集内容
# Configure a user with non root privileges, if no user is specified do not change user # (the entire activemq installation should be owned by this user) ACTIVEMQ_USER="activemq" ←変更 # location of the pidfile ACTIVEMQ_PIDFILE="/opt/activemq/data/activemq.pid" ←変更
所有者を実行ユーザに変更します
実行コマンド
$ sudo chown -R activemq:activemq /opt/activemq/ /var/log/activemq/ /var/lib/activemq/
サービスファイルを作成します
実行コマンド
$ sudo vi /etc/systemd/system/activemq.service
編集内容
[Unit] Description=ActiveMQ message queue service After=network.target [Service] User=activemq Group=activemq PIDFile=/opt/activemq/data/activemq.pid ExecStart=/opt/activemq/bin/activemq start ExecStop=/opt/activemq/bin/activemq stop [Install] WantedBy=multi-user.target
ActiveMQ を起動します
実行コマンド
$ sudo systemctl daemon-reload \ && sudo systemctl start activemq
ActiveMQ の自動起動を設定します
実行コマンド
$ sudo systemctl enable activemq
, multiple selections available,
Related content
ActiveMQ のインストール
ActiveMQ のインストール
More like this
MySQL 5.7 のインストール(Linux)
MySQL 5.7 のインストール(Linux)
More like this
JMX ダンプの取得(Alfresco Content Services 5.2)
JMX ダンプの取得(Alfresco Content Services 5.2)
More like this
JMX ダンプの取得(Alfresco One 4.2)
JMX ダンプの取得(Alfresco One 4.2)
More like this
サービス設定
サービス設定
More like this
3.Configuration of Jira(add-on)
3.Configuration of Jira(add-on)
More like this
リックソフト株式会社 は、日本でトップレベルのAtlassian Platinum Solution Partnerです。
大規模ユーザーへの対応実績が認められたEnterpriseの認定をうけ、高度なトレーニング要件をクリアし、小規模から大規模のお客様まで対応可能な実績を示したパートナー企業です。
Copyright © Ricksoft Co., Ltd. プライバシーポリシー お問い合わせ