How to set ScyllaDB docker as a service
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?
Sure, you can run you application out side Scylla Docker, its the most common case.
@tzach let's take cluster for example.
- after run docker-compose up -d
- when run app, what is the host name
./lightest pop --host localhost -n 100INFO[Apr 28 22:45:05.195] Establishing connection to localhostFATA[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.