简体   繁体   中英

Ceph on Docker Swarm from Compose

I want to deploy Ceph cluster on Docker Swarm.

For first I try to deploy just monitor... Yaml compose file:

version: "3.3"
services:
  Mon:
    image: ceph/daemon:tag-build-master-kraken-ubuntu-16.04
    #command: ceph mon
    environment:
      - "CEPH_DAEMON=MON"
      - "NETWORK_AUTO_DETECT=1"
#      - "MON_IP=192.168.0.20"
#      - "CEPH_PUBLIC_NETWORK=192.168.0.0/24"
    volumes:
      - type: volume
        source: etc_ceph
        target: /etc/ceph
      - type: volume
        source: var_lib_ceph
        target: /var/lib/ceph/
    network_mode: host
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.labels.DFS==true

volumes:
    etc_ceph:
    var_lib_ceph:
    dev:

But its don't working, in logs i see:

2017-10-08 20:09:07 /entrypoint.sh: ERROR- it looks like we have not been able to discover the network settings

May be exist something working sample?

It seems you need to use host network, but option network_mode: host is not supported in Swarm. Swarm flavour would be:

services:
  Mon:
    ...
    networks:
      hostnet: {}

networks:
  hostnet:
    external: true
    name: host

From: https://docs.docker.com/compose/compose-file/#host-or-none
Also, complete CephFS in Swarm example available at https://github.com/sepich/ceph-swarm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM