Docker
Docker 容器無法與起搏器資源代理一起執行
我有一個配置
CentOS 7.6
了最新docker
和pacemaker
軟體包的 2 節點集群。我目前正在嘗試為幾個容器提供 HA,但是在配置
pacemaker
資源後ocf:heartbeat:docker
所有容器都無法執行。我嘗試了一個簡單的alpine
容器,除了資源代理所需的參數之外沒有任何其他參數,但它仍然無法執行。有人可以解釋這可能是什麼原因以及如何解決問題。
以下輸出是從
crm_mon
.[root@drbd-node01 ~]# crm_mon -Arf1 Stack: corosync Current DC: drbd-node01 (version 1.1.19-8.el7_6.4-c3c624ea3d) - partition with quorum Last updated: Fri Sep 13 19:50:54 2019 Last change: Thu Sep 12 17:25:22 2019 by hacluster via cibadmin on drbd-node01 2 nodes configured 4 resources configured Online: [ drbd-node01 drbd-node02 ] Full list of resources: blog-vip (ocf::heartbeat:IPaddr2): Started drbd-node01 Clone Set: blog-drbd-svcs-clone [blog-drbd-svcs] Started: [ drbd-node01 drbd-node02 ] test_docker (ocf::heartbeat:docker): FAILED drbd-node01 (Monitoring) Node Attributes: * Node drbd-node01: * Node drbd-node02: Migration Summary: * Node drbd-node01: test_docker: migration-threshold=1000000 fail-count=78996 last-failure='Fri Sep 13 19:50:54 2019' * Node drbd-node02: test_docker: migration-threshold=1000000 fail-count=1000000 last-failure='Thu Sep 12 17:25:53 2019' Failed Actions: * test_docker_start_0 on drbd-node01 'unknown error' (1): call=348928, status=complete, exitreason='Newly created docker container exited after start', last-rc-change='Fri Sep 13 19:50:53 2019', queued=0ms, exec=1098ms * test_docker_start_0 on drbd-node02 'unknown error' (1): call=94, status=complete, exitreason='Newly created docker container exited after start', last-rc-change='Thu Sep 12 17:25:53 2019', queued=0ms, exec=489ms
pcs resource create
在對命令進行了一些修改後,我找到了解決方案。問題是由於我為run_opts
參數提供值的方式。必須將答案封裝在其中""
才能正確執行。pcs resource create blog_db_docker ocf:heartbeat:docker image=mariadb reuse=true allow_pull=true run_opts="--volume-driver drbdmanage -v blogdb:/var/lib/mysql --expose=3306 --env MYSQL_ROOT_PASSWORD=abc123" op monitor interval=30s