Linux Redis Installation Deployment Operations Guide (i)

Source: Internet
Author: User
Tags benchmark redis server

First,RedisInstallation Deployment

introduction of 1.1 and environment

System Environment: Red hatenterprise Linux Server Release 6.2 (Santiago)

kernel version: Linux zxt-02.com2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST. x86_64 x86_64 x86_64gnu/linux

software version: redis-3.0.5

Host Name: zxt-1.com

Host IP : 192.168.1.108

Install the required software environment:

1.2,Redisinstallation

Software:http://redis.io/download

System Environment Configuration:

$echo vm.overcommit_memory=1 >>/etc/sysctl.conf $echo 511>/proc/sys/net/core/somaxconn


Use numeric meanings:

0 indicates that the kernel will check for sufficient available memory to be used by the process, and if sufficient memory is available, the memory request is allowed; otherwise, the memory request fails and the error is returned to the application process.

1 , which means that the kernel allows all physical memory to be allocated regardless of the current state of memory.

2 that indicates that the kernel allows allocating more memory than the sum of all physical memory and swap space


Compiling the installation

$wget Http://redis.googlecode.com/files/redis-2.2.7.tar.gz$tar xzf redis-2.2.7.tar.gz$cp-r redis-3.0.5/usr/local/$ Ln-s/usr/local/redis-3.0.5//usr/local/redis$cd/usr/local/redis$make test$make$make Install $CP redis.conf/etc/


Parameter description:

When the make install command finishes executing, the executable is generated in the/usr/local/bin directory, respectively , Redis-server,redis-cli, Redis-benchmark, redis-check-aof ,redis-check-dump, and their functions are as follows:

Redis-server:daemon boot program for Redis server

REDIS-CLI:Redis Command-line Operations tool. You can also use telnet to manipulate it based on its plain text protocol.

Redis-benchmark:redis Performance test tool to test Redis Read and write performance under current system

Redis-check-aof: Data repair

Redis-check-dump: Check the export tool

1.3, modifyRedisconfiguration file
[[email protected] bin]# vim /etc/redis.conf daemonize yes                            //42 line      #是否以后台daemon方式运行, default is not run in the background pidfile/var/run/redis/ REDIS.PID //46      #redis的PID文件路径 (may not change according to personal preference) bind 192.168.1.108                 //69 Line       #绑定主机IP, the default value of 127.0.0.1 can not be changed, if it is run across machines, you need to change logfile/var/log/redis/redis.log   //108 line     #定义log文件位置, mode log information directed to stdout, output to/dev/nullsave 60 1000                       //149 Line   # Redefining the frequency of snapshots dir/usr/local/rdbfile             // 192 rows    #本地数据库存放路径, default is./, compile and install default exists under/usr/local/bin 


Configuration file parameters are described:

daemonize : Whether the next station Daemon Way to run

Pidfile : PID File Location

Port : The port number of the listener

Timeout : Request Time-out

loglevel : Log Information Level

logfile : Log File Location

databases : Number of open databases

Save * * : The frequency of saving snapshots, the first * indicates how long, and a third * indicates how many times the write operation was performed. Snapshots are automatically saved when a certain number of writes are performed within a certain amount of time. You can set multiple conditions.

rdbcompression : Whether to use compression

Dbfilename : Data Snapshot file name (only file name, excluding directory)

dir : The Save directory for the data snapshot (this is the directory)

Requirepass : # Set Redis connection Password, if the connection password is configured, the client is connected Redis is required

to pass AUTH <password> The command provides a password, which is closed by default.

appendonly : whether to open Appendonlylog , and each write operation will remember one Log , which can improve the ability of data to resist risk, but affect efficiency.

Appendfsync : Appendonlylog How to sync to disk (three options, each of which is forced to call each write Fsync , enable once per second Fsync , do not call Fsync wait for the system to synchronize itself)

1.4.1, startRedis
$ cd/usr/local/bin $./redis-server/etc/redis.conf


1.4.2, check that startup is successful
$ps-ef | grep redis[[email protected] redis]# SS-TANLP | grep REDIS0 511 192.168.1.108:6379 *:* Users: (("Redis-server", 4937,4))

1.4.3, closeRedis

Save the cache to your hard disk

[Email protected] redis]# redis-cli-h 192.168.1.108-p 6379 BGSAVE

Background savingstarted

Close Redis

$ redis-cli Shutdown

# Close the redis-server of the specified port

$redis-cli-p 6379 shutdown


This article is from "Xiao Zhang's blog" blog, please be sure to keep this source http://xiaozhangit.blog.51cto.com/3432391/1721691

Linux Redis Installation Deployment Operations Guide (i)

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.