ubuntu 16.04 Installation Redis
Way One: Apt installs
The following commands can be used to install Redi in the Ubuntu system:
$sudo apt-get Update
$sudo apt-get install Redis-server
Start Redis
$ redis-server
See if Redis is started.
$ redis-cli
The above command opens the following terminals:
Redis 127.0.0.1:6379>
127.0.0.1 is native IP and 6379 is the Redis service port. Now we enter the PING command.
Redis 127.0.0.1:6379> Ping
PONG
The above indicates that we have successfully installed the Redis.
mode two: Compile the installation
Ensure that the network is unblocked, select a good download work path, and perform the following command to download redis-3.2.6:
sudo wget http://download.redis.io/releases/redis-3.2.6.tar.gz
Extract the file:
sudo tar-zxvf redis-3.2.6.tar.gz
The folder will be generated in the current directory redis-3.2.6, I moved it to the/usr/redis directory:
If you do not have GCC installed, you need to first install:
sudo apt-get install gcc
Enter the redis-3.2.6 directory, followed by the following two commands:
sudo make
sudo make install
is installed under the directory/usr/local/bin:
Now into the previous decompression folder (my/usr/redis), copy the configuration file redis.conf to/etc/redis/, and the VI command to edit the file, "Daemonize No" modified to "daemonize yes", is set to run as a background process, and the modifications are completed to save the exit.
Go to the/usr/local/bin directory and execute the command: (Default port 6379)
redis-server/etc/redis/redis.conf
redis-cli-p 6379
The command ping is then executed, and if the output is Pong, the certificate service starts successfully.
Execute command
Set k1 HelloWorld get
ki
The following information is output:
To perform the Quit command exit, you can now view the process by using the following command:
Ps-ef|grep Redis
Reproduced below from: http://blog.csdn.net/yingxiake/article/details/51469364
. How to stop a server
In the client input Shutdown command, exit the client with exit
How to uninstall the Redis service
Uninstall the Redis service, simply remove the Redis from the/usr/local/bin/directory.
To uninstall the clean, you can also remove the uncompressed and compiled Redis package.
All of this process is done .........