In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
How to set redis to boot automatically? I believe that many novice rookies have not yet learned this skill. Through the summary of this article, I hope you can learn this skill. The following materials are the steps for implementation.
Use the following method to pay attention to the path to the installation file and the path to the configuration file.
[root@localhost ~] # vi / etc/init.d/redis
Copy the following code into the script (note that you need to modify the installation path of redis, it is not clear to look it up by find)
(this code is the code for the redis root directory / utils/redis_init_script startup script)
#! / bin/sh# chkconfig: 2345 10 90 # description: Start and Stop redis REDISPORT=6379EXEC=/usr/local/bin/redis-serverCLIEXEC=/usr/local/bin/redis-serverPIDFILE=/var/run/redis_$ {REDISPORT} .pidCONF = "/ etc/redis/redis.conf" case "$1" in start) if [- f $PIDFILE] then echo "$PIDFILE exists Process is already running or crashed "else echo" Starting Redis server... "$EXEC $CONF & fi Stop) if [!-f $PIDFILE] then echo "$PIDFILE does not exist Process is not running "else PID=$ (cat $PIDFILE) echo" Stopping... "$CLIEXEC-p $REDISPORT shutdown while [- x / proc/$ {PID}] do echo" Waiting for Redis to shutdown... " Sleep 1 done echo "Redis stopped" fi;; restart) "$0" stop sleep 3 "$0" start; *) echo "Please use start or stop or restart as first argument";; esac
Set permissions
[root@localhost ~] # chmod 777 / etc/init.d/redis
Set up boot boot
Chkconfig redis on
Start the test
Service start redis
After reading this article, have you learned how to set up redis to boot automatically? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel. Thank you for reading.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.