如何在与 ubuntu 中的默认端口 6379 不同的端口上启动 redis-server [英] How to start redis-server on a different port than the default port 6379 in ubuntu

查看:39
本文介绍了如何在与 ubuntu 中的默认端口 6379 不同的端口上启动 redis-server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在与 Ubuntu 中默认端口 6379 不同的端口上启动 redis-server?我已使用以下步骤安装 redis:

How to start redis-server on a different port than the default port 6379 in Ubuntu? I have used the following steps to install the redis:

sudo add-apt-repository ppa:rwky/redis
sudo apt-get update
sudo apt-get -y install redis-server

我安装了它,但我不知道如何在与默认端口 6379 不同的端口上启动 redis-server.那么请告诉我将默认端口更改为不同端口的步骤?

I installed it, but I don't know how to start redis-server on a different port than the default port 6379. So kindly tell me the steps to change the default port to different port?

推荐答案

redis-server --port 6380 将启动一个监听 6380 端口的 Redis 服务器.

redis-server --port 6380 will start a Redis server listening to port 6380.

redis-cli -p 6380 -- 这里也是一个建议 -- 不会启动侦听端口 6380 的 Redis 服务器,而是尝试连接 CLI到侦听该端口的(希望正在运行的)Redis 服务器.

redis-cli -p 6380 -- a suggestion made here as well -- does not start a Redis server listening to port 6380, but tries to connect the CLI to a (hopefully running) Redis server that listens to that port.

这篇关于如何在与 ubuntu 中的默认端口 6379 不同的端口上启动 redis-server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆