Redis 3.2.1從庫啟動報錯"Error condition on socket for SYNC"問題解決一例
redis從庫啟動報錯:
# ./redis-server /data/redis/redis.conf
8890:S 07 May 13:47:38.592 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.1 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 8890
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
8885:S 07 May 13:45:12.779 # Server started, Redis version 3.2.1
8885:S 07 May 13:45:12.779 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
8885:S 07 May 13:45:12.780 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
8885:S 07 May 13:45:12.780 * The server is now ready to accept connections on port 6379
8885:S 07 May 13:45:12.780 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:12.780 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:12.781 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:12.782 # Error condition on socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:13.783 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:13.784 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:13.784 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:13.785 # Error condition on socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:14.786 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:14.787 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:14.787 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:14.788 # Error condition on socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:15.789 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:15.790 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:15.791 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:15.792 # Error reply to PING from master: '-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'
8885:S 07 May 13:45:16.792 * Connecting to MASTER 192.168.140.51:6379
解決方法:
登陸Redis主庫:
將bind 127.0.0.1改為bind 0.0.0.0
protected-mode yes改為no
然後重啟主庫
說明:protected-mode在同時存在如下兩種情況時觸發:
1) The server is not binding explicitly to a set of addresses using the "bind" directive.
2) No password is configured.
# ./redis-server /data/redis/redis.conf
8890:S 07 May 13:47:38.592 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.1 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 8890
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
8885:S 07 May 13:45:12.779 # Server started, Redis version 3.2.1
8885:S 07 May 13:45:12.779 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
8885:S 07 May 13:45:12.780 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
8885:S 07 May 13:45:12.780 * The server is now ready to accept connections on port 6379
8885:S 07 May 13:45:12.780 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:12.780 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:12.781 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:12.782 # Error condition on socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:13.783 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:13.784 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:13.784 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:13.785 # Error condition on socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:14.786 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:14.787 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:14.787 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:14.788 # Error condition on socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:15.789 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:15.790 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:15.791 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:15.792 # Error reply to PING from master: '-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'
8885:S 07 May 13:45:16.792 * Connecting to MASTER 192.168.140.51:6379
解決方法:
登陸Redis主庫:
將bind 127.0.0.1改為bind 0.0.0.0
protected-mode yes改為no
然後重啟主庫
說明:protected-mode在同時存在如下兩種情況時觸發:
1) The server is not binding explicitly to a set of addresses using the "bind" directive.
2) No password is configured.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2153983/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- keepalived啟動報錯解決一例
- 解決MMM啟動監控報錯的問題
- Tomcat啟動報錯:Error starting static Resources解決方法TomcatError
- 解決docker啟動映象報錯:docker: Error response from daemonDockerError
- Uncaught Error: Bootstrap‘s JavaScript requires jQuery報錯問題解決ErrorbootJavaScriptUIjQuery
- MySQL主從複製問題解決一例MySql
- 解決啟動openfeign報錯
- Redis4.0從庫複製報錯"master_link_status:down"處理一例RedisAST
- 解決 Inkscape 報錯 Duplicate 問題
- 反序列 unserialize(): Error 報錯問題Error
- laravel佇列用阿里雲redis叢集報錯問題解決Laravel佇列阿里Redis
- 【Socket】解決UDP丟包問題UDP
- zabbix-server啟動報錯解決Server
- 解決eslint空格報錯等問題EsLint
- 解決Tomcat啟動報錯問題:Failed to destroy end point associated with ProtocolHandler["ajp-nio-8009"]TomcatAIProtocol
- 易優cms系統報錯unserialize(): Error at offset 0 of 1571 bytes_Eyoucms系統報錯問題解決方法Error
- 【Redis】slaveof 報錯 Background transfer errorRedisError
- 解決 Rust WebAssembly 啟動 Web 程式報錯RustWeb
- 安裝vue/cli報錯問題解決Vue
- matplotlib中文報錯問題及解決方案
- MySQL 啟動報錯 error while loading shared librariesMySqlErrorWhile
- ElasticSearch啟動報錯 ERROR: [4] bootstrap checks failedElasticsearchErrorbootAI
- Redis 啟動報錯Address already in useRedis
- mongodb啟動失敗問題解決MongoDB
- 解決ASM無法啟動問題ASM
- hbase啟動失敗問題解決
- Laravel 安裝 voyager 出現的資料庫報錯問題解決Laravel資料庫
- 使用API28報錯問題及解決API
- 主庫到standby報錯解決:Error 12154 received logging on to the standby ORA-12154Error
- 使用 docker-sync 解決 docker for Mac 啟動的虛擬容器程式執行緩慢的問題DockerMac
- 解決syslog伺服器啟動問題伺服器
- npm啟動vue專案報錯error:0308010C:digital envelope routines::unsupported的解決辦法NPMVueErrorGit
- pnpm下載第三方庫問題報錯,求大佬解決NPM
- 瞭解這一點輕鬆解決Oracle資料庫系統報錯問題Oracle資料庫
- iOS自動化測試的那些乾貨:關於appium啟動報錯問題的解決辦法iOSAPP
- 解決linux下redis資料庫overcommit_memory問題LinuxRedis資料庫MIT
- strace解決sqlplus登陸緩慢的問題一例SQL
- jquery-weui微信支付報錯問題解決jQueryUI