我有一个 ActiveMQ Docker 映像存储在本地 Nexus 存储库中。
我正在尝试使用以下 stack.yml 将此映像中的 ActiveMQ 部署为 Portainer 实例上的服务:-
version: "3"
networks:
jon:
services:
activemq:
image: nexus:21111/activemq:latest
ports:
- "15100:61616"
volumes:
- /jon/test/activemq/data:/data/activemq
- /jon/test/activemq/conf:/opt/activemq/conf
- /jon/test/activemq/log:/var/log/activemq
networks:
- jon
environment:
ACTIVEMQ_ADMIN_LOGIN: xxxxx
ACTIVEMQ_ADMIN_PASSWORD: xxxxx
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ACTIVEMQ_CONFIG_DIR: /opt/activemq/conf
ACTIVEMQ_DATA_DIR: /data/activemq
deploy:
placement:
constraints:
- node.labels.affinity == ${NODE}
replicas: 1
restart_policy:
condition: on-failure
在部署这个 stack.yml 之前,我创建了卷部分中指定的三个主机卷。我为所有用户设置了对这些目录的完全读写权限。
当我尝试在 Portainer 中部署 yml 文件时,会检索图像并且容器以“正在运行”的状态启动。但是,当我检查日志时,我看到以下内容:-
2019-03-15 15:08:50,450 CRIT Supervisor running as root (no user in config file)
2019-03-15 15:08:50,450 WARN Included extra file "/etc/supervisor/conf.d/activemq.conf" during parsing
2019-03-15 15:08:50,450 WARN Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing
2019-03-15 15:08:50,469 INFO RPC interface 'supervisor' initialized
2019-03-15 15:08:50,469 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-03-15 15:08:50,470 INFO supervisord started with pid 1
2019-03-15 15:08:51,473 INFO spawned: 'cron' with pid 16
2019-03-15 15:08:51,477 INFO spawned: 'activemq' with pid 17
2019-03-15 15:08:52,219 INFO exited: activemq (exit status 1; not expected)
2019-03-15 15:08:53,221 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-03-15 15:08:53,222 INFO spawned: 'activemq' with pid 87
2019-03-15 15:08:53,980 INFO exited: activemq (exit status 1; not expected)
2019-03-15 15:08:55,983 INFO spawned: 'activemq' with pid 158
2019-03-15 15:08:56,721 INFO exited: activemq (exit status 1; not expected)
2019-03-15 15:08:59,726 INFO spawned: 'activemq' with pid 229
2019-03-15 15:09:00,443 INFO exited: activemq (exit status 1; not expected)
2019-03-15 15:09:01,445 INFO gave up: activemq entered FATAL state, too many start retries too quickly
相关的错误消息粘贴在下面: -
Traceback (most recent call last):
File "/app/entrypoint/Init.py", line 331, in <module>
serviceRun.setting_all()
File "/app/entrypoint/Init.py", line 256, in setting_all
self.do_init_activemq()
File "/app/entrypoint/Init.py", line 246, in do_init_activemq
self.replace_all(ACTIVEMQ_CONF + "/log4j.properties", "\$\{activemq\.base\}\/data\/", "/var/log/activemq/")
File "/app/entrypoint/Init.py", line 27, in replace_all
f = open(file,'r')
IOError: [Errno 2] No such file or directory: '/opt/activemq/conf.tmp/log4j.properties'
它提到了一个丢失的文件。事实上,当我查看绑定到的主机卷时/opt/activemq/conf.tmp
,/opt/activemq/conf
它们中根本没有任何内容,尽管一个文件 .activemq.pid
确实被写入绑定到/data/activemq
.
有没有人见过这种行为和/或可能对我可能出错的地方有任何建议?非常感谢您阅读我的问题。