Install Redis in CentOS 6.6

Source: Internet
Author: User
Tags redis cluster

Install Redis in CentOS 6.6

Notes for installing Redis in CentOS 6.6.

I. Introduction

Redis is used for database caching, session storage, and message queues.

Ii. Installation

$ Yum install-y wget gcc make tcl
$ Wget http://download.redis.io/releases/redis-3.0.2.tar.gz
$ Tar zxvf redis-3.0.2.tar.gz
$ Redis-3.0.2 cd
$ Make
$ Make test
$ Make install

Iii. Configuration

$ Cp redis. conf/etc/
$ Touch/etc/init. d/redis
$ Chmod 755/etc/init. d/redis
$ Vi/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 (){
If [-e $ PIDFILE]; then
Echo "$ desc already running ...."
Exit 1
Fi
Echo-n $ "Starting $ desc :"
Daemon $ BIN/$ prog $ CONFIG
RETVAL =$?
Echo
[$ RETVAL-eq 0] & touch/var/lock/subsys/$ prog
Return $ RETVAL
}
Stop (){
Echo-n $ "Stop $ desc :"
Killproc $ prog
RETVAL =$?
Echo
[$ RETVAL-eq 0] & rm-f/var/lock/subsys/$ prog $ PIDFILE
Return $ RETVAL
}
Restart (){
Stop
Start
}
Case "$1" in
Start)
Start
;;
Stop)
Stop
;;
Restart)
Restart
;;
Condrestart)
[-E/var/lock/subsys/$ prog] & restart
RETVAL =$?
;;
Status)
Status $ prog
RETVAL =$?
;;
*)
Echo $ "Usage: $0 {start | stop | restart | condrestart | status }"
RETVAL = 1
Esac
Exit $ RETVAL

# Remember to modify it in redis. conf
Daemonize yes

4. Run

$/Etc/init. d/redis start
$ Chkconfig redis on

5. Check

Install and test Redis in Ubuntu 14.04

Redis cluster details

Install Redis in Ubuntu 12.10 (graphic explanation) + Jedis to connect to Redis

Redis series-installation, deployment, and maintenance

Install Redis in CentOS 6.3

Learning notes on Redis installation and deployment

Redis. conf

Redis details: click here
Redis: click here

This article permanently updates the link address:

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.