将Redis安装到Linux,Ubuntu,Debian,Fedora,CentOS,RedHat

Redis supports different operating system and Linux distributions. We will look how to install and start redis in Linux distributions Ubuntu, Debian, Fedora, CentOS and RedHat in this tutorial.

Redis支持不同的操作系统和Linux发行版。 在本教程中,我们将研究如何在Linux发行版Ubuntu,Debian,Fedora,CentOS和RedHat中安装和启动Redis。

安装Fedora,CentOS,RedHat (Install Fedora, CentOS, RedHat)

We can install redis server on Fedora, CentOS and RedHat with the following yum command.

我们可以使用以下yum命令将Redis服务器安装在Fedora,CentOS和RedHat上。

$ yum install redis -y
将Redis安装到Linux,Ubuntu,Debian,Fedora,CentOS,RedHat_第1张图片 Install Fedora, CentOS, RedHat 安装Fedora,CentOS,RedHat

安装Ubuntu,Debian (Install Ubuntu, Debian)

We can install redis server on Fedora, CentOS and RedHat with the following apt command.

我们可以使用以下apt命令将Redis服务器安装在Fedora,CentOS和RedHat上。

$ apt install redis-server
将Redis安装到Linux,Ubuntu,Debian,Fedora,CentOS,RedHat_第2张图片 Install Ubuntu, Debian 安装Ubuntu,Debian

Redis服务状态 (Redis Service Status)

We can check redis service status with the systemctl status command. The service name of redis in Fedora,CentOS and RedHat is redis in Ubuntu and Debian redis-server

我们可以使用systemctl status命令检查redis服务状态。 Fedora,CentOS和RedHat中redis的服务名称是Ubuntu和Debian redis-server

Fedora,CentOS,RedHat (Fedora, CentOS, RedHat)

$ systemctl status redis
Redis Service Status Redis Service Status Redis服务状态

Ubuntu,Debian (Ubuntu, Debian)

$ systemctl status redis-server

启动服务 (Start Service)

We can start redis service with the systemctl start command like below.

我们可以使用systemctl start命令启动redis服务,如下所示。

Fedora,CentOS,RedHat (Fedora, CentOS, RedHat)

$ systemctl status redis
将Redis安装到Linux,Ubuntu,Debian,Fedora,CentOS,RedHat_第3张图片

Ubuntu,Debian (Ubuntu, Debian)

$ systemctl status redis-server

检查Redis Cli (Check Redis Cli)

By default redis service listen for port TCP 6379 . We can also connect to redis service with the redis-cli tool. Following command will try to connect local redis service with IP address 127.0.0.1

默认情况下,redis服务监听端口TCP 6379。 我们还可以使用redis-cli工具连接到redis服务。 以下命令将尝试连接IP地址为127.0.0.1的本地Redis服务

$ redis-cli
Check Redis Cli Check Redis Cli 检查Redis Cli
LEARN MORE  Redis Cli Tool
了解更多Redis Cli工具

翻译自: https://www.poftut.com/install-redis-linux-ubuntu-debian-fedora-centos-redhat/

你可能感兴趣的:(linux,centos,redis,docker,ubuntu)