您好,登錄后才能下訂單哦!
這篇文章主要介紹“springboot整合linux上的redis時報錯怎么解決”的相關知識,小編通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“springboot整合linux上的redis時報錯怎么解決”文章能幫助大家解決問題。
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
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.
那就在Linux上啟動redis時選擇使用絕對路徑試試,我就是各種嘗試無效后,通過這種方式搞定的!特此記錄,已備查用!
例如我的啟動命令是下面這樣:
[root@localhost fsrm]# /usr/local/redis/bin/redis-server /home/fsrm/文檔/redis.conf
之前怎么改都不生效,可能是啟動時加載了默認redis.conf配置文件,導致不是以自己修改后的配置文件啟動,所以任何改動都是沒有意義的!
下面是Linux下使用redis時幾個常用的命令
[root@localhost]# ps -ef | grep redis //查看redis進程信息 [root@localhost fsrm]# kill -9 XXXX //殺死XXXX端口號對應進程
redis.conf配置文件里的幾個配置項
# bind 127.0.0.1 //注釋掉才能通過外網訪問 daemonize yes //以守護進程啟動 默認時no protected-mode no //取消保護模式 默認時yes開啟
還有就是重啟完redi后,springboot項目也要重啟,否則不生效!
關于“springboot整合linux上的redis時報錯怎么解決”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識,可以關注億速云行業資訊頻道,小編每天都會為大家更新不同的知識點。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。