coreos / torus

Torus Distributed Storage
https://coreos.com/blog/torus-distributed-storage-by-coreos.html
Apache License 2.0
1.78k stars 172 forks source link

Running Torus in Docker #440

Closed vmatekole closed 7 years ago

vmatekole commented 7 years ago

Cloud config:

[Unit]
        After=docker.service
        Description=Torus
        Documentation=https://github.com/vmatekole/torus/blob/master/Documentation
        Requires=etcd2
        [Service]
        EnvironmentFile=/etc/environment
        ExecStartPre=-/usr/bin/docker kill torus
        ExecStartPre=-/usr/bin/docker rm -v torus
        ExecStartPre=-/usr/bin/docker pull quay.io/vmatekole/torus:v0.1.2
        ExecStart=/usr/bin/docker run \
                    --net=host \
                    -v /var/torus/global/:/data \
                    -e STORAGE_SIZE=20GiB \
                    -e LISTEN_HTTP_PORT=4321 \
                    -e PEER_ADDRESS=http://127.0.0.1:40000 \
                    -e ETCD_HOST=X.X.X.X \
                    -p 40000:40000 \
                    -p 4321:4321 \
                    --name torus \
                    quay.io/vmatekole/torus:v0.1.2
        ExecStop=/usr/bin/docker stop torus

Docker socket is SSL protected as well as ETCD

Get this error when running list-peers :

docker exec -it torus  /go/bin/torusctl list-peers
2017/01/02 21:35:50 grpc: Conn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 127.0.0.1:2379: getsockopt: connection refused"; Reconnecting to "127.0.0.1:2379"
2017/01/02 21:35:52 grpc: Conn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 127.0.0.1:2379: getsockopt: connection refused"; Reconnecting to "127.0.0.1:2379"
2017/01/02 21:35:55 grpc: Conn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 127.0.0.1:2379: getsockopt: connection refused"; Reconnecting to "127.0.0.1:2379"
vmatekole commented 7 years ago

Discovered I have to provide client IP address of etcd node, which is public.

docker exec -it torus /go/bin/torusctl --debug list-peers -C X.X.X.X:2379

Now it hangs....

vmatekole commented 7 years ago

Closing issue as no response