REDIS-2.8.19.TAR.GZ Installation and startup scripts

Source: Internet
Author: User

Installation section:

#! /bin/bash

Cd/usr/local/src
#wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
Tar zxvf tcl8.6.1-src.tar.gz-c/usr/local/
CD cd/usr/local/tcl8.6.1/unix/
./configure
Make
Make install

Cd/usr/local/src
Tar zxvf redis-2.8.19.tar.gz
CD redis-2.8.19
Make
Make install

Mkdir-p/usr/local/redis/bin
Mkdir-p/usr/local/redis/etc
Mkdir-p/usr/local/redis/var
Cd/usr/local/bin
CP-PF redis-server/usr/local/redis/bin/
CP-PF redis-check-dump/usr/local/redis/bin/
CP-PF redis-sentinel/usr/local/redis/bin/
CP-PF redis-check-aof/usr/local/redis/bin/
CP-PF redis-cli/usr/local/redis/bin/
Cp-pf/home/redis-2.8.19/redis.conf/usr/local/redis/etc

touch/etc/profile.d/redis.sh
Cat >/etc/profile.d/redis.sh << EOF
Export path= $PATH:/usr/local/redis/bin
Eof

Mv/usr/local/bin/redis-cli/usr/local/bin/redis-cli.bak
Mv/usr/local/bin/redis-server/usr/local/bin/redis-server.bak
Mv/usr/local/bin/redis-check-dump/usr/local/bin/redis-check-dump.bak
Mv/usr/local/bin/check-aof/usr/local/bin/check-aof.bak
Mv/usr/local/bin/tclsh8.6/usr/local/bin/tclsh8.6.bak
Mv/usr/local/bin/benchmark/usr/local/bin/benchmark.bak
Mv/usr/local/bin/redis-sentinel/usr/local/bin/redis-sentinel.bak

Startup script:

#!/bin/bash
#
# chkconfig:2345 90 10
# Description:redis
# redis Startup script for Redis processes
#
# Author:snowolf
#
# Processname:redis

Redis_path= "/usr/local/redis/bin/redis-server"
redis_conf= "/usr/local/redis/etc/redis.conf"
Redis_pid= "/usr/local/redis/var/run/redis.pid"

# Source function library.
. /etc/rc.d/init.d/functions

[-X $redis _path] | | Exit 0

Retval=0
Prog= "Redis"


# Start Daemons.
Start () {
If [-e $redis _pid-a!-Z $redis _pid];then
Echo $prog "already running ..."
Exit 1
Fi

Echo-n $ "Starting $prog"
# Instance for all caches
$redis _path $redis _conf
Retval=$?
[$RETVAL-eq 0] && {
touch/var/lock/subsys/$prog
Success $ "$prog"
}
Echo
Return $RETVAL
}


# Stop Daemons.
Stop () {
Echo-n $ "Stopping $prog"
killproc-d $redis _path
Echo
[$RETVAL = 0] && rm-f $redis _pid/var/lock/subsys/$prog

Retval=$?
Return $RETVAL
}


# See how we were called.
Case "$" in
Start
Start
;;
Stop
Stop
;;
Status
Status $prog
Retval=$?
;;
Restart
Stop
Start
;;
Condrestart)
if test "x ' pidof redis '"! = x; Then
Stop
Start
Fi
;;
*)
echo $ "Usage: $ {Start|stop|status|restart|condrestart}"
Exit 1
Esac
Exit $RETVAL

This article is from the "Common Documents" blog, so be sure to keep this source http://yujianglei.blog.51cto.com/7215578/1600805

REDIS-2.8.19.TAR.GZ Installation and startup scripts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.