{solve} redis: localhost: 6379. Unable to assign the requested address

UPDATE: I solved the problem, from the log I saw that db often opened and closed. I created a redis creation in a for loop. So ... stupid question, if anyone logs in like me, check the loop.

I tried turning it off and restarting, but it still happened. Here is the error message:

redis.exceptions.ConnectionError: Error 99 connecting localhost: 6379. Unable to assign the requested address.

I tried to insert 300,000 entries in redis (my memory is big enough). But after I inserted about 30,000 entries into it, an error occurs:

redis.exceptions.ConnectionError: Error 99 connecting localhost:6379. Cannot assign requested address. 

Looking at the log file, it looks like redis is closed after I successfully insert 30,000 entries into it.

The following is part of my log file:

 [32176] 11 Jun 20:59:27 - Accepted 127.0.0.1:36578 [32176] 11 Jun 20:59:27 - Client closed connection [32176] 11 Jun 20:59:27 - Accepted 127.0.0.1:52327 [32176] 11 Jun 20:59:27 - Client closed connection [32176] 11 Jun 20:59:27 - Accepted 127.0.0.1:52367 [32176] 11 Jun 20:59:27 - Client closed connection [32176] 11 Jun 20:59:27 - Accepted 127.0.0.1:52368 [32176] 11 Jun 20:59:27 - Client closed connection [32176] 11 Jun 20:59:27 - Accepted 127.0.0.1:52369 [32176] 11 Jun 20:59:27 - Client closed connection [32176] 11 Jun 20:59:27 - Accepted 127.0.0.1:52370 [32176] 11 Jun 20:59:27 - Client closed connection [32176] 11 Jun 20:59:28 - DB 6: 28226 keys (0 volatile) in 32768 slots HT. [32176] 11 Jun 20:59:28 - 0 clients connected (0 slaves), 9181112 bytes in use [32176] 11 Jun 20:59:33 - DB 6: 28226 keys (0 volatile) in 32768 slots HT. [32176] 11 Jun 20:59:33 - 0 clients connected (0 slaves), 9181112 bytes in use [32176] 11 Jun 20:59:38 - DB 6: 28226 keys (0 volatile) in 32768 slots HT. [32176] 11 Jun 20:59:38 - 0 clients connected (0 slaves), 9181112 bytes in use [32176] 11 Jun 20:59:43 - DB 6: 28226 keys (0 volatile) in 32768 slots HT. [32176] 11 Jun 20:59:43 - 0 clients connected (0 slaves), 9181112 bytes in use 
+7
source share

All Articles