64-bit installation of Redis in CentOS 6.4

Source: Internet
Author: User
Tags redis version redis cluster

64-bit installation of Redis in CentOS 6.4

I. Introduction

REmote DIctionary Server (Redis) is a key-value storage system. Similar to Memcached, Memcached supports more storage value types, including string, list, set, and zset) and hash (hash type ). These data types support push/pop, add/remove, Intersection Set and difference set, and more abundant operations, and these operations are atomic. On this basis, redis supports sorting in different ways. Like memcached, data is cached in the memory to ensure efficiency. The difference is that redis periodically writes the updated data to the disk or writes the modification operation to the append record file, and on this basis implements master-slave (master-slave) synchronization.

Redis is a high-performance key-value database. The emergence of redis largely compensates for the shortage of key/value storage such as memcached. In some cases, it can play a good complementary role for relational databases. It provides clients such as Java, C/C ++, C #, PHP, JavaScript, Perl, Object-C, Python, Ruby, and Erlang for ease of use.

Redis supports master-slave synchronization. data can be synchronized from the master server to any number of slave servers. The slave server can be the master server associated with other slave servers. This allows Redis to perform single-layer tree replication. The slave database can write data intentionally or unintentionally. Because the publishing/subscription mechanism is fully implemented, you can subscribe to a channel and receive the complete message publishing records of the master server when synchronizing the tree from the database anywhere. Synchronization is helpful for the scalability and data redundancy of read operations.

Ii. Installation

Redis installation is super simple

1. Decompress tar zxvf redis-2.8.18.tar.gz to any directory

2. Compile make

After the make command is executed, multiple executable files are generated in the current directory, including redis-server, redis-cli, redis-benchmark, and redis-stat, their functions are as follows:

  • Redis-server: daemon Startup Program of the Redis server
  • Redis-cli: Redis command line tool, Redis Client
  • Redis-benchmark: Redis performance testing tool to test the read/write performance of Redis in your system and your configuration
  • Redis-stat: Redis status detection tool that can detect Redis's current status parameters and latency

Iii. Test

System: CentOS 6.4 64-bit

Redis: Redis 2.8.18

[Root @ localhost redis] # tar zxvf redis-2.8.18.tar.gz-C/usr/local/redis/# extract the source package to the specified directory

[Root @ localhost redis-2.8.18] # cd/usr/local/redis/redis-2.8.18/# enter this directory

[Root @ localhost redis-2.8.18] # make

The compiled executable file is in the src directory. Run Redis with the following command:

[Root @ localhost redis-2.8.18] #./src/redis-server

[26720] 21 Dec 23:38:07. 043 # Warning: no config file specified, using the default config. in order to specify a config file use. /src/redis-server/path/to/redis. conf

[26720] 21 Dec 23:38:07. 045 * Increased maximum number of open files to 10032 (it was originally set to 1024 ).

_._
_.-''__''-._
_.-'''. '_. ''-. _ Redis 2.8.18 (00000000/0) 64 bit
.-''.-'''.'''\/_.,_''-._
(',.-' | ',) Running in stand alone mode
| '-. _'-...-'_...-.'-. _ | ''_.-'| Port: 6379
| '-. _'. _/_.-'| PID: 26720
'-._'-._'-./_.-'_.-'
| '-. _.-' |
| '-. _'-. _.-'_.-' | Http://redis.io
'-._'-._'-.__.-'_.-'_.-'
| '-. _.-' |
| '-. _'-. _.-'_.-' |
'-._'-._'-.__.-'_.-'_.-'
'-._'-.__.-'_.-'
'-.__.-'
'-.__.-'

[26720] 21 Dec 23:38:07. 069 # Server started, Redis version 2.8.18
[26720] 21 Dec 23:38:07. 070 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. to fix this issue add'vm. overcommit_memory = 1' to/etc/sysctl. conf and then reboot or run the command 'sysctl vm. overcommit_memory = 1' for this to take effect.
[26720] 21 Dec 23:38:07. 072 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. this will create latency and memory usage issues with Redis. to fix this issue run the command 'echo never>/sys/kernel/mm/transparent_hugepage/enabled 'as root, and add it to your/etc/rc. local in order to retain the setting after a reboot. redis must be restarted after THP is disabled.
[26720] 21 Dec 23:38:07. 078 # WARNING: The TCP backlog setting of 511 cannot be enforced because/proc/sys/net/core/somaxconn is set to the lower value of 128.
[26720] 21 Dec 23:38:07. 078 * The server is now ready to accept connections on port 6379


Note: redis is started exclusively at this time. The default port is 6379. To connect to redis, you need to open a new window.

If you want to change the Redis startup mode, you can modify the Redis configuration file redis. conf (there is in the directory after decompression, here is:/usr/local/redis/redis-2.8.18)

For the parameters in redis. conf, I will write the blog to explain them later. Let's look forward to it. ^_^

You can use a built-in client to connect to Redis

[Root @ localhost redis-2.8.18] #./src/redis-cli
127.0.0.1: 6379> set mykey wangxiuli
OK
127.0.0.1: 6379> get mykey
"Wangxiuli"
Wagner. 0.0.1: 6379>

Is it easy? We have installed it successfully.

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

This article permanently updates the link address:

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.