In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to write the redis startup management script, the article introduces in great detail, has a certain reference value, interested friends must read it!
I am redis-3.0.5 installed by source code.
Installation path / usr/local/redis
Edit the create script file:
Vim / etc/init.d/redis
#! / bin/sh## chkconfig: 2345 85 15 # description: this script can manager the redis-server daemon# Redis is a persistent key-value database# exec: / usr/local/redis/bin/redis-server# config: / usr/local/redis/conf/redis.conf # pidfile: / usr/local/redis/logs/redis.pid # datafile: / usr/local/redis/data/redis.rdb redis= "/ Usr/local/redis/bin/redis-server "REDIS_CONF_FILE=" / usr/local/redis/conf/redis.conf "prog=$ (basename $redis) lockfile=/var/lock/subsys/redis# Source function library.. / etc/rc.d/init.d/functions # Source networking configuration.. / etc/sysconfig/network # Check that networking is up. ["$NETWORKING" = "no"] & & exit 0 start () {[- x $redis] | | exit 5 [- f $REDIS_CONF_FILE] | | exit 6 echo-n $"Starting $prog:" daemon $redis $REDIS_CONF_FILE retval=$? Echo [$retval-eq 0] & & touch $lockfile return $retval} stop () {echo-n $"Stopping $prog:" killproc $prog-QUIT retval=$? Echo [$retval-eq 0] & & rm-f $lockfile return $retval} restart () {stop start} reload () {echo-n $"Reloading $prog:" killproc $redis-HUP RETVAL=$? Echo} rh_status () {status $prog} rh_status_q () {rh_status > / dev/null 2 > & 1} case "$1" in start) rh_status_q & & exit 0 $1;; stop) rh_status_q | | exit 0 $1;; restart) $1 Reload) rh_status_q | | exit 7 $1;; status) rh_status;; *) echo $"Usage: $0 {start | stop | restart | reload | status}" exit 2esac
Modify script operation permissions and add executable permissions
Chmod 755 / etc/init.d/redis
The above is all the contents of the article "how to write the redis startup management script". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.