Version: 4.0.2
: Https://redis.io/download
Offline Version:
Installation process:
Source Code compilation:
wget http://download.redis.io/releases/redis-4.0.2.tar.gztar xzf redis-4.0.2. TAR.GZCD Redis -4.0.2 make
You can make the install to a specified location, such as
Make install Prefix=/usr/local/redis
If not installed to the specified location, then the program by default where the SRC folder
Start Redis Service
. /redis-server
Note this way of starting Redis is using the default configuration. You can also tell Redis to start with the following command using the specified configuration file through the startup parameters.
. /redis-server redis.conf
Redis.conf is a default configuration file. We can use our own configuration files as needed. The configuration file is placed under the root directory.
By default, Redis is not running in the background, we need to run Redis in the background
Vim redis.conf# Change the value of daemonize to Yes
Client connections
.
#或者
Telnet 127.0.0.1 6379
To stop a Redis instance
./REDIS-CLI shutdown
#或者
Pkill Redis-server
Let Redis boot
vim/etc/rc.local# joins /usr/local/redis/bin/redis-server/usr/local/redis/etc/redis-conf# Note that the above file path should be changed to the actual path
About Redis comes with tools
- Note: To know what parameters each tool requires, you can add the-H parameter later
- Redis-benchmark:redis Performance Testing Tools
- Redis-check-aof: Tools to check AOF logs
- Redis-check-dump: Tools to check RDB logs
- REDIS-CLI: Client for connection
- Redis-server:redis Service Process
Configuration common items for Redis
- Daemonize: If you need to run in the background, change the value of the item to Yes
- Pdifile: Put PID file in/var/run/redis.pid, can be configured to other address
- Bind: Specifies that Redis receives only requests from that IP, and if not set, all requests are processed and it is best to set the item in the production process
- Port: Listening ports, default is 6379
- Timeout: Time-out when setting client connections in seconds
- LogLevel: Grades are divided into 4 levels, debug,revbose,notice and warning. General open notice under production environment
- LogFile: Configure the log file address, which is printed on the port of the command line terminal by default using standard output
- Database: Set the number of databases, the default database used is 0
- Save: Set the frequency of Redis for database mirroring
- Rdbcompression: Whether to compress during a mirrored backup
- Dbfilename: File name for mirrored backup files
- Dir: path to file placement for database mirroring backups
- Slaveof: Set the database to be a slave database for other databases
- Masterauth: When the primary database connection requires password authentication, set it here
- Requirepass: Set the password to be used before any other specified client connection is made
- MaxClients: Limit the number of simultaneous clients
- MaxMemory: Set the maximum memory that Redis can use
- AppendOnly: When AppendOnly mode is turned on, Redis appends each received write to the appendonly.aof file, and when Redis restarts, the previous state is recovered from the file
- Appendfsync: How often to set the appendonly.aof file for synchronization
- Vm_enabled: Whether to turn on virtual memory support
- Vm_swap_file: Set the path of the swap file for virtual memory
- Vm_max_momery: Set the maximum amount of physical memory that Redis will use when virtual memory is turned on, default is 0
- Vm_page_size: Setting the size of virtual memory pages
- Vm_pages: Set the total page number of the swap file
- Vm_max_thrrads: Set the number of simultaneous threads used by VM IO
Apt Source mode installation:
sudo apt-get install Redis-server
Reference:
Http://www.runoob.com/redis/redis-install.html
Http://www.cnblogs.com/it-cen/p/4295984.html
Ubuntu 16.04 Installation Redis