Install Redis in RedHat Linux

Source: Internet
Author: User
Tags redis cluster

Install Redis in RedHat Linux

My Linux system is: RedHat

[Root @ infa ~] # Wget http://download.redis.io/releases/redis-2.8.12.tar.gz

Tar xzf redis-2.8.12.tar.gz

[Root @ infa ~] # Tar xzf redis-2.8.12.tar.gz

[Root @ infa ~] # Cd redis-2.8.12

[Root @ infa redis-2.8.12] # ls

00-RELEASENOTES bugs contributing copying deps INSTALL Makefile manifesto readme redis. conf runtest-sentinel. conf src tests utils

[Root @ infa redis-2.8.12] # make

However, an error occurs during compilation, which may be caused by the system;

The following error is reported:

The solution is to add the compilation parameter settings as follows:

[Root @ infa redis-2.8.12] # make CFLAGS = "-march = i686"

Compiled successfully;

Start and run redis:

[Root @ infa redis-2.8.12] # src/redis-server

Open another terminal to run, redis Client

[Root @ infa redis-2.8.12] # src/redis-cli

127.0.0.1: 6379> set name chenzhou

OK

127.0.0.1: 6379> get name

"Chenzhou"

Wagner. 0.0.1: 6379>

Appendix 2: Start Redis as a Linux Service
Only one simple method is provided here. It is best to compile the boot script.
To start redis at startup, we need to set redis to daemon background startup (if not set to background startup, the graphic interface will be stuck on a blank page after linux is started ), redis only has one startup parameter, which is the configuration file path of redis. The default configuration file redis. conf of redis is located in the installation directory of redis. We can copy the file to the/etc directory.
Shell code
1 [root @ localhost redis-2.6.14] # cp redis. conf/etc/
The value of the daemonize parameter in the default configuration file of redis is no, which indicates that it is not started in the background. Therefore, we need to change the value of this parameter to yes. Other parameters are not described here. For details, refer:
After modifying the daemonize parameter, redis can be started in daemon mode. The next step is to add redis to the linux Startup service configuration. The specific steps are as follows:
Use the VI editor to open the Linux Startup service configuration file/etc/rc. local, and add the following code to it:
Shell code
2/usr/local/redis-2.6.14/src/redis-server/etc/redis. conf
After editing, save and restart the system.
Stop the Redis service:
Shell code
3src/redis-cli shutdown

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

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.