【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 服务

bash 复制代码
service redis-server start

停止 Redis 服务

bash 复制代码
service redis-server stop

重启 Redis 服务

bash 复制代码
service redis-server restart 
相关推荐
斯普信专业组2 小时前
PostgreSQL高可用集群部署与配置指南
数据库·postgresql
利刃大大2 小时前
【MyBatis】MyBatis操作动态sql && MyBatisGenerator
数据库·sql·mybatis
a努力。2 小时前
美团Java面试被问:Redis集群模式的工作原理
java·redis·后端·面试
一瓢西湖水3 小时前
loader命令导出大批量数据维护SQL
数据库·sql
颜颜yan_3 小时前
时序数据库选型指南:工业物联网时代如何选择数据底座
数据库·物联网·时序数据库
云和数据.ChenGuang3 小时前
Logstash配置文件的**语法解析错误**
运维·数据库·分布式·rabbitmq·jenkins
CICI131414134 小时前
焊接机器人负载能力选择标准
网络·数据库·人工智能
minhuan4 小时前
大模型应用:从交易行为到实时反欺诈:向量数据库驱动的智能风控实践.33
数据库·向量数据库·大模型应用·chromadb数据库
晴天¥4 小时前
Oracle中的安全管理(用户、权限、角色)
数据库·安全·oracle
Jelly-小丑鱼4 小时前
Linux搭建SQLserver数据库和Orical数据库
linux·运维·数据库·sqlserver·oracal·docker容器数据库