最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時(shí)間: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

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

注意

在redis3.2之后,redis增加了protected-mode,在這個(gè)模式下,即使注釋掉了bind 127.0.0.1,再訪問redisd時(shí)候還是報(bào)錯(cuò),如下

(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中常見的幾種集群部署方案,文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-03-03
  • 詳解Redis如何多規(guī)則限流和防重復(fù)提交

    詳解Redis如何多規(guī)則限流和防重復(fù)提交

    市面上很多介紹redis如何實(shí)現(xiàn)限流的,但是大部分都有一個(gè)缺點(diǎn),就是只能實(shí)現(xiàn)單一的限流,但是如果想一個(gè)接口兩種規(guī)則都需要滿足呢,使用本文就來介紹一下redis實(shí)現(xiàn)分布式多規(guī)則限流的方式吧
    2023-12-12
  • 如何打造redis緩存組件

    如何打造redis緩存組件

    文章介紹了如何使用熱插拔AOP、反射、Redis自定義注解和SpringEL表達(dá)式來打造一個(gè)優(yōu)雅的Redis緩存組件,通過這種方式,可以重構(gòu)和簡化緩存代碼,并提供了Redis配置和自定義注解的詳細(xì)說明,文章還包含了AOP測試的總結(jié),并鼓勵(lì)讀者參考和支持
    2024-12-12
  • Redis緩存高可用集群詳解

    Redis緩存高可用集群詳解

    Redis集群提供了哨兵模式和高可用集群模式兩種方案,前者適合低并發(fā),配置復(fù)雜,主從切換可能導(dǎo)致瞬斷;后者通過多主多從結(jié)構(gòu)提高可用性和性能,支持線性擴(kuò)展,配置簡單,搭建Redis集群至少需要三個(gè)主節(jié)點(diǎn)
    2024-10-10
  • redis-copy使用6379端口無法連接到Redis服務(wù)器的問題

    redis-copy使用6379端口無法連接到Redis服務(wù)器的問題

    這篇文章主要介紹了redis-copy使用6379端口無法連接到Redis服務(wù)器的問題的相關(guān)資料,需要的朋友可以參考下
    2023-05-05
  • windows上修改redis端口號的操作步驟

    windows上修改redis端口號的操作步驟

    redis是一個(gè)開源的內(nèi)存數(shù)據(jù)結(jié)構(gòu)存儲系統(tǒng),常用做數(shù)據(jù)庫、緩存和消息代理,默認(rèn)的端口號為6379,那么如何在windows上修改redis端口號,接下來本文給大家詳細(xì)介紹了windows上修改redis端口號的操作方法,需要的朋友可以參考下
    2024-02-02
  • 緩存替換策略及應(yīng)用(以Redis、InnoDB為例)

    緩存替換策略及應(yīng)用(以Redis、InnoDB為例)

    本文以Redis、InnoDB為例給大家講解緩存替換策略及應(yīng)用,本文給大家提到五種置換策略,通過實(shí)例代碼給大家介紹的非常詳細(xì),需要的朋友參考下吧
    2021-07-07
  • Redis哨兵模式介紹

    Redis哨兵模式介紹

    這篇文章介紹了Redis哨兵模式,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-02-02
  • 解決Redis報(bào)錯(cuò)MISCONF?Redis?is?configured?to?save?RDB?snapshots

    解決Redis報(bào)錯(cuò)MISCONF?Redis?is?configured?to?save?RDB?snap

    這篇文章主要給大家介紹了關(guān)于如何解決Redis報(bào)錯(cuò)MISCONF?Redis?is?configured?to?save?RDB?snapshots的相關(guān)資料,文中通過代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-11-11
  • 利用Redis如何實(shí)現(xiàn)自動(dòng)補(bǔ)全功能

    利用Redis如何實(shí)現(xiàn)自動(dòng)補(bǔ)全功能

    這篇文章主要給大家介紹了關(guān)于如何利用Redis如何實(shí)現(xiàn)自動(dòng)補(bǔ)全功能的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用Redis具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-09-09

最新評論

澄城县| 江川县| 井陉县| 马边| 桂林市| 安阳县| 榆社县| 襄垣县| 衡水市| 岳池县| 来凤县| 九江县| 平湖市| 西乌珠穆沁旗| 定兴县| 阿图什市| 察雅县| 自治县| 罗平县| 兰州市| 平武县| 宣恩县| 本溪市| 布拖县| 潢川县| 廊坊市| 上饶县| 肃宁县| 宁阳县| 天津市| 正蓝旗| 广南县| 含山县| 嘉黎县| 金门县| 陇西县| 东阳市| 富宁县| 锡林浩特市| 城步| 乐安县|