Installation and Use of Redis
-- Download from the official website
Http://download.redis.io/releases/redis-3.0.2.tar.gz
(1) Basic installation
-- Extract the downloaded package
/Home/www/redis-3.0.2
-- Install
Make
Error:
Error: jemalloc/jemalloc. h: No such file or directory
-- Solution
Make MALLOC = libc
Cause: jemalloc is the default distributor, and the system does not have jemalloc and only libc
Run make again to complete the installation!
(2) multi-port and multi-instance installation (refer to chapter http://blog.csdn.net/xu470438000/article/details/42971091, which covers the cluster)
Create directory cluster in/home/www/redis-3.0.2
Makedir-p/home/www/redis-3.0.2/cluster
-- Create three folders under this directory
Makedir 6379
Makedir 6380
Makedir 6381
-- Copy the redis. conf file to "6379:
Cp/home/www/redis-3.0.2/redis. conf/home/www/redis-3.0.2/cluster/6379
-- Modify the configuration (only the first two items can be modified currently)
Port 6379
Daemonize yes
Cluster-enabled yes
Cluster-config-file nodes. conf
Cluster-node-timeout 5000
Appendonly yes
-- Copy redis. conf to 6380 and 6381 to modify the port.
Cp/home/www/redis-3.0.2/cluster/6379/redis. conf/home/www/redis-3.0.2/cluster/6380/
Cp/home/www/redis-3.0.2/cluster/6379/redis. conf/home/www/redis-3.0.2/cluster/6381/
-- Start the service
/Home/www/redis-3.0.2/src/redis-server/home/www/redis-3.0.2/cluster/6379/redis. conf
/Home/www/redis-3.0.2/src/redis-server/home/www/redis-3.0.2/cluster/6380/redis. conf
/Home/www/redis-3.0.2/src/redis-server/home/www/redis-3.0.2/cluster/6381/redis. conf
-- View port
Ps-ef | grep redis
-- Connect to database 6380 (command line)
./Redis-cli-h 192.168.5.128-p 6380
Now the installation of multiple ports is complete!
(3) Use the client
Download the Redis DeskTop Manager Client Add New Connection
Name: 192.168.5.128 --- 6380
Host: 192.168.5.128
Port: 6380
Auth: (no value here by default, and a password will be set for security reasons)