Troubleshoot Redis server startup failure: solve the problem of restarting and unable to obtain remote connection access

在 新 的 CentOS 7 The Redis server is installed on the machine, but cannot be started using systemctl.

Try to start the Redis service▼

systemctl start redis.service
  • Redis failed to start (no output).

Here's what happens when trying to connect to Redis:

redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>

But starting Redis manually works:

[root@redis ~]# redis-cli
127.0.0.1:6379>

Query Redis status, it shows that Redis is not activated ▼

[root@redis ~]# systemctl status redis.service
redis-server.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis-server.service; disabled)
Active: inactive (dead)

November 25 18:52:16 redis systemd[1]: Starting Redis persistent key-value database...
November 25 18:52:16 redis systemd[1]: Started Redis persistent key-value database.

The following is another query to query the status of Redis, showing an example of Redis failure ▼

Troubleshoot Redis server startup failure: solve the problem of restarting and unable to obtain remote connection access

Solve the problem that the Redis server fails to start

To run the latest version of Redis with systemd, you need to edit the Redis configuration file:

/etc/redis.conf

Build and configure Redis with systemd support ▼

daemonize no

supervised auto

What should I do if Redis cannot obtain remote connection access after restarting the VPS server?

If you restart the VPS server, Redis cannot start to obtain remote connection access, you can delete the dump.rdb (memory snapshot) file ▼

cd /var/lib/redis
mv dump.rdb dump.rdb_bak

Check if the Redis service is started▼

ps -ef|grep redis
  • Try to restart the VPS server. If Redis can start as usual, it means that the Redis configuration file just edited works.

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Redis Server Startup Failure Troubleshooting: Solve Restart Unable to Obtain Remote Connection Access", which is helpful to you.

Welcome to share the link of this article:https://www.chenweiliang.com/cwl-29424.html

Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!

🔔 Be the first to get the valuable "ChatGPT Content Marketing AI Tool Usage Guide" in the channel top directory! 🌟
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!

 

Comment

Your email address will not be published. Required fields * Callout

scroll to top