CentOS installation redis+ three ways to start

Source: Internet
Author: User
Tags download redis redis centos install redis

Redis is a NoSQL database. This series of blogs is mainly for the installation of the server environment problems encountered. Using NoSQL databases can improve the efficiency of data access. Because I used redis in my project, and now I need to build a test environment, I want to tidy up a bit.

The installation of Redis on CentOS can be done directly from the command line, provided that it can be linked to the extranet. Redis Installation necessary packages required to install Redis

Yum install gcc Download Redis installation package

Download Redis installation package
wget http://download.redis.io/releases/redis-3.0.6.tar.gz
//unzip
tar zxvf redis-3.0.6.tar.gz
//Jump to Redis directory
CD redis-3.0.0
//compile and install make
MALLOC=LIBC

After completing the above steps, Redis is installed successfully. Of course, after the completion, you need to test, please continue to see the redis boot mode to start directly

In the root directory of Redis, perform src/redis-cli background boot

The first way to start, after starting, need to open the window, for the server is very unsuitable. So you need to use background boot 1, modify the redis.conf file

#修改daemonize为yes, that is, the default way to run the program (remember to manually use & to force the background to run earlier).
Daemonize No
2. Then start with redis.conf
CD redis-3.0.6/
./redis-server/usr/local/redis-3.0.6/redis.conf

This boot mode, if necessary, must kill the Redis process.
Turn off mode refer to the –>jboss of this article closed mode 3, write Redis startup script settings Boot

3.1 Configure the environment, copy the configuration file to the specified directory with the port name (root user required)

Mkdir/etc/redis
CP redis.conf/etc/redis/6379.conf

3.2 Copy the startup script to the/ETC/INIT.D directory, this example names the startup script REDISD (usually ending with D as the background self-starting service).
Note : You need to modify the Linux RunLevel
Add the following lines of code at the beginning of the Redis_init_script file:

#!/bin/sh
# chkconfig:   2345 #
Description: Redis is  a persistent key-value database
#

Then copy the Redis_init_script file to the startup directory. Refer to "Linux RunLevel" here

CP REDIS_INIT_SCRIPT/ETC/INIT.D/REDISD

3.3 Set to boot from boot

3.4 Start/close Redis service

Start Redis
service REDISD start
//Turn off Redis
service REDISD stop

After completing the above steps, the Redis service is finished. It is said to be three startup modes, but it will be configured to open the boot entry. This allows the Redis to be turned off by a single command.


Reference article:
Http://www.cnblogs.com/goodspeed/archive/2012/10/18/2729615.html

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.