activemq icon indicating copy to clipboard operation
activemq copied to clipboard

Container doesn't start when binding volume conf

Open phauer opened this issue 9 years ago • 7 comments

Hi, when I run

mkdir -p ~/activemq/conf
docker run --name='activemq' -it --rm \
    -e 'ACTIVEMQ_MIN_MEMORY=512' \
    -e 'ACTIVEMQ_MAX_MEMORY=2048'\
        -p 8161:8161 \
    -p 61616:61616 \
    -p 61613:61613 \
    -v ~/activemq/conf:/opt/activemq/conf \
    webcenter/activemq:latest

I get the following error:

Traceback (most recent call last):
  File "/app/init.py", line 378, in <module>
    setting_all()
  File "/app/init.py", line 256, in setting_all
    do_init_activemq()
  File "/app/init.py", line 245, in do_init_activemq
    replace_all(ACTIVEMQ_CONF + "/log4j.properties", "\$\{activemq\.base\}\/data\/", "/var/log/activemq/")
  File "/app/init.py", line 28, in replace_all
    f = open(file,'r')
IOError: [Errno 2] No such file or directory: '/opt/activemq/conf.tmp/log4j.properties'

Without the volume binding to conf, everything works fine. But I need to change the activemq.xml. I hope you can help me.

Kind Regards Philipp

phauer avatar Feb 04 '16 10:02 phauer

Hello,

Can you check you have file called log4j.properties on your machine in "~/activemq/conf" ?

If you should just change the activemq.xml, so use "-v ~/activemq/conf/activemq.xml:/opt/activemq/conf/activemq.xml"

disaster37 avatar Feb 04 '16 16:02 disaster37

Hi, thanks for your answer. Using "-v ~/activemq/conf/activemq.xml:/opt/activemq/conf/activemq.xml" produces the same error.

When I place a log4j.properties in ~/activemq/conf I get the following output in an endless loop:

2016-02-05 07:21:39,438 INFO spawned: 'activemq' with pid 1379
2016-02-05 07:21:40,464 INFO success: activemq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-02-05 07:21:42,722 INFO exited: activemq (exit status 1; not expected)
2016-02-05 07:21:43,724 INFO spawned: 'activemq' with pid 1464
2016-02-05 07:21:44,749 INFO success: activemq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-02-05 07:21:47,019 INFO exited: activemq (exit status 1; not expected)
2016-02-05 07:21:48,021 INFO spawned: 'activemq' with pid 1549
2016-02-05 07:21:49,047 INFO success: activemq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-02-05 07:21:51,302 INFO exited: activemq (exit status 1; not expected)

Regards Philipp

phauer avatar Feb 05 '16 07:02 phauer

Ok, I will investigate this evening (after my work day).

Hum, have you also try with full path : "-v /home/YOUR_USER/activemq/conf/activemq.xml:/opt/activemq/conf/activemq.xml"

disaster37 avatar Feb 05 '16 07:02 disaster37

Have you solve this ?

disaster37 avatar Mar 11 '16 11:03 disaster37

Unfortunately not, I now run activemq directly on my machine without docker.

phauer avatar Mar 12 '16 18:03 phauer

When I mount /opt/activemq/conf even with full path, I am getting the same error: exited: activemq (exit status 1; not expected)

If I use /var/log/activemq, no problem

pmihalcin avatar Mar 23 '16 15:03 pmihalcin

Hello @phauer

It seems that you need to download an activemq distribution and copy its conf directory content under your mounted folder (~/activemq/conf) before running the docker container.

I tried this way and it worked. I think the documentation about configuration folder mounting must be improved.

sedran avatar Jul 20 '17 15:07 sedran