1.錯誤代碼沒有貼迈喉,如果出現(xiàn)記得添加gcc包
image.png
2.如果發(fā)現(xiàn)命令行中只能打印出大寫在符號集歇,那么長安【A】就好桶略,或者shift+[A]試試
3.mini安裝Linux發(fā)現(xiàn)連不了網(wǎng),要在配置文件中啟動網(wǎng)關(guān)诲宇,并且設(shè)置自動分配IP地址际歼,如果手動配置IP地址的話開門,可能還是連不上
4.java連接Redis出現(xiàn)錯誤姑蓝,
--------(錯誤原因:1>Linux防火墻默認是開啟的 2>Redis默認是保護模式(綁定到127.0.0.1))
-----如下是錯誤類型:
image.png
image.png
image.png
解決方法:
關(guān)閉防火墻同時關(guān)閉Redis的保護模式
image.png
解除綁定:
image.png
image.png
image.png
解除綁定:
image.png
解除保護模式:
image.png
其實也可以按照java的報錯信息來修改:
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.
翻譯成中文:
DENIED Redis運行在保護模式鹅心,
因為啟用了保護模式,沒有指定綁定地址纺荧,沒有向客戶端請求認證密碼旭愧。
在這種模式下,連接只能從回送接口接受宙暇。如果要從外部計算機連接到Redis输枯,您可以采用以下解決方案之一:
1)只需禁用保護模式,即可通過從同一主機連接到Redis占贫,從回送接口發(fā)送命令“CONFIG SET protected-mode no”正在運行桃熄,
但是如果您這樣做,請勿使用互聯(lián)網(wǎng)公開訪問互聯(lián)網(wǎng)靶剑。使用CONFIG REWRITE使此更改永久蜻拨。
2)或者池充,您可以通過編輯Redis配置文件并將保護模式選項設(shè)置為“no”來禁用保護模式桩引,然后重新啟動服務(wù)器。
3)如果您只是為了測試而手動啟動服務(wù)器收夸,請使用“ - 保護模式否”選項重新啟動服務(wù)器坑匠。4)設(shè)置綁定地址或認證密碼。注:您只需要執(zhí)行上述操作之一卧惜,以便服務(wù)器開始接受來自外部的連接厘灼。
所以連接Redis執(zhí)行:
CONFIG SET protected-mode no
CONFIG REWRITE
Redis的服務(wù)的關(guān)閉方式
image.png
查看是否有Redis進程
----------------$ps -ef|grep redis
image.png