Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ahkhystrix opened this issue Jan 13, 2020 · 1 comment
Open

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

ahkhystrix opened this issue Jan 13, 2020 · 1 comment

Comments

@ahkhystrix
Copy link

ahkhystrix commented Jan 13, 2020

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?

@minzak
Copy link

minzak commented Jan 16, 2020

I think need rewrite code - for make folder from code, not manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants