2018년 5월 14일 월요일

ppc64le 환경에서 ActiveMQ install 하기


한줄 요약 : 아래 google drive에 올려놓은 ppc64le용 apache-activemq-5.15.2-bin.tar.gz 파일을 적절한 위치에 풀어놓으시면 됩니다.  이건 제가 Ubuntu 16.04 ppc64le에서 build한 것입니다.

https://drive.google.com/open?id=10ZOMhhcxEMwbYT0w7aJKDi6EpVS0N9JS

이 파일은 아래와 같이 build된 것입니다.  아래 ActiveMQ homepage에 나온 instruction대로 build하시면 됩니다.

http://activemq.apache.org/version-5-getting-started.html#GettingStarted-UnixSourceInstallation

먼저 JAVA_HOME을 설정합니다.  IBM ppc64le용 Ubuntu의 경우, 아래와 같이 되어 있습니다.

u0017649@sys-93315:~$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 48 Jan  4 20:38 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-ppc64el/jre/bin/java

u0017649@sys-93315:~$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-ppc64el

그리고 이 ActiveMQ는 maven으로 build되는 SW입니다.  다음과 같이 mvn을 설치합니다.

u0017649@sys-93315:~$ sudo apt-get install maven

이제 source code를 download 받습니다.

u0017649@sys-93315:~$ git clone https://github.com/apache/activemq.git

u0017649@sys-93315:~$ cd activemq

이제 mvn으로 package build를 하시면 되는데, 첫 시도에서는 다음과 같이 error가 납니다.

u0017649@sys-93315:~/activemq$ mvn clean package -Dmaven.test.skip=true

[ERROR] Failed to execute goal on project activemq-kahadb-store: Could not resolve dependencies for project org.apache.activemq:activemq-kahadb-store:jar:5.16.0-SNAPSHOT: Could not find artifact org.apache.activemq:activemq-broker:jar:tests:5.16.0-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]

이건 그냥 activemq 최신 버전인 5.15.3의 bug이며, ppc64le 아키텍처와는 무관한 것입니다.  구글링해보시면 x86에서도 같은 error들이 많이 report된 것을 보실 수 있습니다.

http://activemq.2283324.n4.nabble.com/Building-ActiveMQ-td4728361.html

이 error는 그냥 minor version을 하나 내린 5.15.2로 해보면 금방 해결됩니다.  다음과 같이 checkout 하십시요.

u0017649@sys-93315:~/activemq$ git checkout tags/activemq-5.15.2

그리고나서 다시 mvn package 명령을 내리시면 됩니다.

u0017649@sys-93315:~/activemq$ mvn clean package -Dmaven.test.skip=true
...
[INFO] Building zip: /home/u0017649/activemq/assembly/target/apache-activemq-5.15.2-bin.zip
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ActiveMQ ........................................... SUCCESS [  1.972 s]
[INFO] ActiveMQ :: Openwire Generator ..................... SUCCESS [  5.275 s]
[INFO] ActiveMQ :: Client ................................. SUCCESS [ 16.029 s]
[INFO] ActiveMQ :: Openwire Legacy Support ................ SUCCESS [  4.506 s]
[INFO] ActiveMQ :: JAAS ................................... SUCCESS [  6.235 s]
[INFO] ActiveMQ :: Broker ................................. SUCCESS [  6.564 s]
[INFO] ActiveMQ :: KahaDB Store ........................... SUCCESS [  4.021 s]
[INFO] ActiveMQ :: STOMP Protocol ......................... SUCCESS [  1.134 s]
[INFO] ActiveMQ :: MQTT Protocol .......................... SUCCESS [  2.055 s]
[INFO] ActiveMQ :: JDBC Store ............................. SUCCESS [  1.008 s]
[INFO] ActiveMQ :: LevelDB Store .......................... SUCCESS [01:10 min]
[INFO] ActiveMQ :: Generic JMS Pool ....................... SUCCESS [  0.898 s]
[INFO] ActiveMQ :: Pool ................................... SUCCESS [  0.753 s]
[INFO] ActiveMQ :: RA ..................................... SUCCESS [  1.790 s]
[INFO] ActiveMQ :: Spring ................................. SUCCESS [ 11.830 s]
[INFO] ActiveMQ :: Console ................................ SUCCESS [  2.446 s]
[INFO] ActiveMQ :: Partition Management ................... SUCCESS [  0.889 s]
[INFO] ActiveMQ :: Runtime Configuration .................. SUCCESS [ 17.503 s]
[INFO] ActiveMQ :: Tooling ................................ SUCCESS [  0.028 s]
[INFO] ActiveMQ :: JUnit Rule ............................. SUCCESS [  0.342 s]
[INFO] ActiveMQ :: Unit Tests ............................. SUCCESS [  2.850 s]
[INFO] ActiveMQ :: HTTP Protocol Support .................. SUCCESS [  3.166 s]
[INFO] ActiveMQ :: AMQP ................................... SUCCESS [  1.300 s]
[INFO] ActiveMQ :: Camel .................................. SUCCESS [  3.726 s]
[INFO] ActiveMQ :: All JAR bundle ......................... SUCCESS [  3.952 s]
[INFO] ActiveMQ :: Log4j Appender ......................... SUCCESS [  0.270 s]
[INFO] ActiveMQ :: Apache Karaf ........................... SUCCESS [  1.795 s]
[INFO] ActiveMQ :: ConnectionFactory ...................... SUCCESS [  1.334 s]
[INFO] ActiveMQ :: RAR .................................... SUCCESS [  1.663 s]
[INFO] ActiveMQ :: Run Jar ................................ SUCCESS [  0.499 s]
[INFO] ActiveMQ :: Shiro .................................. SUCCESS [  0.785 s]
[INFO] ActiveMQ :: Memory Usage Test Plugin ............... SUCCESS [  2.519 s]
[INFO] ActiveMQ :: Performance Test Plugin ................ SUCCESS [  2.504 s]
[INFO] ActiveMQ :: StartUp/Stop Plugin .................... SUCCESS [  4.245 s]
[INFO] ActiveMQ :: Web .................................... SUCCESS [  1.134 s]
[INFO] ActiveMQ :: OSGi bundle ............................ SUCCESS [ 12.958 s]
[INFO] ActiveMQ :: Blueprint .............................. SUCCESS [  0.235 s]
[INFO] ActiveMQ :: Web Demo ............................... SUCCESS [ 14.682 s]
[INFO] ActiveMQ :: Web Console ............................ SUCCESS [  5.986 s]
[INFO] ActiveMQ :: Karaf Integration Tests ................ SUCCESS [  2.232 s]
[INFO] ActiveMQ :: Integration Test :: Spring 3.1 ......... SUCCESS [  0.097 s]
[INFO] ActiveMQ :: Assembly ............................... SUCCESS [ 17.442 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:05 min
[INFO] Finished at: 2018-05-13T22:44:49-04:00
[INFO] Final Memory: 159M/558M
[INFO] ------------------------------------------------------------------------

생성된 package file은 아래 directory에 tag.gz과 zip의 두가지 형태로 되어 있습니다.

u0017649@sys-93315:~/activemq$ ls -l assembly/target/apach*
-rw-rw-r-- 1 u0017649 u0017649 57997764 May 13 22:44 assembly/target/apache-activemq-5.15.2-bin.tar.gz
-rw-rw-r-- 1 u0017649 u0017649 65138709 May 13 22:44 assembly/target/apache-activemq-5.15.2-bin.zip

이렇게 build된 file을 아래와 같이 원하는 directory에 풀어놓고 관련 환경변수만 잡아주시면 사용하실 수 있습니다.

u0017649@sys-93315:~/activemq$ cd /usr/local

u0017649@sys-93315:/usr/local$ sudo tar -zxvf ~/activemq/assembly/target/apache-activemq-5.15.2-bin.tar.gz

u0017649@sys-93315:~$ export PATH=/usr/local/apache-activemq-5.15.2/bin:$PATH

u0017649@sys-93315:~$ export LD_LIBRARY_PATH=/usr/local/apache-activemq-5.15.2/lib:$LD_LIBRARY_PATH

u0017649@sys-93315:~$ activemq --help
INFO: Loading '/usr/local/apache-activemq-5.15.2//bin/env'
INFO: Using java '/usr/bin/java'
Java Runtime: Oracle Corporation 1.8.0_171 /usr/lib/jvm/java-8-openjdk-ppc64el/jre
  Heap sizes: current=62976k  free=62320k  max=932352k
    JVM args: -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/usr/local/apache-activemq-5.15.2//conf/login.config -Dactivemq.classpath=/usr/local/apache-activemq-5.15.2//conf:/usr/local/apache-activemq-5.15.2//../lib/: -Dactivemq.home=/usr/local/apache-activemq-5.15.2/ -Dactivemq.base=/usr/local/apache-activemq-5.15.2/ -Dactivemq.conf=/usr/local/apache-activemq-5.15.2//conf -Dactivemq.data=/usr/local/apache-activemq-5.15.2//data
Extensions classpath:
  [/usr/local/apache-activemq-5.15.2/lib,/usr/local/apache-activemq-5.15.2/lib/camel,/usr/local/apache-activemq-5.15.2/lib/optional,/usr/local/apache-activemq-5.15.2/lib/web,/usr/local/apache-activemq-5.15.2/lib/extra]
ACTIVEMQ_HOME: /usr/local/apache-activemq-5.15.2
ACTIVEMQ_BASE: /usr/local/apache-activemq-5.15.2
ACTIVEMQ_CONF: /usr/local/apache-activemq-5.15.2/conf
ACTIVEMQ_DATA: /usr/local/apache-activemq-5.15.2/data
Usage: Main [--extdir <dir>] [task] [task-options] [task data]

Tasks:
    browse                   - Display selected messages in a specified destination.
    bstat                    - Performs a predefined query that displays useful statistics regarding the specified broker
    consumer                 - Receives messages from the broker
    create                   - Creates a runnable broker instance in the specified path.
    decrypt                  - Decrypts given text
    dstat                    - Performs a predefined query that displays useful tabular statistics regarding the specified destination type
    encrypt                  - Encrypts given text
    export                   - Exports a stopped brokers data files to an archive file
    list                     - Lists all available brokers in the specified JMX context
    producer                 - Sends messages to the broker
    purge                    - Delete selected destination's messages that matches the message selector
    query                    - Display selected broker component's attributes and statistics.
    start                    - Creates and starts a broker using a configuration file, or a broker URI.
    stop                     - Stops a running broker specified by the broker name.

Task Options (Options specific to each task):
    --extdir <dir>  - Add the jar files in the directory to the classpath.
    --version       - Display the version information.
    -h,-?,--help    - Display this help information. To display task specific help, use Main [task] -h,-?,--help

Task Data:
    - Information needed by each specific task.

JMX system property options:
    -Dactivemq.jmx.url=<jmx service uri> (default is: 'service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi')
    -Dactivemq.jmx.user=<user name>
    -Dactivemq.jmx.password=<password>

댓글 없음:

댓글 쓰기