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

Why JSON is not working in Redis Stack? #235

Open
vic-951 opened this issue Jan 3, 2024 · 1 comment
Open

Why JSON is not working in Redis Stack? #235

vic-951 opened this issue Jan 3, 2024 · 1 comment

Comments

@vic-951
Copy link

vic-951 commented Jan 3, 2024

Hello there,

I started a docker container with redis-stack and tried to insert JSON keys but redisinsight tell me: RedisJSON is not available
for this database

JSON.SET school_json:4 $ '{"name":"Forest School","description":"The philosophy behind Forest School is based upon the desire to provide young children with an education that encourages appreciation of the wide world in nature while achieving independence, confidence and high self-esteem. ","class":"independent","type":["forest","montessori","democratic"],"address":{"city":"Oxford","street":"Trident Street"},"students":1200,"location":"51.781756, -1.123196","status_log":["new","operating"]}'

image

this is my docker compose file

version: '3'

services:
  redis:
    image: redis/redis-stack-server:latest
    restart: always
    container_name: rds
    command: redis-server /usr/local/etc/redis/redis.conf
    ports:
      - "7001:6379"
    volumes:
      - /home/user/docker/redis/data:/data
      - /home/user/docker/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf

how can I activate RedisJSON in docker?

@vic-951
Copy link
Author

vic-951 commented Jan 5, 2024

I got the solution from Discord. The command is the problem, because of this all modules where not loaded (see https://github.com/redis-stack/redis-stack/blob/master/etc/scripts/entrypoint.sh)

so the solution is to delete the command and set the root path for redis-stack.conf

version: '3'

services:
  redis:
    image: redis/redis-stack-server:latest
    restart: always
    container_name: rds
    ports:
      - "7001:6379"
    volumes:
      - /home/user/docker/redis/data:/data
      - /home/user/docker/redis/conf/redis.conf:/redis-stack.conf

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

1 participant