欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Redis3.2開啟遠(yuǎn)程訪問詳細(xì)步驟

 更新時間:2018年03月04日 10:00:08   投稿:wdc  
redis默認(rèn)只允許本地訪問,要使redis可以遠(yuǎn)程訪問可以修改redis.conf

redis默認(rèn)只允許本地訪問,要使redis可以遠(yuǎn)程訪問可以修改redis.conf
 打開redis.conf文件在NETWORK部分有說明

################################## 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 lookback 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 127.0.0.1

使redis可以遠(yuǎn)程訪問只要注釋掉redis.conf配置文件中的 bind 127.0.0.1 即可以使所有的ip訪問redis

若是想指定多個ip訪問,但并不是全部的ip訪問,可以bind多個IP

注意

在redis3.2之后,redis增加了protected-mode,在這個模式下,即使注釋掉了bind 127.0.0.1,再訪問redisd時候還是報錯,如下

(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

解決方法是修改原protected-mode yes為protected-mode no

保存配置文件重啟redis即可

相關(guān)文章

  • Redis?腳本和連接命令示例詳解

    Redis?腳本和連接命令示例詳解

    Redis腳本是一種可以實現(xiàn)復(fù)雜任務(wù)的腳本語言,可以用來快速履行復(fù)雜任務(wù),靈活處理數(shù)據(jù)管理和管理復(fù)雜的利用場景,這篇文章主要介紹了Redis?腳本和連接命令,需要的朋友可以參考下
    2023-09-09
  • Redis過期事件監(jiān)聽器的完整實現(xiàn)步驟

    Redis過期事件監(jiān)聽器的完整實現(xiàn)步驟

    要使用 Redis 過期事件監(jiān)聽器來更新數(shù)據(jù)庫狀態(tài),我們需要確保 Redis 的事件通知已啟用,并實現(xiàn)監(jiān)聽器來捕獲過期的鍵,并根據(jù)需要更新數(shù)據(jù)庫,本文給大家介紹了Redis過期事件監(jiān)聽器的完整實現(xiàn)步驟,需要的朋友可以參考下
    2024-10-10
  • redis中數(shù)據(jù)類型命令整理

    redis中數(shù)據(jù)類型命令整理

    在本篇文章里小編給大家整理的是關(guān)于redis中5種數(shù)據(jù)類型基本命令介紹,需要的朋友們可以學(xué)習(xí)下。
    2020-03-03
  • 在CenOS系統(tǒng)下安裝和配置Redis數(shù)據(jù)庫的教程

    在CenOS系統(tǒng)下安裝和配置Redis數(shù)據(jù)庫的教程

    這篇文章主要介紹了在CenOS系統(tǒng)下安裝和配置Redis數(shù)據(jù)庫的教程,Redis是一個可基于內(nèi)存的高性能NoSQL數(shù)據(jù)庫,需要的朋友可以參考下
    2015-11-11
  • 攔截Redis命令導(dǎo)致的Lua腳本執(zhí)行失敗的問題解決

    攔截Redis命令導(dǎo)致的Lua腳本執(zhí)行失敗的問題解決

    本文主要介紹了攔截Redis命令導(dǎo)致的Lua腳本執(zhí)行失敗的問題解決,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-06-06
  • 寶塔中ThinkPHP框架使用Redis的一系列教程

    寶塔中ThinkPHP框架使用Redis的一系列教程

    關(guān)于redis的安裝,在服務(wù)器或者虛擬機上安裝寶塔面板安裝redis,這樣很簡單就可以使用redis了,記得安裝redis的時候不僅要安裝redis軟件,還要進(jìn)入項目使用的php版本中安裝redis擴展,然后開啟redis軟件
    2023-03-03
  • k8s部署redis集群搭建過程示例詳解

    k8s部署redis集群搭建過程示例詳解

    這篇文章主要為大家介紹了k8s部署redis集群搭建過程示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-02-02
  • 詳解Centos7下配置Redis并開機自啟動

    詳解Centos7下配置Redis并開機自啟動

    本篇文章主要介紹了Centos7下配置Redis并開機自啟動,具有一定的參考價值,感興趣的小伙伴們可以參考一下。
    2016-11-11
  • 一篇文章帶你弄清楚Redis的精髓

    一篇文章帶你弄清楚Redis的精髓

    Redis是一個開源的、支持網(wǎng)絡(luò)、基于內(nèi)存的鍵值對存儲系統(tǒng),它可以用作數(shù)據(jù)庫、緩存和消息中間件。它支持多種數(shù)據(jù)類型,包括字符串、散列、列表、集合、位圖等,擁有極快的讀寫速度,并且支持豐富的特性,如事務(wù)、持久化、復(fù)制、腳本、發(fā)布/訂閱等。
    2023-02-02
  • redis與mongodb的區(qū)別總結(jié)

    redis與mongodb的區(qū)別總結(jié)

    在本篇文章里小編給大家分享的是關(guān)于redis與mongodb的區(qū)別的相關(guān)知識點內(nèi)容,有需要的朋友們參考下。
    2019-06-06

最新評論