Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RIOT on docker - missing documentation #167

Open
sagile opened this issue Jan 16, 2025 · 2 comments
Open

RIOT on docker - missing documentation #167

sagile opened this issue Jan 16, 2025 · 2 comments

Comments

@sagile
Copy link

sagile commented Jan 16, 2025

Docker Hub https://hub.docker.com/r/riotx/riot does not have documentation.
The RIOT documentation page https://redis.github.io/riot/ just mentions that it is possible to run RIOT as a docker image via docker run riotx/riot [OPTIONS] [COMMAND].

I tried to run RIOT via the following docker-compose-riot.yml file:

services:
  riot:
    image: riotx/riot:latest
    container_name: riot-tool
    volumes:
      - ./riot-config:/app/config
      - ./wait-for-it.sh:/wait-for-it.sh
    working_dir: /app/config
    entrypoint: ["/bin/sh", "-c"]
    command: |
      db-import "SELECT * FROM beers" --jdbc-url "jdbc:postgresql://postgres:5432/beersdb" --jdbc-username postgres --jdbc-password postgres json.set --keyspace redis.beers.model.Beer --key id
    environment:
      REDIS_URL: redis://redis:6379

But I see error “SELECT * FROM beers: line 0: db-import: not found” in the docker logs.

@polearnik
Copy link

Try without endpoint
Also posssibly you need to use network_mode: host
for reference I use this command to replicate data from db to cluster

docker run -it --rm --name riot --net host riotx/riot replicate --struct --mode live --target-cluster redis://192.168.31.58 redis://192.168.31.177

@sagile
Copy link
Author

sagile commented Jan 16, 2025

Thanks @polearnik, it works now with the following docker-compose file:

services:
  riot:
    image: riotx/riot
    command: db-import "SELECT * FROM beers" --jdbc-url "jdbc:postgresql://localhost:5432/beersdb" --jdbc-username postgres --jdbc-password postgres json.set --keyspace redis.beers.model.Beer --key id
    network_mode: host
    deploy:
      restart_policy:
        condition: none

...

I also needed to fix the postgres url to `jdbc:postgresql://localhost:5432/beersdb` 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants