Ubuntu install redis

The first:

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

The latest documentation 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, the compiled redis server 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 In the src directory:

start the redis service below.

$ cd src
$ ./redis-server
Note that the default configuration is used to start redis in this way. You can also tell redis to use the specified configuration file to start with the following command through the startup parameter.

$ 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"

recommends the
  second:
To install Redi on Ubuntu system, you can use the following command:

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

$ redis-server
Check if redis is started?

$ redis-cli
The above command will open the following terminal:

redis 127.0.0.1:6379>
127.0.0.1 is the local IP, 6379 is the redis service port. Now we enter the PING command.

redis 127.0.0.1:6379> ping
PONG The
above shows that we have successfully installed redis.






/etc/init.d/redis-server stop
/etc/init.d/redis-server start
/etc/init.d/redis-server restart

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326172082&siteId=291194637