当前位置:网站首页>Linux环境 redis完整配置及启动命令
Linux环境 redis完整配置及启动命令
2022-07-29 14:55:00 【飞翔的佩奇】
1、redis.conf文件 需要改动的地方
(1)bind 86.10.113.8 此处为你自己的地址
################################## MODULES #####################################
# Load modules at startup. If the server is not able to load modules
# it will abort. It is possible to use multiple loadmodule directives.
#
# loadmodule /path/to/my_module.so
# loadmodule /path/to/other_module.so
################################## NETWORK #####################################
# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 loopback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 86.10.113.8
(2) daemonize no 改为 daemonize yes 以后台静默进程启动
################################# GENERAL #####################################
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize yes
(3)protected-mode yes 把yes改为no
# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
#
# When protected mode is on and if:
#
# 1) The server is not binding explicitly to a set of addresses using the
# "bind" directive.
# 2) No password is configured.
#
# The server only accepts connections from clients connecting from the
# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
# sockets.
#
# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
protected-mode yes
2、启动服务
方式一、
重启redis服务
systemctl restart redis.service
设置redis服务为开机自启
systemctl enable redis.service
查看redis是否启动成功
ps aux | grep redis
systemctl status redis
方式二、
启动服务
/usr/local/bin/redis-server /etc/redis/redis.conf
查看redis是否启动成功
ps -ef|grep redis
边栏推荐
- Immediate experience with CTS - | D further promotion application equipment compatibility
- 【 LeetCode 】 88. Merging two orderly array
- APP为什么用JSON协议与服务端交互:序列化相关知识
- 【LeetCode】217. 存在重复元素
- 工作效率-十五分钟让你快速学习Markdown语法到精通排版实践备忘
- 微服务实战|集中配置中心Config非对称加密与安全管理
- NLP自然语言处理-机器学习和自然语言处理介绍(二)
- 【LeetCode】53. 最大子数组和
- arcpy脚本制作arcgis工具箱注意事项
- 《外太空的莫扎特》
猜你喜欢

APP为什么用JSON协议与服务端交互:序列化相关知识

广州市应急管理局发布夏季危化品十大安全风险

数据分析(二)

VMware 16.1软件安装包下载及安装教程

力扣每日一题-第45天-682. 棒球比赛

自定义fingerprint特征
![[yolov7 series two] positive and negative sample allocation strategy](/img/8d/5f04d33b957f3ce58243ea807c1fe2.png)
[yolov7 series two] positive and negative sample allocation strategy

The very city live 丨 being - Unicorn: towards the unification of target tracking (ECCV2022 Oral)

深度卷积生成对抗网络

LeetCode·739.每日温度·递减栈
随机推荐
Numpy
这 6 款在线 PDF 转换工具,得试
令人难以置信的DeepMind数据库现在包括了科学界已知的几乎所有蛋白质
Learning Policies for Adaptive Tracking with Deep Feature Cascades全文翻译
一文详解8086微处理器系统结构
【 LeetCode 】 350. The intersection of two arrays. II
正则、grep/egrep、sed、awk
换掉 UUID,更快、更安全!
深陷盈利困境,“寒冬”中也要二次递表,北森上市迫切
第十九届同济大学程序设计竞赛暨高校网络友谊赛 G-归零(可持久化权值线段树)
Generate Class bytecode files with Asm
如何在MySQL中执行SQL?
NLP自然语言处理-机器学习和自然语言处理介绍(三)
Instant Messaging - New Software that Changes Social and Work Status
详解微处理器CPU的系统结构
用Asm生成Class字节码文件
求教一下 现在最新版的flinkcdc能获取到oracle的ddl变更信息吗?
图斑自上而下,自左而右顺序编码,按照权属单位代码分组,每组从1开始编码
AOP implementation enterprise API access interface monitoring (via Google Guava cache data)
软件测试架构师的工作日常