/
ActiveMQ のインストール

ActiveMQ のインストール

はじめに

このページでは ActiveMQ のインストール手順について説明します。

インストール対象の Alfresco Content Services でサポートされているバージョンのものを選択してください。

本手順に記載のバージョンは、サポート対象バージョンにあわせて適宜読み替えてください。

1.JAVA_HOME 環境変数の設定

JAVA_HOME を設定していない場合は、次のコマンドを実行して JAVA_HOME の環境変数を設定します。

実行コマンド
# echo "JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")" | tee -a /etc/profile \
&& source /etc/profile

2.実行用ユーザの作成

次のコマンドで activemq の実行用ユーザを作成します。

実行コマンド
# useradd activemq

3.ActiveMQ のインストール


ActiveMQ のログとデータディレクトリを作成します

実行コマンド
# mkdir -p /var/log/activemq \
&& mkdir -p /var/lib/activemq

ActiveMQ の TAR ファイルをダウンロードします。

実行コマンド
# curl -LkvOf http://archive.apache.org/dist/activemq/5.16.2/apache-activemq-5.16.2-bin.tar.gz

破損がないか確認します。(ハッシュ値は ダウンロードページ に記載されています)

実行コマンド
# sha512sum apache-activemq-5.16.2-bin.tar.gz
実行結果
27bb26786640f74dcf404db884bedffc0af4bfb2a0248c398044ac9a13e19ff097c590b79eb1404e0b04d17a8f85a8f7de87186a96744e19162d70b3c7a9bdde  apache-activemq-5.16.2-bin.tar.gz

TAR ファイルを展開します

実行コマンド
# tar zxvf apache-activemq-5.16.2-bin.tar.gz -C /opt/

シンボリックリンクを作成します

実行コマンド
# ln -s /opt/apache-activemq-5.16.2 /opt/activemq

ログ出力先を変更します

実行コマンド
# 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

ログ及びデータ格納先を変更します

実行コマンド
# 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 ファイルの設定を追記します

実行コマンド
# 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" ←変更 (必要に応じてコメント解除)

所有者を実行ユーザに変更します

実行コマンド
# chown -R activemq:activemq /opt/activemq/ /var/log/activemq/ /var/lib/activemq/

サービスファイルを作成します

実行コマンド
# 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 を起動します

実行コマンド
# systemctl daemon-reload \
&& systemctl start activemq

ActiveMQ の自動起動を設定します

実行コマンド
# systemctl enable activemq

Related content

ActiveMQ のインストール (Ubuntu)
ActiveMQ のインストール (Ubuntu)
More like this
Alfresco Content Services Installation Guide
Alfresco Content Services Installation Guide
More like this
OpenJDK のインストール(Ubuntu)
OpenJDK のインストール(Ubuntu)
More like this
Alfresco Enterprise Viewer 3.2のインストール
Alfresco Enterprise Viewer 3.2のインストール
More like this
アクティブセッション情報の確認方法(Alfresco 5.2)
アクティブセッション情報の確認方法(Alfresco 5.2)
More like this
サービス設定
サービス設定
More like this

リックソフト株式会社 は、日本でトップレベルのAtlassian Platinum Solution Partnerです。
大規模ユーザーへの対応実績が認められたEnterpriseの認定をうけ、高度なトレーニング要件をクリアし、小規模から大規模のお客様まで対応可能な実績を示したパートナー企業です。


Copyright © Ricksoft Co., Ltd. プライバシーポリシー お問い合わせ