Redis installation steps (windows and linux)

Install under Windows

Download address: https://github.com/MSOpenTech/redis/releases .

Redis supports 32-bit and 64-bit. This needs to be selected according to the actual situation of your system platform. Here we download the Redis-x64-xxx.zip compressed package to the C drive. After decompression, rename the folder to redis.

 

Open the folder, the contents are as follows:

Open a cmd window and use the cd command to switch directories to C:\redis and run:

redis-server.exe redis.windows.conf

If you want to be convenient, you can add the redis path to the system environment variable, so that you don’t need to enter the path again. The redis.windows.conf in the back can be omitted. If it is omitted, the default will be enabled. After input, the following interface will be displayed:

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

Switch to the redis directory and run:

redis-cli.exe -h 127.0.0.1 -p 6379

Install under Linux

Download address: http://redis.io/download , download the latest stable version.

The latest document version used in 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 is completed, the compiled redis service program redis-server and the client program redis-cli for testing will appear in the redis-2.8.17 directory. The two programs are located in the installation directory src directory:

Start the redis service below.

$ cd src $ ./redis-server

Note that starting redis in this way uses the default configuration. You can also tell redis to use the specified configuration file to start using the following command through the startup parameters.

$ cd src $ ./redis-server ../redis.conf

redis.conf is a default configuration file. We can use our own configuration files as needed.

After starting the redis service process, you can use the test client program redis-cli to interact with the redis service. for example:

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

Guess you like

Origin blog.csdn.net/weixin_42216205/article/details/89174238