redismod icon indicating copy to clipboard operation
redismod copied to clipboard

Unable to start redis with --loadmodule or redis.conf file

Open dhairyashil opened this issue 4 years ago • 1 comments

I am getting this exception when I am trying to set password to my redis instance as stated in docs. but I am getting below exception while running docker container.

1:C 29 Oct 2021 20:57:14.130 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 1:C 29 Oct 2021 20:57:14.130 # Redis version=6.2.3, bits=64, commit=00000000, modified=0, pid=1, just started 1:C 29 Oct 2021 20:57:14.130 # Configuration loaded 1:M 29 Oct 2021 20:57:14.130 * monotonic clock: POSIX clock_gettime 1:M 29 Oct 2021 20:57:14.130 # Warning: Could not create server TCP listening socket ::1:6379: bind: Cannot assign requested address 1:M 29 Oct 2021 20:57:14.131 * Running mode=standalone, port=6379. 1:M 29 Oct 2021 20:57:14.131 # Server initialized 1:M 29 Oct 2021 20:57:14.131 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. 1:M 29 Oct 2021 20:57:14.131 # Module /usr/lib/redis/modules/rebloom.so failed to load: /usr/lib/redis/modules/rebloom.so: cannot open shared object file: No such file or directory

dhairyashil avatar Oct 29 '21 21:10 dhairyashil

Update: I was also getting error when trying to use --requirepass or a redis.conf file. I was using docker-compose.

My issues:

  • I was using the line-breaks from the example within my docker-compose file. I needed to create a custom command: entry as a single line.
  • Passing "--" arguments results in an error "Fatal error, can't open config file '/data/redislabs/redismod': No such file or directory". I can avoid this by touch-ing an empty file at that location and creating the redislabs directory in my data directory.

I have not succeeded in using a custom redis.conf, but by the above two steps I am able to pass "--" arguments.

Here's my docker-compose.yml for example:

services:
  redis:
    image: redislabs/redismod
    container_name: redis
    volumes:
      - ./data:/data
    command: redislabs/redismod --requirepass ${REDIS_PASSWORD} --dir /data --loadmodule /usr/lib/redis/modules/redisgraph.so
    ports:
      - 6379:6379

dactylroot avatar Nov 22 '21 19:11 dactylroot