Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Redis installation


May 16, 2021 Redis


Table of contents


Redis installation

Installation under Window

Download address: https://github.com/dmajkic/redis/downloads.

Redis supports 32bits and 64bits, depending on your situation. T his tutorial names the 64bit content cp to the custom disc mount directory redis. e.g. C: s redis

Open a cmd window Use the cd command to switch the directory to C:\redis running redis-server.exe redis.conf. ( If you download the Redis-x64-3.2.100 version, it is redis-server.exe redis.) windows .conf)

If you want to be convenient, you can add the path of redis to the environment variables of the system, so that you can save the loss path, the redis.conf can be omitted later, if omitted, the default is enabled. A fter entering, the following interface is displayed:

Redis installation

At this time open another cmd window, the original do not close, otherwise you will not be able to access the service side.

Switch to the redis-cli .exe -h 127.0.0.1 -p 6379.

Set the key value to set myKey abc

Remove the key value to get myKey

Redis installation


Installed under Linux

Download address: Http://redis.io/download download the latest version of the document.

The latest document version of this tutorial is 2.8.17, download and install:

$ wget http://download.redis.io/releases/redis-2.8.17.tar.gz
$ tar xzf redis-2.8.17.tar.gz
$ cd redis-2.8.17
$ make

After make, the compiled redis service program redis-server appears in the redis-2.8.17 directory, and the client program redis-cli for testing is located in the src directory in the installation directory.

Start the redis service below.

$ cd src
$ ./redis-server

Note that starting redis this way uses the default configuration. Y ou can also tell redis to start using the following command using the specified profile by starting the parameters.

$ ./redis-server redis.conf

redis.conf is a default profile. We can use our own profiles as needed.

After you start the redis service process, you can use the test client program redis-cli to interact with the redis service. Like what:

$ cd src
$ ./redis-cli
redis> set foo bar
OK
redis> get foo
"bar"

Installed under Ubuntu

Installing Redi on the Ubuntu system can use the following commands:

$sudo apt-get update
$sudo apt-get install redis-server

Start Redis

$redis-server

See if redis starts?

$redis-cli

The above command opens the following terminal:

redis 127.0.0.1:6379>

127.0.0.1 is the camera IP and 6379 is the redis service port. Now let's enter the PING command.

redis 127.0.0.1:6379> ping
PONG

The above indicates that we have successfully installed redis.