Version 5.0.0 and above is strongly recommended. Because cluster building is convenient !!!!

download

Linux download download. Redis. IO/releases/re…

Installation under Linux

Install the GCC environment. (This step can be omitted. CentOS has the C language environment by default.)

[root@linux02 redis-3.0.0]# yum install gcc-C ++Copy the code

Upload the downloaded Redis source package to the Linux server and unzip it

[root@linux02 ~]# tar -zxf redis-3.0.0.tar.gz
Copy the code

Compile the Redis source code, go to the redis-3.0.0 directory, execute the compile command

Make MALLOC=libc [root@linux02 redis-5.0.3]# makeCopy the code

To install Redis, specify the installation path using PREFIX. Note: if there is no path, the default is to compile to the current directory into the SRC directory for installation.

Note: After the compilation and installation are complete, the installation directory has only one bin directory. You go to this layer and it automatically generates a bin directory and then redis-server

CD SRC make install PREFIX = / usr/local/software/redis - 5.0.3 /Copy the code

Modifying configuration files You are advised to create a conf folder for storing configuration files

makedir conf
cp redis.conf  conf/

vim redis.conf


makedir conf
cp redis.conf  conf/

vim redis.conf
Copy the code
# 1. Redis does not run as a daemon by default. This configuration item can be modified by using yes to enable daemonize. Pid # 3. When running as a daemon, Redis writes pid to /var/run/redis. Pid # 3. The default port is 6379. In my blog post, I explained why I chose 6379 as the default port, because 6379 is the number corresponding to MERZ on the phone keys, which is named after The Italian singer Alessia MERZ. Port 6379 # 4. Redis supports four log levels: debug, verbose, notice, and warning. The default value is verbose loglevel verbose # 7. The logging mode is standard output by default. If Redis is configured to run in daemon mode and the logging mode is set to standard output, The log will be sent to the/dev/null logfile/opt/cachecloud/logs/redis_6379 log # 11. Dump. RDB # dbfilename Dump. RDB # 12. Specify the local database storage directory dir/opt/cachecloud/data / 6379 # 13. If the host is Slav, set the IP address and port of the master service. When Redis starts, it will automatically synchronize data from the master. Slav service connection password # masterauth <master-password> # 15 when master is password protected If a Redis connection password is configured, the client will need to provide the password through AUTH <password> when connecting to Redis. By default, # requirepass foobared # 19 is disabled. Specify the update log file name, The default value is appendone.aof appendfilename appendonly_6379.aof # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # cluster # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # open cluster cluster - enabled yes # cluster configuration files, generated automatically, Conf # cluster-config-file nodes-6379.conf # cluster-node-timeout 15000Copy the code

Redis start

./redis-server .. /redis.configCopy the code