Redis Server Setup under Linux

Source: Internet
Author: User
Tags redis version redis server

System environment

Operating system: CentOS 6.9

Redis version: redis-4.0.2 installation steps

1, installation Pre-environment

Run the following command to install the pre-environment.

[[email protected] redis-4.0.2]# yum-y install gcc make


2. Download the Redis source code file and unzip it

After downloading the Redis source code, run the following command to extract it.

[Email protected] softwares]# TAR-XZF redis-4.0.2.tar.gz


3,redis compiling

Run the make command to compile.

After the make command finishes compiling, 6 executables are generated in the SRC directory, namely Redis-server, REDIS-CLI, Redis-benchmark, redis-check-aof, Redis-check-dump, Redis-sentinel.


4,redis installation Configuration

Run the Make install command.

After the command executes, the executable file generated by the make compilation is copied to the/usr/local/bin directory, such as.

Then, run the./utils/install_server.sh Configuration Wizard to configure Redis, and you can add the Redis service to boot. Important


5,redis Service view, open and close

The Redis service is now started. You can use the following command to operate Redis.

To view the running status of Redis:

[[Email protected] redis-4.0.2]# service redis_6379 status

To turn off the Redis service:

[[Email protected] redis-4.0.2]# service redis_6379 stop

To turn on the Redis service:

[[Email protected] redis-4.0.2]# service redis_6379 start

Finally, you can test it by using the Redis built-in client tool:

[Email protected] ~]# REDIS-CLI

127.0.0.1:6379> Get Name

(nil)

127.0.0.1:6379> Set name McGrady

Ok

127.0.0.1:6379> Get Name

"McGrady"

127.0.0.1:6379>

As you can see, the Redis service has been successfully configured! Precautions

1, run make command error?

The error message is as follows:

MAKE[3]: Gcc:command not found

/bin/sh:cc:command not found

Solution:

Because the pre-environment is not installed, run the following command to install the pre-environment.

[[email protected] redis-4.0.2]# yum-y install gcc make


2. Run the make command to report the following error after installing the pre-environment?

Error message:

Zmalloc.h:50:31:error:jemalloc/jemalloc.h:no such file or directory

Zmalloc.h:55:2: Error: #error "Newer version of Jemalloc required"

Solution:

Run the following command.

Make MALLOC=LIBC


3. Run the Make Test command to report the following error?

Error message:

You need TCL 8.5 or newer in order to run the Redis test

Solution:

Run the following command to install TCL.

[Email protected] redis-4.0.2]# yum-y install TCL


4, call Connectionmultiplexer.connect when creating a connection error?

Error message:

It is not a possible to connect to the Redis server (s); To create a disconnected multiplexer, disable abortonconnectfail. Unabletoresolvephysicalconnection on time

Solution:

1) Turn off protection mode, note that the default is open.

2) Bind IP, note that only 127.0.0.1 is bound by default.

Useful commands:

Telnet 192.168.1.29 6379, you can directly test whether the client can connect to the server, if so, basically there is no problem.

Ps-aux | grep Redis, review the Redis process to see if redis starts normally. Resources

    1. Official website: https://redis.io/download
    2. CentOS 7 Installation Configuration Redis database: http://jingyan.baidu.com/article/6dad507510ea07a123e36e95.html
    3. Redis gui:https://redisdesktop.com/
    4. Redis's monitoring and management tools: http://www.cnblogs.com/treesoft/p/7076085.html

Redis Server Setup under Linux

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.