scylla-code-samples icon indicating copy to clipboard operation
scylla-code-samples copied to clipboard

How to set ScyllaDB docker as a service

Open Yang-Rongquan opened this issue 4 years ago • 2 comments

In the doc, the solution is to make the app running within the docker. https://github.com/scylladb/scylla-code-samples/tree/master/mms/go

Is there a way to run docker as a service, and I develop code and connect it in the host, not docker.

Do we have a solution for 1 instance and cluster?

Yang-Rongquan avatar Apr 28 '21 11:04 Yang-Rongquan

Sure, you can run you application out side Scylla Docker, its the most common case.

tzach avatar Apr 28 '21 14:04 tzach

@tzach let's take cluster for example.

  1. after run docker-compose up -d
  2. when run app, what is the host name ./lightest pop --host localhost -n 100 INFO[Apr 28 22:45:05.195] Establishing connection to localhost FATA[Apr 28 22:45:05.197] gocql: unable to create session: unable to discover protocol version: dial tcp 127.0.0.1:9042: connect: connection refused

In single instance scenaro, I can run this command to mapping port docker run -p 7000:7000 -p 7001:7001 -p 9042:9042 -p 9160:9160 -p 9180:9180 -p 10000:10000 --name scyllaU -d scylladb/scylla:4.1.0 Then run the app, got ./lightest pop --host localhost -n 100 INFO[Apr 28 20:41:57.904] Establishing connection to localhost INFO[Apr 28 20:41:57.981] Creating the keyspace and tables... FATA[Apr 28 20:41:58.580] Cannot achieve consistency level for cl QUORUM. Requires 2, alive 1 The last error is caused by single/cluster mode is different, app use cluster, ScyllaDB runs in single mode.

Yang-Rongquan avatar Apr 28 '21 14:04 Yang-Rongquan