linux install redis service

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

This tutorial uses the latest version of the document 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

Redis found in the root directory redis.conf profiles, search requirepass, find passwords comment line, add the following code:

# requirepass foobared
requirepass 123456     //注意,行前不能有空格
 

Will be compiled service program redis redis-server directory make After redis-2.8.17, as well as for testing client program redis-cli, two programs located in the installation directory under the src directory:

The following start redis service.

$ cd src
$ ./redis-server

Note that this redis way to start using the default configuration. You can also tell by redis startup parameters using the specified configuration file using the following command to start. (Plus & start for the background)

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

redis.conf  is a default configuration file. We may need to use its own configuration file.

After starting redis service process, you can use a test client program and redis redis-cli the service interaction. such as:

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

Guess you like

Origin www.cnblogs.com/lingyao/p/11984448.html