Install redis 2.8.7 on centos

Source: Internet
Author: User
Tags install redis

Installed after several twists and turns


1. Download


Wget http://download.redis.io/releases/redis-2.8.7.tar.gz


The downloaded file is redis-2.8.7.tar.gz in the current directory


2. Compile and install


Tar xf redis-2.8.7.tar.gz

CD redis-2.8.7

Make

Make install


If GCC is not installed, the system prompts GCC not found. Therefore, you need to install GCC:


Yum-y install gcc


Because at the beginning, I switched the yum source to 163, But I was forced to switch back to the original one. As a result, I backed up the built-in system at the beginning, visible backup configuration file benefits in fact the best way should be set to add third-party source and default selection of the fastest, can refer to


After installation, execute the preceding


3. Create a configuration file


Mkdir/etc/redis

CP redis. CONF/etc/redis. conf


4. Adjust the memory allocation usage and make it take effect.


Echo "VM. overcommit_memory = 1">/etc/sysctl. conf

# The available values of this parameter are 0, 1, and 2.

#0 indicates that when the user space requests more memory, the kernel attempts to estimate the available memory.

#1 indicates that the kernel allows excessive memory usage until the memory is used up.

#2 indicates that the whole memory address space cannot exceed the ram value of swap + (VM. overcommit_ratio) %

Sysctl-P


5. Modify redis Configuration


VI/etc/redis. conf

Daemonize yes # redis runs as a daemprocess,

# No indicates not running as a daemon (a terminal will be occupied)

Timeout 300 # how long the client is idle before it is disconnected. The default value is 0.

Loglevel verbose # Set the redis Log Level

Logfile stdout # Set the log file output mode. If you run redis as a daemon

# If the log output is set to stdout, the log information is output to/dev/null.


6. Start redis


Redis-server/etc/redis. conf


7. Test redis


[Root @ localhost redis] # redis-cli

127.0.0.1: 6379> Set Name Wayne

OK

127.0.0.1: 6379> get name

"Wayne"

Wagner. 0.0.1: 6379>

Article source, my blog: http://www.cnwsjs.cn /? P = 172

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.