ASP源码.NET源码PHP源码JSP源码JAVA源码DELPHI源码PB源码VC源码VB源码Android源码
当前位置:首页 >> 数据库 >> 其他数据库 >> CentOS 65 x64 Redis 安装

CentOS 65 x64 Redis 安装(2/2)

来源:网络整理     时间:2016-03-09     关键词:

本篇文章主要介绍了"CentOS 65 x64 Redis 安装",主要涉及到方面的内容,对于其他数据库感兴趣的同学可以参考一下: yum install gcc make安装步骤: wget http://download.redis.io/releases/redis-2.8.19...

tcp        0      0 :::6379                     :::*                        LISTEN      4852/redis-server *

    vim /etc/init.d/redis

-----------------------------------------

#!/bin/sh
#
# redis        init file for starting up the redis daemon
#
# chkconfig:   - 20 80
# description: Starts and stops the redis daemon.
# Source function library.
. /etc/rc.d/init.d/functions
name="redis-server"
basedir="/usr/local/redis"
exec="$basedir/bin/$name"
pidfile="$basedir/var/redis.pid"
REDIS_C />
[ -e /etc/sysconfig/redis ] && . /etc/sysconfig/redis
lockfile=/var/lock/subsys/redis
start() {
    [ -f $REDIS_CONFIG ] || exit 6
    [ -x $exec ] || exit 5
    echo -n $"Starting $name: "
    daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG"
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}
stop() {
    echo -n $"Stopping $name: "
    killproc -p $pidfile $name
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}
restart() {
    stop
    start
}
reload() {
    false
}
rh_status() {
    status -p $pidfile $name
}
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
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}"
        exit 2
esac
exit $?

-----------------------------------------

    chmod 755 /etc/init.d/redis

测试redis服务

    redis-cli

以上就介绍了CentOS 65 x64 Redis 安装,包括了方面的内容,希望对其他数据库有兴趣的朋友有所帮助。

本文网址链接:http://www.codes51.com/article/detail_402461_2.html

相关图片

相关文章