Redis 在Centos Linux&n…
来源:互联网 发布:学而思网校软件 编辑:程序博客网 时间:2024/05/16 05:06
Redis管理脚本基于Ubuntu 的发行版上的,Ubuntu的可以看这篇文章ubuntu安装启动redis,在Centoslinux 上并不能用,下面的脚本可以用于CentOS:
注:如果安装完毕redis, 请cp
cp
用这个脚本管理之前,需要先配置下面的内核参数,否则Redis脚本在重启或停止redis时,将会报错,并且不能自动在停止服务前同步数据到磁盘上:
# vi /etc/sysctl.conf
vm.overcommit_memory = 1
然后应用生效:
# sysctl –p
建立redis启动脚本:
# vim /etc/init.d/redis
#!/bin/bash
#
# Init file for redis
#
# chkconfig: - 80 12
# description: redis daemon
#
# processname: redis
# config: /etc/redis.conf
# pidfile: /var/run/redis.pid
source /etc/init.d/functions
#BIN="/usr/local/bin"
BIN="/usr/local/bin"
CONFIG="/etc/redis.conf"
PIDFILE="/var/run/redis.pid"
### Read configuration
[ -r "$SYSCONFIG" ] && source"$SYSCONFIG"
RETVAL=0
prog="redis-server"
desc="Redis Server"
start() {
}
stop() {
}
restart() {
}
case "$1" in
esac
然后增加服务并开机自启动:
# chmod 755 /etc/init.d/redis
# chkconfig --add redis
# chkconfig --level 345 redison
# chkconfig --listredis
注:请别忘记写好脚本后,增加执行权限 chmod 755/etc/init.d/redis
- Redis 在Centos Linux&n…
- Linux 下 PHP 对&n…
- CentOS 下mysql ERROR&n…
- linux mongodb driver&n…
- 【原创】 linux mysql&n…
- Note 452067.1 &n…
- jcop external&n…
- ExecutionLog2 View -&n…
- poj 2739 sum of&n…
- Lesson 55 Not a&n…
- Lesson 57 Can I&n…
- Lesson 59 In or&n…
- 10071 - Back to&n…
- ACM: uva 11210 &n…
- ACM: uva 1325 -&n…
- ACM: uva 1432 -&n…
- ACM: poj 2786 -&n…
- ACM: poj 3972 -&n…
- redis运行后的一些警告
- linux下svn客户端安装及环境配置
- Linux下php安装Redis扩展
- iOS学习笔记67-UIBezierPath精讲
- SQL,NoSQL 以及数据库的实质…
- Redis 在Centos Linux&n…
- Android 夜间模式的实现(一)
- 小白谈memcache和memcached的区别
- 解决linux启动时无法进入命令行问…
- PHP的线程安全ZTS与非线程(NTS)安…
- ORM--------Hibernate、Mybatis与Spring Data的区别
- PHP开源框架Yaf安装(Windows&nbsp…
- 实例说明get_cfg_var()和ini_get()…
- yaf使用小记