springboot整合linux上的redis時報錯怎么解決

這篇文章主要介紹“springboot整合linux上的redis時報錯怎么解決”的相關(guān)知識,小編通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“springboot整合linux上的redis時報錯怎么解決”文章能幫助大家解決問題。

10多年的濟陽網(wǎng)站建設(shè)經(jīng)驗,針對設(shè)計、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時及時工作處理。營銷型網(wǎng)站建設(shè)的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整濟陽建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計,從而大程度地提升瀏覽體驗。創(chuàng)新互聯(lián)從事“濟陽網(wǎng)站設(shè)計”,“濟陽網(wǎng)站推廣”以來,每個客戶項目都認真落實執(zhí)行。

如果你在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端口號對應(yīng)進程

redis.conf配置文件里的幾個配置項

# bind 127.0.0.1    //注釋掉才能通過外網(wǎng)訪問
daemonize yes       //以守護進程啟動 默認時no        
protected-mode no   //取消保護模式 默認時yes開啟

還有就是重啟完redi后,springboot項目也要重啟,否則不生效!

關(guān)于“springboot整合linux上的redis時報錯怎么解決”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,小編每天都會為大家更新不同的知識點。

網(wǎng)頁標題:springboot整合linux上的redis時報錯怎么解決
URL地址:http://muchs.cn/article14/ghijge.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司移動網(wǎng)站建設(shè)、網(wǎng)站設(shè)計用戶體驗、手機網(wǎng)站建設(shè)、面包屑導航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)