Skip to content

Do I need create the folder "/vol1" on volume manual or not? #25

@ahkhystrix

Description

@ahkhystrix

Hello!

I have a swarm/gluster cluster (three nodes):

  • Ubuntu 18.04
  • Docker version 19.03.5, build 633a0ea838
  • glusterfs 3.13.2

I've made and started a volume:
gluster volume create gfs replica 3 swarm0:/gluster/brick swarm1:/gluster/brick swarm2:/gluster/brick force

gluster volume info

Volume Name: gfs
Type: Replicate
Volume ID: a4460b88-2b08-4ea3-b0c5-183deb87949f
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Bricks:
Brick1: swarm0:/gluster/brick
Brick2: swarm1:/gluster/brick
Brick3: swarm2:/gluster/brick
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off

I've mounted the volume on all nodes:

sudo umount /mnt
sudo echo 'localhost:/gfs /mnt glusterfs defaults,_netdev,backupvolfile-server=localhost 0 0' >> /etc/fstab
sudo mount.glusterfs localhost:/gfs /mnt
sudo chown -R root:docker /mnt

I've installed and enabled plugin on all nodes:

docker plugin install --alias glusterfs trajano/glusterfs-volume-plugin --grant-all-permissions --disable
docker plugin set glusterfs SERVERS=swarm0,swarm1,swarm2
docker plugin enable glusterfs

I've tryied to deploy a service:

---
version: "3.4"

services:
  foo:
    image: alpine
    command: ping localhost
    networks:
      - net
    volumes:
      - vol1:/tmp

networks:
  net:
    driver: overlay

volumes:
  vol1:
    driver: glusterfs
    name: "gfs/vol1"

docker stack deploy -c gfs-test.yml gfs-test

I've became a errors:

7eifltph80eo09u69uv06d0lg \_ gfs-test_foo.1 alpine:latest@sha256:2171658620155679240babee0a7714f6509fae66898db422ad803b951257db78 swarm2 Shutdown Rejected 8 minutes ago "VolumeDriver.Mount: error mounting gfs/vol1: exit status 1"

The docker volume exists:

docker volume inspect gfs/vol1
[
    {
        "CreatedAt": "0001-01-01T00:00:00Z",
        "Driver": "glusterfs:latest",
        "Labels": {
            "com.docker.stack.namespace": "gfs-test"
        },
        "Mountpoint": "",
        "Name": "gfs/vol1",
        "Options": {},
        "Scope": "global",
        "Status": {
            "args": [
                "-s",
                "swarm0",
                "-s",
                "swarm1",
                "-s",
                "swarm2",
                "--volfile-id=gfs",
                "--subdir-mount=/vol1"
            ],
            "mounted": false
        }
    }
]

If i create a folder "vol1" on one of the nodes in volume folder so it works fine:

docker stack deploy -c gfs-test.yml gfs-test
Creating network gfs-test_net
Creating service gfs-test_foo

7b3cm1fnuy3x8xudcl87mr788 gfs-test_foo.1 alpine:latest@sha256:2171658620155679240babee0a7714f6509fae66898db422ad803b951257db78 swarm1 Running Running about a minute ago

docker service inspect gfs-test_foo

...
                    "Mounts": [
                        {
                            "Type": "volume",
                            "Source": "gfs/vol1",
                            "Target": "/tmp",
                            "VolumeOptions": {
                                "Labels": {
                                    "com.docker.stack.namespace": "gfs-test"
                                },
                                "DriverConfig": {
                                    "Name": "glusterfs"
                                }
                            }
                        }
                    ],
...

Do I need create a folder in a volume's folder before or I have a problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions