본문 바로가기

개발중/Redis

[트러블슈팅] Could not connect to Redis at 127.0.0.1:6379: Connection refused

728x90
반응형

redis local 에서 접속하려니 아래와 같은 오류가 발생했습니다.

root@DESKTOP-Q26RDFJ:~# redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused

 

redis-server 명령어로 redis 실행시켜준 후 

root@DESKTOP-Q26RDFJ:~# redis-server
617:C 12 Sep 2023 13:37:43.911 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. 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.
617:C 12 Sep 2023 13:37:43.911 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
617:C 12 Sep 2023 13:37:43.911 * Redis version=7.2.0, bits=64, commit=00000000, modified=0, pid=617, just started
617:C 12 Sep 2023 13:37:43.911 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
617:M 12 Sep 2023 13:37:43.913 * Increased maximum number of open files to 10032 (it was originally set to 1024).
617:M 12 Sep 2023 13:37:43.913 * monotonic clock: POSIX clock_gettime
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 7.2.0 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 617
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           https://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

617:M 12 Sep 2023 13:37:43.913 * Server initialized
617:M 12 Sep 2023 13:37:43.914 * Ready to accept connections tcp

 

 

접속을 재시도하니 잘 됩니다.

 

root@DESKTOP-Q26RDFJ:~# redis-cli
127.0.0.1:6379>
728x90
반응형