Redis learning and application record-introduction and installation (1)

Source: Internet
Author: User
Tags install redis

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.