Centos7 Installing Redis

Source: Internet
Author: User
Tags bind hash redis install redis redis server

To turn off the firewall:
Systemctl Stop Firewalld.service #停止firewall
Systemctl Disable Firewalld.service #禁止firewall开机启动
Firewall-cmd--state #查看默认防火墙状态 (show notrunning after turn off, show running when turned on)
To Configure the compilation environment:
sudo yum install gcc-c++
Download Source:
wget http://download.redis.io/releases/redis-3.2.8.tar.gz
Decompression Source:
TAR-ZXVF redis-3.2.8.tar.gz
go to unzip directory:
CD redis-3.2.8
perform make to compile Redis:
Make MALLOC=LIBC
Note: 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-rdb, Redis-sentinel.
To install Redis:
Make install
Configure Redis to boot with the system:
./utils/install_server.sh
The result information is displayed as follows:
Welcome to the Redis service installer
This script would help you easily set up a running Redis server

Please select the Redis port for this instance: [6379]
Selecting default:6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected Default-/etc/redis/6379.conf
Please select the Redis log file name [/var/log/redis_6379.log]
Selected Default-/var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected Default-/var/lib/redis/6379
Please select the Redis executable path [/usr/local/bin/redis-server]
Selected Config:
port:6379
Config File:/etc/redis/6379.conf
Log File:/var/log/redis_6379.log
Data dir:/var/lib/redis/6379
Executable:/usr/local/bin/redis-server
Cli executable:/USR/LOCAL/BIN/REDIS-CLI
Is this OK? Then press ENTER to go on or ctrl-c to abort.
copied/tmp/6379.conf =/etc/init.d/redis_6379
Installing service ...
Successfully added to chkconfig!
Successfully added to Runlevels 345!
Starting Redis Server ...
Installation successful!

Redis Service View, open, close:
A. Viewing the Redis process with the Ps-ef|grep redis command
B. Enable Redis service operation via/etc/init.d/redis_6379 Start command, also available via (Service redis_6379 start)
C. Turn off Redis service operation via/etc/init.d/redis_6379 Stop command, also available through (Service redis_6379 stop)

configuration information for redis.conf
1, daemonize If you need to run in the background, change the item to Yes
2, pidfile configuration of multiple PID address default in/var/run/redis.pid
3, bind bind IP, set only accept requests from this IP
4, port listening ports, the default is 6379
5, LogLevel divided into 4 levels: Debug verbose notice warning
6, logfile used to configure the log file address
7, databases set the number of databases, the default database used is 0
8, save set the frequency of Redis database mirroring.
9, rdbcompression in the mirror backup, whether to compress
10. dbfilename Image backup file filename
11, Dir database image backup file placement path
12, Slaveof set the database for other databases from the database
13. Password verification required for Masterauth primary database connection
14, Requriepass set login need to use password
15, MaxClients limit the number of simultaneous use of customers
16. MaxMemory set the maximum memory that Redis can use
17, AppendOnly open Append only mode
18, Appendfsync Set the frequency of the Appendonly.aof file synchronization (the second way to back up the data)
19, vm-enabled whether to turn on virtual memory support (the parameters at the beginning of the VM are configured virtual memory)
20. Vm-swap-file set the swap file path for virtual memory
21. Vm-max-memory set the maximum physical memory size used by Redis
22. Vm-page-size set the page size of virtual memory
23. Vm-pages set the total page number of the swap file
24. Vm-max-threads set the number of simultaneous threads used by VM IO
25, Glueoutputbuf the small output cache to store together
26, Hash-max-zipmap-entries set the critical value of hash
27, Activerehashing re-hash

177 # dbid is a number between 0 and ' databases '-1
 178 Databases 16

Discover Redis has 16 libraries in the Redis database configuration file, view process methods Ps-ef|grep plus Apache or Redis

Ps-ef|grep Redis
Root     11646     1  0 00:48?        00:00:00/usr/local/bin/redis-server 127.0.0.1:6379
root     12019 10530  0 01:03 pts/0    00:00:00 grep-- Color=auto Redis

After installing my Redis directory in: User/local/bin

Follow this tutorial to install success, respecting the author: http://www.cnblogs.com/web424/p/6796993.html

This is just to install the Redis service, also need PHP to open the Redis extension, let PHP connect to Redis, see here http://www.cnblogs.com/hanshuai0921/p/7092081.html

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.