docker-volume-sshfs icon indicating copy to clipboard operation
docker-volume-sshfs copied to clipboard

Unable to use plugin in Swarm

Open sreejithhere opened this issue 7 years ago • 2 comments

I am trying to create the a swarm using the sshfs plugin as the volume driver. My stack has a volume defined as below

volumes:
  ssh-data:
    driver: vieux/sshfs
    driver_opts:
      sshcmd: root@server:/data
      password: root

The stack has two services defined. The first server runs a simple ssh server with username and password root:root. The second one is a simple alpine based service which has uses the defined volume.

When I deploy the stack the SSH server service starts up correctly. However the client service does not start. docker service ps command gives the following error

"starting container failed: error while mounting volume '/var/lib/docker/plugins/c26a7795b28466ea1959e0c5e0ae2535bbaa9ddc8aa1a71c3b862ed6106d341f/rootfs': VolumeDriver.Mount: sshfs command execute failed: exit status 1 (read: Connection reset by peer )"

I tried removing the volume use from the client and started the services. Both the service starts up correctly. In order to test that the SSH service is working properly I did the following

  1. Exec into the client container as bash
  2. Connect to the server service using ssh <user>@<service name>. This worked proving that the SSH connection between the services are working and therefore the issue is with the volume plugin definition

I am attaching my yml file for reference ssh.yml.txt

sreejithhere avatar Aug 10 '18 13:08 sreejithhere

Same error here. Any solutions?

Marcel-B avatar Feb 27 '19 14:02 Marcel-B

Things you should check.

the host of the container need to able to ssh to the file system host including to itself.

if your environment has only single node, make sure the ssh command actually work. Another thing worth checking is that if you can ssh using root? why you want that anyway.

Singwai avatar Apr 09 '19 04:04 Singwai