Redis cluster _ 1. redis installation, redis cluster _ 1. redis
Redis introduction:
Redis is a high-performance key-value storage system. Similar to Memcached, But it supports more storage value types, including string, list, set, and zset ). 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 also 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 keyvalue storage such as memcached, and can play a good complementary role in relational databases in some cases.
System Environment: CentOS 6.5 mini
Software Version: redis-2.8.19
1. Install redis
1: Install related dependency packages
# Yum-y install gcc make
2: Install redis
# Cd/main/
# Tar zxvf redis-2.8.19.tar.gz
# Music redis-2.8.19/redis/
# Cd redis/
# Make & make install
After redis is installed, the following executable files will be found in the/main/redis/src directory:
Mkreleasehdr. sh
Redis-benchmark
Redis-check-aof
Redis-check-dump
Redis-cli # redis-cli is used to enter the Redis Client
Redis-sentinel # Start the sentinel Service
Redis-server # Start the Redis Service
3. modify the configuration file
# Mkdir/main/redis/logs
# Vi/main/redis. conf
Daemonize yes
Logfile "/main/redis/logs/redis. log"
# Note: Other parameters are configured according to the actual situation. daemonize yes indicates that the service is enabled for the background, so that the current session is not occupied after the service is enabled. Logfile is the path of the specified log.
4: Disable the Firewall
# Service iptables stop
# Chkconfig iptables off
# Disable the firewall or open the corresponding port. Otherwise, the remote connection will fail.
5. Start redis
5.1: Start redis
#/Main/redis/src/redis-server/main/redis. conf
# Note: You must specify a configuration file to start redis. If this parameter is not specified, the default configuration file is loaded.
5.2: View startup status
# Netstat-tunpl | grep 6379
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 4928/redis-server * tcp 0 0 :::6379 :::* LISTEN 4928/redis-server *
Because redis uses port 6379 by default, if the above is displayed, it indicates that redis is successfully started.
6. Set startup.
# Echo "/main/redis/src/redis-server/main/redis. conf">/etc/rc. local
Now redis has been installed