Reputation: 172
I am running activeMQ in Docker and persisting data with following command . but data is not persisted in a directory completely
[root@kubernetes-4 activemq]# docker run -it --rm -v /MyPath:/data webcenter/activemq:5.14.3
2019-08-24 03:56:42,388 CRIT Supervisor running as root (no user in config file)
2019-08-24 03:56:42,388 WARN Included extra file "/etc/supervisor/conf.d/activemq.conf" during parsing
2019-08-24 03:56:42,388 WARN Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing
2019-08-24 03:56:42,400 INFO RPC interface 'supervisor' initialized
2019-08-24 03:56:42,400 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-08-24 03:56:42,400 INFO supervisord started with pid 1
2019-08-24 03:56:43,403 INFO spawned: 'cron' with pid 16
2019-08-24 03:56:43,405 INFO spawned: 'activemq' with pid 17
2019-08-24 03:56:44,969 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-24 03:56:44,969 INFO success: activemq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Data in My Path
cd /MyPath/
[root@kubernetes-4 MyPath]# ls
activemq
[root@kubernetes-4 MyPath]# cd activemq/
[root@kubernetes-4 activemq]# ls
[root@kubernetes-4 activemq]#
Data In Container
root@kubernetes-4 activemq]# docker exec -it 630a3fe743e2 bash
root@630a3fe743e2:/opt/activemq# ls
LICENSE README.txt bin conf.tmp docs lib webapps
NOTICE activemq-all-5.14.3.jar conf data examples tmp webapps-demo
root@630a3fe743e2:/opt/activemq# cd data
root@630a3fe743e2:/opt/activemq/data# ls
activemq.log
root@630a3fe743e2:/opt/activemq/data# cd ..
root@630a3fe743e2:/opt/activemq# cd /data/
root@630a3fe743e2:/data# ls
activemq
root@630a3fe743e2:/data# cd activemq/
root@630a3fe743e2:/data/activemq# ls
activemq.pid kahadb localhost
root@630a3fe743e2:/data/activemq#
Upvotes: 0
Views: 685
Reputation: 60046
Mount the exact activemq direcotry and you will see everything working fine.
docker run -dit --rm -v /MyPath:/data/activemq webcenter/activemq:5.14.3
Second thing, you are not mounting /opt/activemq/data
so will not be accessible on the host.
For logs purpose, you can mount v /var/log/activemq:/var/log/activemq
Upvotes: 4