Redis is an open source API that is written in ANSI C, supports the web, can be persisted in memory, key-value databases, and provides multiple languages.
Redis is a member of the NoSQL technology camp.
When it comes to NoSQL, what is NoSQL?
NoSQL is a new type of database, not just SQL, which is not like a relational database,--sql by a common operating language, and each NoSQL database has its own API and syntax.
Redis Official website: https://redis.io/
Chinese Civil Service Network: http://redis.cn/
After introducing Redis, the following details the construction of the REDIS environment:
The latest version of Redis is 4.0, but the stable version is 3.2. We use 3.2 as an example.
1. Download
wget http://download.redis.io/releases/redis-3.2.8.tar.gz
2. Unzip
TAR-ZXVF redis-3.2.8.tar.gz
3. Copying
Put it in the/usr/local/directory (pure personal habits)
sudo mv./redis-3.2.8/usr/local/redis/
4. Go to the Redis directory
cd/usr/local/redis/
5. Build
sudo make
6. Testing
sudo make test
7. Installation
The tutorial I saw in this step says it will be installed in the/usr/bin/directory, but I run it in the/usr/local/bin/directory
sudo make install
8. The installation is completed into the installation directory can be seen as follows:
which
-
- Redis-server Redis Server
- REDIS-CLI Redis command-line Client
- Redis-benchmark Redis Performance Testing Tool
- Redis-check-aof aof File Repair Tool
- Redis-check-rdb RDB File Retrieval Tool
9. Configuration
The extracted Redis folder has the original file of the configuration file: redis.conf
You can copy this file to another location, and then copy the file for modification.
Here, we copy to/etc/redis/
sudo cp/usr/local/redis/redis.conf/etc/redis/
At this point, Redis installation is complete, the following is the Redis configuration
Above we have copied a redis default profile under/etc/redis/, we can modify this profile, and then start the Redis service through this configuration file.
Describes several core configuration items:
Bind IP:
Bind 127.0.0.1
IP here if you want to remotely access, write the destination IP
Port:
Port 6379
6379 is the default port number for Redis
Whether to run as daemon:
Daemonize Yes
The value can be yes or no, if run as daemon, it will not block at the command line, similar to the service, if run as a non-daemon, it will block at the current terminal
Data files
Dbfilename Dump.rdb
The name of the data file
Data-piece Storage path
Dir/var/lib/redis
A. Part of a blog
Logfile/var/log/redis/redis-server.log
Database, with 16 default
Database 16
The above is a few common configuration items, as well as detailed configuration item information can refer to http://blog.csdn.net/ljphilp/article/details/52934933, which is detailed in this blog post.
Installation and configuration of Redis under Linux