Could not connect to Redis at 127.0.0.1:6379: Cannot assign requested address

0

I tried connect to redis server but I can't.

$ redis-cli
Could not connect to Redis at 127.0.0.1:6379: Cannot assign requested address
$ telnet localhost 6379
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Cannot assign requested address

But redis is running, redis log:

8088:signal-handler (1560512157) Received SIGTERM scheduling shutdown...
8088:signal-handler (1560512157) Received SIGTERM scheduling shutdown...
8088:M 14 Jun 14:35:57.370 # User requested shutdown...
8088:M 14 Jun 14:35:57.370 * Removing the pid file.
8088:M 14 Jun 14:35:57.370 # Redis is now ready to exit, bye bye...
9840:M 14 Jun 14:35:57.794 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
9840:M 14 Jun 14:35:57.794 # Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
9840:M 14 Jun 14:35:57.794 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
               _._
          _.-``__ ''-._
     _.-``    `.  `_.  ''-._           Redis 3.0.6 (00000000/0) 64 bit
 .-`` .-```.  ```\/    _.,_ ''-._
(    '      ,       .-  `|` ,    )     Running in standalone mode
|`-._`-...-` __...-.``-._|'`_ .-'|     Port: 6379
|    `-._`   .    _/_     .-'    |     PID: 9840
 `-._`    -.  _`-./_  .-'    _.-'
|`-._`-._`    -.__.-'    _.-'_.-'|
|    `-._`-.        __.-'_.-'    |           http://redis.io
 `-._`    -._`-.__.-'_.-'    _.-'
|`-._`-._`    -.__.-'    _.-'_.-'|
|    `-._`-.        __.-'_.-'    |
 `-._`    -._`-.__.-'_.-'    _.-'
     `-._`    -.__.-'    _.-'
         `-._        _.-'
             `-.__.-'

9840:M 14 Jun 14:35:57.794 # Server started, Redis version 3.0.6
9840:M 14 Jun 14:36:11.738 * DB loaded from disk: 13.944 seconds
9840:M 14 Jun 14:36:11.739 * The server is now ready to accept connections on port 6379
$ ps aux | grep redis-server
redis     9840  1.2  3.6 2480008 2391072 ?     Ssl  14:35   0:16 /usr/bin/redis-server 127.0.0.1:6379
afanasev 15123  0.0  0.0  16976   980 pts/3    S+   14:58   0:00 grep --color=auto redis-server
$ sudo netstat -plnt | grep 6379
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      9840/redis-server 1

It is very strange situation. I read all issues in stack overflow, but is not work for me.

Konstantin Liuterovich

Posted 2019-06-14T12:29:46.090

Reputation: 1

Do you have any security subsystems like SELinux or AppArmor active? /edit: Also, please provide the output of ss -s. – Daniel B – 2019-06-14T12:38:41.670

No answers