Install Redis under CentOS 7

Source: Internet
Author: User
Tags install redis
1. Compile and install

1.1, install the compilation tool

First you need to install a variety of required tools:

gcc

gcc-c++

[Root@myhost/]# yum install gcc gcc-c++ 1.2, starting installation

installation, first need to download from the Redis website Redis installation package, such as this example: redis-3.2.5.tar.gz, can also download directly:

[Root@myhost soft]# wget http://download.redis.io/releases/redis-3.2.5.tar.gz

The installation package is a source package that requires local compilation before it can be installed and run.

Extract the installation source pack into a directory:

[Root@myhost server]# tar-zxvf/soft/redis-3.2.5.tar.gz

Compile:

[Root@myhost server]# CD redis-3.2.5

[Root@myhost redis-3.2.5]# make

You can use the root user to perform ' make install ' to copy the executable file to the/usr/local/bin directory. So you can just hit the name and run the program.

[Root@myhost redis-3.2.5]# make install

After compiling, you can find the following file under the "/usr/local/bin" l= Path:

-rwxr-xr-x. 1 root 2431728 November 19:44 Redis-benchmark

-rwxr-xr-x. 1 root 25165 November 19:44 redis-check-aof

-rwxr-xr-x. 1 root 5182199 November 19:44 Redis-check-rdb

-rwxr-xr-x. 1 root 2584443 November 19:44 redis-cli

lrwxrwxrwx. 1 root 12 November 19:44 Redis-sentinel-> redis-server

-rwxr-xr-x. 1 root 5182199 November 19:44 redis-server

Open the default port:

[Root@myhost server]# firewall-cmd--permanent--zone=public--add-port=6379/tcp

[Root@myhost server]# Firewall-cmd--reload

To modify the configuration file "redis.conf":

Bind 0.0.0.0

For the latest version 3. X, an attribute is added, the default is yes, and it needs to be closed:

Protected-mode No

Binding 0.0.0.0 represents allowing all IP addresses to access Redis remotely.

To start the service:

[Root@myhost redis-3.2.5]# nohup redis-server redis.conf &

Test Link:

[Root@myhost redis-3.2.5]# Redis-cli

127.0.0.1:6379>

This redis installation is complete.

Kill Service:

[Root@myhost redis-3.2.5]# redis-cli shutdown

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.