Redis is an open-source distributed cache framework. It is often understood as a data structure server because it contains a wide range of data types, such as list, set, sortedset, and hashes. The full name of redis is remote dictionary server (Remote Data Dictionary server ).
Redis has many application scenarios. It can replace web sessions and store a large amount of data (cache) that requires quick access. It can be used to implement message queues and serve as a shared data platform in distributed computing. This section describes how to install apsaradb for redis. Install redis in Linux and Windows 64-bit environments.
Installation in Linux:
1. Download The redis installation package. Go to the redis official download page (http://redis.io/download) to download the latest installation package. The installation package includes the stable version and beta version. We recommend that you download the stable version.
2. Unzip the installation package. If the installation package is downloaded to/home/root/download, run the following command:
1 [[email protected] ~]# cd /home/sam/Downloads/ 2 [[email protected] Downloads]# tar -zxvf redis-2.8.17.tar.gz
3. Go to the redis project folder, compile and install redis.
1 [[email protected] Downloads]# cd redis-2.8.172 [[email protected] Downloads]# make
The GCC compiler is required for installation. If the prompt "cc command cann't be found" is displayed, install the GCC compiler.
[[email protected] Downloads]# yum install gcc
4. Install redis in the/usbin directory.
[[email protected] Downloads]# make install
Now, redis is successfully installed. Run the following command to start the redis service.
[[email protected] ~]# redis-server
After the redis service is started, for example:
5. Test the service by running the redis-CLI command.
[[email protected] ~]# redis-cli set user 001OK[[email protected] ~]# redis-cli get user"001"[[email protected] ~]#
The test is correct. redis is successfully installed.
Install redis in Windows 64bit Environment
Redis itself does not support the window system, but the Microsoft Open Source Technical Committee has developed a project to support redis. Download please click here https://github.com/MSOpenTech/redis
Download the source code, you can use Visual Studio for compilation, I provide a compiled version here in the 360 cloud disk, please click here to download the http://yunpan.cn/cgwBqvCUA7uVp (extraction code: 3e37 ).
The installation procedure is as follows:
1. Download the ZIP file and decompress it to the specified directory (such as D: \ redis-2.8.17 ).
2. Start DOS window-> Run-> Enter cmd and press enter to enter the redis installation directory.
C:\Users\Sam> D:D:> cd D:\redis-2.8.17
3. Start redis server.
D:\redis-2.8.17> redis-server.exe
After startup
4. Test the redis service.
In the doscommand window, enter the redisinstallation directory and use redis-cli.exe for testing.
C:\Users\Sam>d:D:\>cd redis-2.8.17D:\redis-2.8.17>redis-cli.exe set text helloOKD:\redis-2.8.17>redis-cli.exe get text"hello"D:\redis-2.8.17>
Redis is successfully installed in windows. To register redis as a Windows Service, run the following command.
redis-server.exe --service-install redis.windows.conf --loglevel verbose
After successful registration, you can see the following services in window service. Set the apsaradb for redis service to automatically start. You do not need to manually start the apsaradb for redis service in the future.
The next section describes common commands of apsaradb for redis.
Redis learning and application record-introduction and installation (1)