Redis Summary-Redis installation, redis summary Installation
Redis needs to be used in recent projects. We will record the installation of Redis and how to use Redis in. NET within the past two days.
Redis is a widely used Key/Value memory database. At present, Sina Weibo, Github, StackOverflow, and other large applications use it as the cache, which is similar to Memcached. However, it supports data persistence and completely loses data after power disconnection. It also supports more types. In addition to strings, it also supports lists (linked list), sets (SET), and zsets (sorted set) data types.
The official Redis website is http://redis.io /.
1. Install Redis
Redis installation is very simple, and Redis is not dependent on other environments and standard libraries, so it is easy to get started. This may be one of the reasons for its popularity. For the convenience of the test, all tests are performed in windows. Download Redis for Windows.
Redis. windows. conf is the configuration file of redis.
Redis-server.exe server side.
Redis-cli command line client.
Redis-benchmark: Redis performance testing tool to test the read/write performance of Redis in your system and your configuration.
2. Start the service
Enter the following command in the command line: redis-server redis. windows. conf.
You can also save the command as the file startup. bat, which can be started directly next time.
If you are prompted that the redis-server is not an internal command. Add the directory to the environment variable.
3. redis-related configuration
1. port number, for example, 6379
2. Access address bound to the bind instance 127.0.0.1
3. requirepass Password
4. Remember to open this configuration node for maxheap. Otherwise, the redis service cannot be started. For example, maxheap 1024000000
5. timeout: Request timeout
6. logfile: Location of the log file
7. databases: number of databases Enabled
8. dbfilename: Data snapshot file name (only file name, excluding directory)
4. connection test
Enter the following command in the command line: redis-cli-h 127.0.0.1-p 6379
The parameters are host and port respectively. If the password is set, you must add-a 123456,123456 as the logon password. Otherwise, you will be prompted that you do not have the permission to log on to the system.
As shown in.