当前位置:网站首页>Linux environment redis complete configuration and startup command
Linux environment redis complete configuration and startup command
2022-07-29 15:48:00 【Flying Peppa】
1、redis.conf文件 需要改动的地方
(1)bind 86.10.113.8 here is your own address
################################## 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
边栏推荐
猜你喜欢
随机推荐
自动化配置SSH免密登录和取消SSH免密配置脚本
如何检测出你们安装的依赖是否安全
走高质量、可持续的保障亿万家庭之路 水滴公司发布2020·2021ESG报告
cmake(14):利用set_property命令设置全局属性
Shell script programming - operation
Micro combat | centralized configuration service center Config asymmetric encryption and security management
CNCF Keith Chan:分布式云时代,云原生社区的发展与趋势
Flink SQL Hudi 实战
腾讯云数据库负责人林晓斌借1亿炒股:已爆仓破产
【 LeetCode 】 121. The best time to buy stocks
NLP自然语言处理-机器学习和自然语言处理介绍(三)
Unable to open the source file in qt vs2015 "QtWidgets" solution
国内EDA领导者芯和半导体完成最新一轮超亿元融资
LeetCode·每日一题·593.有效的正方形·数学
【微信小程序】组件使用及属性参考
从通信延伸到全行业,亚信科技AntDB 7.0蓄势待发
Why does APP use the JSON protocol to interact with the server: serialization related knowledge
Altair SimSolid complex assembly meshless rapid structure simulation online seminars
Mobileye展示与Intel合作开发的硅光子激光雷达芯片
I/O代码实践









