将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
Install Fedora, CentOS, RedHat
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
Install Ubuntu, Debian
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

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值