docker redis -Can't open the log file: No such file or directory
As I can see here, the log file is not specified and all logs output to the stdout. I wouldn't change this behaviour because in that way docker will manage logs on his own which is standard and even more flexible way.
If you want to redirect logs output somewhere I would suggest using logging
directive of the composer.
Kery Hu
love java ,spring boot ,spring cloud and docker ,and on the way always! love Maths , Big data ,machine learning
Updated on June 04, 2022Comments
-
Kery Hu almost 2 years
my OS is : ubuntu:15.10
And i want to use the official docker-hub redis , but met problems .
my docker-compose.yml
version: '2' services: redis: image: redis ports: - "6379:6379" volumes: - ~/dbdata/redis_conf/redis.conf:/usr/local/etc/redis/redis.conf volumes_from: - redisdata environment: - REDIS_PASSWORD: 29c4181fb842b5f24a3103dbd2ba17accb1f7e3c8f19868955401ab921 command: redis-server /usr/local/etc/redis/redis.conf redisdata: image: redis volumes: - /home/keryhu/dbdata/redisdb:/data command: --break-redis
I copy the default redis.conf to the "~/dbdata/redis_conf/redis.conf" directory . And just modify the "requirepass" to "29c4181fb842b5f24a3103dbd2ba17accb1f7e3c8f19868955401ab921"
when i start the container ,i met an error -
*** FATAL CONFIG FILE ERROR *** Reading the configuration file, at line 103 >>> 'logfile /var/log/redis/redis-server.log' Can't open the log file: No such file or directory
Can help me ?
-
Kery Hu about 8 yearsmy target is : add password env in the docker-compose.yml ,, do not care the log path . how resolve?
-
max about 8 yearsOpen
~/dbdata/redis_conf/redis.conf
, findlogfile /var/log/redis/redis-server.log
, and replace it withlogfile ""
. That's it. -
Kery Hu about 8 yearsyes,i set log file "", now i start it ok,but another issue -- i already set
requirepass 29c4181fb842b5f24a3103dbd2ba17accb1f7e3c8f198689821f7955401ab921
in local redis.conf , and it exists in redis-container 's directory .. but i inputconfig get requirepass
it is ""
, why? -
max about 8 yearsWhere did you input this? I guess you have done it in redis-cli which is outside the container.
-
Kery Hu about 8 yearsyes, first
docker exec -it redis bash
, thenredis-cli
, i guess i should see the auth , because i have set it -
max about 8 yearsTry to recreate containers with
docker-compose rm
and thendocker-compose up
. This should help. -
Kery Hu about 8 yearsI remove images and docker build again . but ---
redisdata_1 | /entrypoint.sh: line 10: exec: --: invalid option redisdata_1 | exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...] springredis_redisdata_1 exited with code 2 redis | 1:C 12 Mar 13:31:10.806 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf redis | _._
and not find requirepass -
max about 8 yearsLet us continue this discussion in chat.