当前位置: 首页 > news >正文

【Redis】Redis安装

Redis安装

apt install redis -y

修改 /etc/redis/redis.conf

  • 修改 bind 127.0.0.1bind 0.0.0.0
  • 修改 protected-mode yesprotected-mode no
1 # By default, if no "bind" configuration directive is specified, Redis listens
2 # for connections from all the network interfaces available on the server.
3 # It is possible to listen to just one or multiple selected interfaces using
4 # the "bind" configuration directive, followed by one or more IP addresses.
5 #
6 # Examples:
7 #
8 # bind 192.168.1.100 10.0.0.1
9 # bind 127.0.0.1 ::1
10 #
11 # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
12 # internet, binding to all the interfaces is dangerous and will expose the
13 # instance to everybody on the internet. So by default we uncomment the
14 # following bind directive, that will force Redis to listen only into
15 # the IPv4 loopback interface address (this means Redis will be able to
16 # accept connections only from clients running into the same computer it
17 # is running).
18 #
19 # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
20 # JUST COMMENT THE FOLLOWING LINE.
21 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 # bind 127.0.0.1   # 注释掉这行
23 bind 0.0.0.0     # 添加这行
24
25 protected-mode no # 把 yes 改成 no

控制 Redis 启动

启动 Redis 服务

service redis-server start

停止 Redis 服务

service redis-server stop

重启 Redis 服务

service redis-server restart 

相关文章:

  • ‌加密 vs 电子签名:公钥私钥的奇妙冒险
  • 在SpringBoot项目中策略模式的使用
  • 智能工厂的神经脉络:工业互联网平台架构演进研究
  • ESP8266_AP机械手 第三篇Uniapp遥控器
  • 如何在Vue中实现延迟刷新列表:以Element UI的el-switch为例
  • 行为型:策略模式
  • 零基础设计模式——结构型模式 - 桥接模式
  • 深入理解JavaScript设计模式之原型模式
  • OceanBase数据库从入门到精通(运维监控篇)
  • Qt popup窗口半透明背景
  • Spring AOP 深度解析与实践指南
  • C++项目中调用C#DLL的的方式
  • OpenLayers加载GeoJSON数据
  • 基于Android的个人健康管理系统APP
  • 第7章 C控制语句:分支和跳转
  • TCP协议原理与Java编程实战:从连接建立到断开的完整解析
  • C++ 模板函数深度指南
  • 深入解析Spring Boot与Kafka集成:构建高效消息驱动应用
  • sass三大循环语法
  • 嵌入式开发学习日志(linux系统编程--进程(2))Day28
  • 做网站 用什么语言好/南昌seo外包公司
  • 做网站要sql 数据库名字账号密码/郑州网站制作推广公司
  • 打电话拉客户用网站做广告怎么做 好做吗/网络营销方案的制定
  • wordpress url路由/安卓优化大师app
  • 网站推广流程是/外贸网站建设推广公司
  • 手机网站制作移动高端网站建设/免费网站或软件