codenotary / immudb

immudb - immutable database based on zero trust, SQL/Key-Value/Document model, tamperproof, data change history
https://immudb.io
Other
8.54k stars 340 forks source link

No immuclient found in /usr/local/bin in innudb docker image #566

Closed prachi2703 closed 3 years ago

prachi2703 commented 3 years ago

In the documentation, it has been mentioned that we can find immuclient in the immudb container (/usr/local/bin/immuclient). But there was no such file present other than immuadmin.

If I want to runn immuclient image to connect to the immudb container, do I need to pass/set any environment variables? I am getting the following error while running: docker run -it --rm --name immuclient codenotary/immuclient:latest -a localhost

rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:3322: connect: connection refused"

Screenshot from 2020-11-30 18-49-11

SimoneLazzaris commented 3 years ago

Hi prachi2703; you need to tell immuclient which is immudb address in order to connect to it. You can do it in two ways:

In the first way you ask docker for the IP of the immudb server and use it this "dynamic" ip on the client:

  1. launch immudb server container: docker run -it --rm --name immudbserver -p 3322:3322 codenotary/immudb:latest
  2. keep note of the it's assigned ip: docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' immudbserver
  3. use that IP on immuclient: docker run -it --rm --name immuclient codenotary/immuclient:latest -a address.that.is.the.result.of.last.command

Other way, you can assign a "static" IP address to the server and use it in the client:

  1. docker network create --subnet=172.18.0.0/16 mynet123
  2. docker run --net mynet123 --ip 172.18.0.22 -it --rm --name immudbserver -p 3322:3322 codenotary/immudb:latest
  3. docker run -it --rm --net mynet123 --name immuclient codenotary/immuclient:latest -a 172.18.0.22
prachi2703 commented 3 years ago

Thanks!! That worked.

vchaindz commented 3 years ago

if you don't want to use ip addresses at all:

docker network create immudbnet
docker run -d --net immudbnet -it --rm --name immudb -p 3322:3322 codenotary/immudb:latest
docker run -it --rm --net immudbnet --name immuclient codenotary/immuclient:latest -a immudb