3 node scylladb on MAC using docker

331 views
Skip to first unread message

agrawal.bitsg@gmail.com

<agrawal.bitsg@gmail.com>
unread,
Dec 14, 2016, 2:43:56 PM12/14/16
to ScyllaDB users
Hi,
I would like to run 3 node instance of scylladb on my MAC. I have an application which needs to connect to 3 instances(nodes) of scylla at 3 different IP address and on the same port 9042.

I use these commands to spawn my 3 docker instances:

# docker run --name scylla1 -d scylladb/scylla
# docker run --name scylla2 -d scylladb/scylla --seeds="$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' scylla1)"
# docker run --name scylla3 -d scylladb/scylla --seeds="$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' scylla1)"


If I expose the port 9042 using -p 9042:9042 it exposes the port on 127.0.0.1, so I cannot expose ports from other 2 scylla instances on the same port and ip. Can I have the other 2 scylla instances expose ports 9042 on 127.0.0.2 and 127.0.0.3 respectively.

Any comments on how I can go about doing this.

-Sid 

Pekka Enberg

<penberg@scylladb.com>
unread,
Dec 14, 2016, 3:02:54 PM12/14/16
to ScyllaDB users, agrawal.bitsg@gmail.com
Hello,
Is there something that prevents your application from connecting
directly to the IP addresses reported by "docker inspect"? I'm not
sure if you can configure port forwarding like that in Docker.

- Pekka

Sidhartha Agrawal

<agrawal.bitsg@gmail.com>
unread,
Dec 14, 2016, 3:34:23 PM12/14/16
to Pekka Enberg, ScyllaDB users
When I try to ping 172.17.0.2, (which is the ip I see in docker inspect) from my host, I get no response.

-Sid

Asias He

<asias@scylladb.com>
unread,
Dec 14, 2016, 8:03:16 PM12/14/16
to ScyllaDB users, Sidhartha Agrawal, Pekka Enberg
Hello Sidhartha,

Can you try this?

# sudo ifconfig lo0 alias 127.0.0.2 up
# sudo ifconfig lo0 alias 127.0.0.3 up

# docker run --name scylla1 -p 127.0.0.1:9042:9042 -d scylladb/scylla
# docker run --name scylla2 -p 127.0.0.2:9042:9042 -d scylladb/scylla --seeds="$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' scylla1)"
# docker run --name scylla3 -p 127.0.0.3:9042:9042 -d scylladb/scylla --seeds="$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' scylla1)"


--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-users+unsubscribe@googlegroups.com.
To post to this group, send email to scylladb-users@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/CAJY%3D%3DWQ7dL6D4AbaQb46ipcf7Qx%2B0SBn6vb4gkR1adew6KFg7g%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Asias

Sidhartha Agrawal

<agrawal.bitsg@gmail.com>
unread,
Dec 14, 2016, 11:50:04 PM12/14/16
to Asias He, ScyllaDB users
Yes, it works! 

Thanks :)

To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.

To post to this group, send email to scyllad...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages