1.Redis installation (Linux environment)

Source: Internet
Author: User

reprint please from the source : http://www.cnblogs.com/hd3013779515/

1.Redis Installation

The latest version used is 3.2.9, download and install:

wget http://download.redis.io/releases/redis-3. 2.9.TAR.GZTAR-XZVF REDIS-3.2.9.TAR.GZCD Redis-3.2.9make

Error after executing make

The reason for this error is the lack of GCC and the implementation of Yum install GCC. Then execute make again, or error.

After you execute make Distclean, the compiled Redis service program Redis-server will appear in the redis-3.2.9 directory after successful finish.

There is also a client program for testing REDIS-CLI, two programs located in the installation directory SRC directory:

Start the Redis service below.
./src/redis-server

Note this way of starting Redis is using the default configuration. You can also tell Redis to start with the following command using the specified configuration file through the startup parameters.

./src/redis-server redis.conf

Redis.conf is a default configuration file. We can use our own configuration files as needed.

Once the Redis service process is started, you can use the test client program REDIS-CLI to interact with the Redis service. Like what:

./src/redis-cli

2.Redis Configuration for System services

(1) Copy redis_init_script File

Copy the files to the utils/redis_init_script /etc/rc.d/init.d/ directory and rename them as redis :

CP Utils/redis_init_script/etc/rc.d/init.d/redis

(2) Edit redis File

To edit a /etc/rc.d/init.d/redis file:

In the second line of the file, add:

# chkconfig:2345 80 90

And will take the following line ( start under node):

$EXEC $CONF

Modified to:

$EXEC $CONF &

Note: The & Service will be run in the background, not add this symbol redis will be displayed in the foreground, and affect the start of other services.

Confirm the installation directory

The following two lines in the file are the Redis default directories for the installation. If the actual installation directory does not match the next two lines, modify it to the actual installation directory.

Exec=/home/redis-3.2.9/src/redis-server CLIEXEC=/HOME/REDIS-3.2.9/SRC/REDIS-CLI

Copying conf files

The file has the following line:

conf= "/etc/redis/${redisport}.conf"

The row represents the Redis location of the configuration file redis.conf and is ${REDISPORT} .conf named for the Redis run port.

At this point you need to create and /etc/redis Copy the configuration file to this directory. Execute the following two commands, respectively:

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

(3) Registration system Services

Register the system service using the chkconfig command. The Registration redis Service command is as follows:

Chkconfig--add Redis

Start the redis service:

Service Redis Start

The configuration is complete and the service can now be service managed by command redis .

1.Redis installation (Linux environment)

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.