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

Namespaces not available in replica #1804

Open
ryands17 opened this issue Oct 31, 2024 · 1 comment
Open

Namespaces not available in replica #1804

ryands17 opened this issue Oct 31, 2024 · 1 comment

Comments

@ryands17
Copy link
Contributor

Hey folks,

I have a docker-compose setup as follows:

services:
  db:
    image: ghcr.io/tursodatabase/libsql-server:e853d54
    volumes:
      - db_data:/var/lib/sqld
    ports:
      - 8080:8080
      - 8082:8082
    environment:
      - SQLD_NODE=primary
      - SQLD_HTTP_LISTEN_ADDR=0.0.0.0:8080
      - SQLD_GRPC_LISTEN_ADDR=0.0.0.0:5001
      - RUST_LOG=debug
    command: [ 'sqld', '--db-path', '/var/lib/sqld/primary.sqld', '--admin-listen-addr', '0.0.0.0:8082', '--enable-namespaces' ]
  replica:
    image: ghcr.io/tursodatabase/libsql-server:e853d54
    volumes:
      - db_replica:/var/lib/sqld
    depends_on:
      - db
    ports:
      - '8081:8080'
    environment:
      - SQLD_NODE=replica
      - SQLD_PRIMARY_URL=http://db:5001
      - RUST_LOG=debug
volumes:
  db_data:
  db_replica:

Without namespaces, this setup works fine and everything is replicated to the replica instance. But as soon as I enable namespaces and create a new namespace via the Admin API, it's not available in the replica and only in the primary.

Is there something I'm missing in my compose file?

@pauchiner
Copy link

pauchiner commented Nov 27, 2024

Hi @ryands17, one little question, how you managed to use the namespaces?

I have a docker container with almost the same configuration as you but without the replica enabled, and I created two namespaces with the Admin API.

But when I try connecting to them under the http://localhost:PORT/dev/NAMESPACE it fails.

Im only able to connect to the default namespace with http://localhost:PORT

Update

I tried with turso db shell http://localhost:PORT/dev/NAMESPACE command and it works.

But I can't connect to the namespaces from a external sqlite client, (Dataflare, Drizzle Studio)

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