Ubuntu 16.04 installs Redis in two ways (APT and compiled) and uninstall

Source: Internet
Author: User
Tags download redis install redis
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 .........


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.