Install redis3.2.11 version under Linux
1. Install the compilation environment
Yum install GCC//installation compilation environment
2, to the official website to download Redis
Website address: Https://redis.io/download
3, with the WinSCP tool, the downloaded redis-3.2.11.tar.gz transferred to the Linux server under the OPT directory (OPT is equivalent to window D://software storage of third-party packages)
4. Unzip the tarball into the/user/local/redis directory
tar-zxvf/opt/redis-3.2.11.tar.gz//Decompression redis-3.2.11.tar.gz
MV Redis-3.2.11/usr/local/redis//Cut files into the/usr/local/redis directory
5. Enter the Redis file and compile the file
Cd/usr/local/redis//Enter Redis file
Make//Compile
6. Start the installation
Make Prefix=/usr/local/redis Install//mount to/usr/local/redis
There's a bin file in the Redis directory.
Supplemental NOTE: Redis-benchmark Performance testing tools
Tools for redis-check-aof aof file repair
Redis-check-dump Rdb File Checking tool
REDIS-CLI the command line client
Redis-server Redis Server-initiated
You need to put the bin and redis.conf in the same directory
7, the front-end mode to start Redis (client can not do other operations)
./redis-server//Enter the bin directory, the front-end mode to start Redis
/usr/local/redis/bin/redis-server/usr/local/redis/redis. conf//can also start the first one is to start the Redis server The second is the configuration required to start the server
8. Background mode to start Redis
vim/usr/local/redis/redis.conf//Edit redis.conf, find daemonize change to Yes
./bin/redis-server./redis.conf//Start Redis and reload the configuration file, otherwise the modified file will not take effect
9. Stop Redis
There are two ways of doing this:
(1) Find the Redis process ID and then kill
Ps-ef | grep Redis//Find the process ID of Redis
Kill-9 5836//Kill Redis process based on process ID
(2) Stop with redis command (recommended)
./BIN/REDIS-CLI Shutdown//stop Redis for recommended use
10. Redis Client Connection
./BIN/REDIS-CLI//Client connection to Redis
Test
11. Redis Client Quits
Quit//exit Redis Client
12, set up the firewall, the port is set to trust
Vim/etc/sysconfig/iptables//Edit Firewall
Add content
# Redis Port
-A input-m state--state new-m tcp-p tcp--dport 6379-j ACCEPT //redis default port is 6379
Service iptables restart//restart firewall
13, after configuring the firewall, the external server is still inaccessible, need to configure the redis.conf
(1) The bind 127.0.0.1 is commented out, otherwise the external server cannot access (so that you can arbitrarily access without setting the specific IP)
(2) Set the protection mode to No
Change the Protected-mode to No
Restarting the Redis service will allow you to access the
Linux Common development environment software-redis installation