์ค๋ฅ : redis1.tfs์ ๋ํ Redis ์ฐ๊ฒฐ์
๋๋ค. tfs : 6379 ์คํจ-์์ผ์ RedisClient.on_error (/var/www/a/b/c/node_modules/redis/index.js:196:24)์์ ECONNRESET์ ์ฝ์ต๋๋ค.
Socket.emit (events.js : 95 : 17)
net.js : 441 : 14์์
/var/www/a/b/c/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
/var/www/a/b/c/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
process._tickDomainCallback์์ (node.js : 486 : 13)
๊ณผ์ ์์.
๋์๊ฒ ์ด๊ฒ์ Node.js ์ธ๋ถ์ ๋คํธ์ํน ๋ฌธ์ ์ฒ๋ผ ๋ค๋ฆฝ๋๋ค.์ด ์ค๋ฅ "ECONNRESET"์ Node.js์ ๋ํ ์๊ฒฉ ์ฐ๊ฒฐ์ด ์์ผ์ ์๊ธฐ์น ์๊ฒ ๋ซ์ ๋ ๋ฐ์ํฉ๋๋ค.
Node์ Redis๊ฐ์ ํ๋ก์๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๊น?
Node / node_redis / Redis ์๋ฒ์ ๋ฒ์ ์ ๋ฌด์์ ๋๊น?
NewRelic ์์ด์ ํธ๊ฐ ๊ด๋ จ๋์ด ์๋์ง ์์ฌ ์ค๋ฝ์ง๋ง ์์ด์ ํธ์์ด ํญ์ ๋ณต์ ๋ฅผ ์๋ํ์ฌ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋๋์ง ํ์ธํ ์ ์์ต๋๋ค. cc / @wraithan
๊ทธ ๋ผ์ธ์ CLS๊ฐํ๋ ์ผ์ ๋๋ค. ๋ ๋ง์ ์ฌํ์ ํตํด New Relic ์์ด์ ํธ๋ฅผ ์์ ํ ๋ฐฐ์ ํ ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ๋๋ ์ด๊ฒ์ด ์ฐ๋ฆฌ์ ์ํ ๊ฒ์ด ์๋๋ผ๊ณ ์๋์ ์ผ๋ก ํ์ ํฉ๋๋ค.
NewRelic ์์ด์ ํธ๋ฅผ ์ ๊ฑฐ ํ๋๋ฐ๋ ๋ฌธ์ ๊ฐ ๊ณ์ ๋ฐ์ํฉ๋๋ค. ๋๋ต. 3 ๋ถ๋ง๋ค์ด ์ถฉ๋์ด ๋ฐ์ํฉ๋๋ค. ์๋๋ ์ฐธ๊ณ ์ฉ ๋ก๊ทธ์ ๋๋ค.
events.js : 72
์ด ๋์ ธ; // ์ฒ๋ฆฌ๋์ง ์์ '์ค๋ฅ'์ด๋ฒคํธ
^
์ค๋ฅ : redis1.tfs์ ๋ํ Redis ์ฐ๊ฒฐ์
๋๋ค. tfs : 6379 ์คํจ
RedisClient.on_error (/var/www/a/b/c/node_modules/redis/index.js:196:24)
์์ผ์์.
Socket.emit (events.js : 95 : 17)
net.js : 441 : 14์์
process._tickDomainCallback์์ (node.js : 486 : 13)
์ค๋ฅ : ์์ํ ๊ฐ์ง ๋ ์คํฌ๋ฆฝํธ๊ฐ ์ฝ๋๋ก ์ข
๋ฃ ๋จ : 8
์ค๋ฅ : ์คํฌ๋ฆฝํธ ๋ค์ ์์ ์๋ # 50
๋ํ Node.JS-v0.10.35, node_redis-0.12.1 ๋ฐ Redis-2.8.4๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
Node.js์์ IP๋ฅผ ํตํด ์ง์ Redis์ ์ก์ธ์คํ๊ณ ์์ต๋๋ค.
๋๋์ด ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์์ง๋ง, ์ด์ ๋ค๋ฅธ ์ด์ ๋ก /etc/hosts
ํ์ผ์ ๊ฐ์ง๊ณ ๋์๋ค๋ ๊ฒ์ ๊นจ๋ฌ์ ํ์ ํด๊ฒฐ๋์์ต๋๋ค. ๋๋ฝ๋์์ต๋๋ค.
127.0.0.1 localhost
@ ayazpasha2434 ์๋ฃจ์ ์ ๋น์ ์๊ฒ ๋์ผํ์ง ์์ ์ ์์ง๋ง ๋ค๋ฅธ ์ฌ๋๋ค์ด ์์ํ๋ ๊ฒ์ฒ๋ผ
@sarathms ๋ด ํธ์คํธ ํ์ผ์์ด ๋งคํ์ด ์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ ๊ฒฝ์ฐ์๋ Redis ์์คํ ์ด ์๊ฒฉ ์์คํ ์ ๋๋ค. ๊ต์ฐจ ํ์ธํ ํ Redis ์ปดํจํฐ์๋ ํด๋น ๋ก์ปฌ ํธ์คํธ ๋งคํ์ด ์์ต๋๋ค. ์ฌ์ ํ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์ง ์์์ต๋๋ค.
๋๋ ๋ํ ๊ฐ์ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์๋ค. ๋ค์์ ์ฝ์ ์ถ๋ ฅ์ ๋๋ค.
events.js : 72
์ด ๋์ ธ; // ์ฒ๋ฆฌ๋์ง ์์ '์ค๋ฅ'์ด๋ฒคํธ
^
์ค๋ฅ : pub-redis-10606.us-east-1-1.1.ec2.garantiadata์ ๋ํ Redis ์ฐ๊ฒฐ. com : 10606 ์คํจ-RedisClient.on_error์์ ECONNRESET ์ฝ๊ธฐ (C : \ Users \ Gigi \ Desktop \ eduknow_api_ver_1authnode_m
odulesredisindex.js : 196 : 24)
์์ผ์์.
Socket.emit (events.js : 95 : 17)
net.js : 441 : 14์์
process._tickCallback์์ (node.js : 442 : 13)
@ ayazpasha2434 ์ด ์ค์ ๋ด ์ค๋ฅ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
client.on ( 'error', function (err) {console.error (err)})
@ ayazpasha2434 @Waterloo ๊ฐ ๋น์ ์๊ฒ ๋ง๋ ๋ต์ ๊ฐ์ง๊ณ ์์ ์ต๋๊น?
๋คํธ์ํฌ ์ฐ๊ฒฐ์ ๋ฌธ์ ๊ฐ์๋ ๊ฒ ๊ฐ๊ณ ๋ ธ๋ redis์ ๋ฌธ์ ๊ฐ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ค๋ฅ ์ฒ๋ฆฌ๊ธฐ๋ฅผ ์ถ๊ฐํ๋ฉด ์ฑ์ด ๋ ์ด์ ์ถฉ๋ํ์ง ์๋๋ก ์ถฉ๋ถํด์ผํฉ๋๋ค (ํญ์ ์ฐ๊ฒฐ๋์ด์ผ ํจ).
์๋ฐ ์๋ฒ์ http (ํฌ์คํธ ์ฌ์ฉ)๋ฅผ ์ฌ๋ฆด ๋์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. {[์ค๋ฅ : ECONNRESET ์ฝ๊ธฐ]
์ฝ๋ : 'ECONNRESET',
์ค๋ฅ ๋ฒํธ : 'ECONNRESET',
syscall : '์ฝ๊ธฐ',
์๋ต : ์ ์๋์ง ์์}
์ค๋ฅ : ECONNRESET ์ฝ๊ธฐ
exports._errnoException (util.js : 856 : 11)
TCP.onread (net.js : 546 : 26)
์ด์ค ์ฝ๋ฐฑ!
POST / user_archives / create / save 500 45.306ms-386
์ค๋ฅ : ECONNRESET ์ฝ๊ธฐ
exports._errnoException (util.js : 856 : 11)
TCP.onread (net.js : 546 : 26)
@ biggu0 ์ด๊ฒ์ด node_redis์ ์ด๋ค ์ฐ๊ฒฐ์ธ์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ECONNRESET ์ ๋ํด ์์ธํ ์์ ๋ณด๋ ค๋ฉด stackoverflow๋ฅผ ์ฐธ์กฐํ์ญ์์ค .
์๋
,
์ฐ๋ฆฌ๋ ๋ํ์ด ๋ฌธ์ ๋ฅผ๋ณด๊ณ ์์ต๋๋ค. redis SNAPSHOTTING ๋๋ฌธ์ผ ์ ์์ต๋๋ค. redis๊ฐ ์ค๋
์ท์ ์ฐ๊ณ ๋์คํฌ ์ฐ๊ฒฐ์ ์ ์ฅํ ๋๋ง๋ค ์ฌ์ค์ ๋ฉ๋๋ค. ์์ ์ ์ฆ๋ช
ํ๊ธฐ ์ํด ์์ฉ ํ๋ก๊ทธ๋จ ๋ก๊ทธ๋ฅผ redis ๋๋ฒ๊ทธ ๋ก๊ทธ์ ๋น๊ตํ๊ณ ํ์ด๋ฐ์ด ์ ํํ ์ผ์นํฉ๋๋ค.
์๋๋ redis.conf์ ์ค๋
์ท ์ค์ ์
๋๋ค.
900 ์ ์ฅ 1
300 10 ์ ์ฝ
60 10000 ์ ์ฝ
์ฐ๋ฆฌ๊ฐ ๋ญ๊ฐ ์๋ชปํ๊ณ ์๋ค๋ฉด ์๋ ค์ฃผ์ญ์์ค.
๋๋ ๋ํ ์์ฃผ ์ฐ๊ฒฐ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค.
RedisClient.emit์ ERR (events.js : 188 : 7)
RedisClient.on_error์ ์ค๋ฅ (/home/vcap/app/node_modules/redis/index.js:394:14)
RedisClient์์ ERR์
๋๋ค.
emitErrorNT์ ERR (net.js : 1281 : 8)
์์ผ์์ ERR.
process._tickCallback์ ERR (๋ด๋ถ / ํ๋ก์ธ์ค /next_tick.js:98:9)
์ค๋ฅ ์ค๋ฅ : XXXXXXXX : XXXXX์ ๋ํ Redis ์ฐ๊ฒฐ ์คํจ-ECONNRESET ์ฝ๊ธฐ
TCP.onread์์ ERR (net.js : 572 : 26)
_combinedTickCallback์ ERR (๋ด๋ถ / ํ๋ก์ธ์ค /next_tick.js:74:11)
emitOne์ ERR (events.js : 96 : 13)
exports._errnoException์์ ERR (util.js : 1022 : 11)
Socket.emit์ ERR (events.js : 188 : 7)
์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด ์๋์ผ๋ก ๋ค์ ์ฐ๊ฒฐ๋ฉ๋๋ค.
์ฐ๊ฒฐ์ด ๋์ด์ง๋ฉด ๋ฌธ์ ๊ฐ ๋ ์ ์์ต๋๋ค.
์๋
ํ์ธ์ ์ํธ๋ฃจ,
์ด ๋ฌธ์ ๋ฃ๋ ์์น client.on ( 'error', function (err) {console.error (err)})
๊ทธ๋ฆฌ๊ณ ๋๋์ด ์ง์ ์ด ๋น์ ์ ์ค๋ฅ๋ฅผ ์๋กํ๊ธฐ ์ํด ๋ค๋ฅธ ๊ฒ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
์ ๋ง ์ฌ์ฉํ ์ ์์ต๋๊น?
์ต๋ํ ๋นจ๋ฆฌ ๋น์ ์ ์๊ฐ์์ฃผ์ญ์์ค.
๋ฏธ๋ฆฌ ๊ฐ์ฌ๋๋ฆฝ๋๋ค !!!
์๋ ํ์ธ์
๋๋ ๊ฐ์ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค
events.js : 160
์ด ๋์ ธ; // ์ฒ๋ฆฌ๋์ง ์์ '์ค๋ฅ'์ด๋ฒคํธ
^
์ค๋ฅ : ECONNRESET ์ฝ๊ธฐ
์ด๊ฒ์ ๋ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
๋๋ ๋ํ์ด ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค. ํํฌ๊ฐ์๋ sails.js ํ๋ ์ ์ํฌ๋ฅผ ์ฌ์ฉํ๊ณ ์์ผ๋ฏ๋ก ๋ ธ๋ ์๋น์ค๋ฅผ ์์ํ ๋ redis ์๋ฒ์ ๋ํ ์ฐ๊ฒฐ์ด ํ๋๋ฟ์ด๋ฏ๋ก ์ ์ญ sails ๊ฐ์ฒด๋ฅผ ์ฌ์ฉํ์ฌ redis์ ์ก์ธ์คํ๊ณ ์์ ํฉ๋๋ค.
redisClient = redis.createClient({
host: redisConfig.host,
port: redisConfig.port,
db: redisConfig.db,
retry_strategy: (retryOptions) => {
if (retryOptions.error && retryOptions.error.code === 'ECONNREFUSED') {
// End reconnecting on a specific error and flush all commands with
// a individual error
return new Error('The server refused the connection');
}
if (retryOptions.total_retry_time > 1000 * 60 * 60) {
// End reconnecting after a specific timeout and flush all commands
// with a individual error
return new Error('Retry time exhausted');
}
if (retryOptions.attempt > 3) {
// End reconnecting with built in error
return undefined;
}
sails.log.debug('Handling redis retry strategy', {
error: retryOptions.error,
totalRetryTime: retryOptions.total_retry_time,
attempt: retryOptions.attempt
});
// Reconnect after
return Math.min(retryOptions.attempt * 100, 3000);
}
});
๋ค์์ ์ค๋ฅ์ ์คํ ์ถ์ ์
๋๋ค.
AbortError : Redis ์ฐ๊ฒฐ์ด ๋์ด์ง๊ณ ๋ช
๋ น์ด ์ค๋จ๋์์ต๋๋ค. RedisClient.flush_and_error (/var/sample-app/node_modules/redis/index.js:362:23)์์ ์ฒ๋ฆฌ๋์์ ์ ์์ต๋๋ค .n RedisClient.connection_gone (/ var / sample-app / node_modules / redis / index. RedisClient.on_error (/var/sample-app/node_modules/redis/index.js:410:10)์์ n ์์ผ .js : 664 : 14) n
๋ ธ๋ ์ฑ์ Docker ์ปจํ ์ด๋์์ ์คํ๋๋ฉฐ EC2 Linux ์ธ์คํด์ค์ ์ค์น๋ Redis ์๋ฒ์ ์ฐ๊ฒฐ๋ฉ๋๋ค.
์ฐ๋ฆฌ๋ ๊ฐ์ ๋ฌธ์ ์ ์ง๋ฉดํ์ง๋ง ์ฌ๊ธฐ์ stunnel ๊ตฌ์ฑ์ ์ฌ์ฉํ์ฌ redis๋ฅผ localhost์ ํ๋ก์ํ๋ stunnel์ ๋ฐฐ์นํ์ต๋๋ค.
fips = ์๋์ค
pid = /var/run/stunnel.pid
๋๋ฒ๊ทธ = 7
์ต์
= NO_SSLv3
์ถ๋ ฅ = /var/log/stunnel.log
[redis-cli]
ํด๋ผ์ด์ธํธ = ์
์๋ฝ = 127.0.0.1:6379
์ฐ๊ฒฐ = redi sendpoint : 6379
๋ ธ๋๊ฐ ๋ช ๋ถ๋ง๋ค ์๋ ์ค๋ฅ๋ก ์ฐ๊ฒฐ์ด ๋์ด์ง๋๋ค. Docker ์ปจํ ์ด๋๋ฅผ ํตํด ์คํํฉ๋๋ค.
127.0.0.1:6379์ ๋ํ Redis ์ฐ๊ฒฐ ์คํจ-ECONNRESET ์ฝ๊ธฐ
TCP.onStreamRead (internal / stream_base_commons.js : 111 : 27)์์
์ค๋ฅ : 127.0.0.1:6379์ ๋ํ Redis ์ฐ๊ฒฐ ์คํจ-ECONNRESET ์ฝ๊ธฐ
TCP.onStreamRead (internal / stream_base_commons.js : 111 : 27)์์
์ค๋ฅ : 127.0.0.1:6379์ ๋ํ Redis ์ฐ๊ฒฐ ์คํจ-ECONNRESET ์ฝ๊ธฐ
TCP.onStreamRead (internal / stream_base_commons.js : 111 : 27)์์
AbortError : Redis ์ฐ๊ฒฐ์ด ๋์ด์ง๊ณ ๋ช
๋ น์ด ์ค๋จ๋์์ต๋๋ค. ์ฒ๋ฆฌ๋์์ ์ ์์ต๋๋ค.
์ด๋ค ํด์๋?
์ฐ๋ฆฌ๋ ๊ฐ์ ๋ฌธ์ ์ ์ง๋ฉดํ์ง๋ง ์ฌ๊ธฐ์ stunnel ๊ตฌ์ฑ์ ์ฌ์ฉํ์ฌ redis๋ฅผ localhost์ ํ๋ก์ํ๋ stunnel์ ๋ฐฐ์นํ์ต๋๋ค.
fips = ์๋์ค
setuid = ๋ฃจํธ
setgid = ๋ฃจํธ
pid = /var/run/stunnel.pid
๋๋ฒ๊ทธ = 7์ต์ = NO_SSLv2
์ต์ = NO_SSLv3
์ถ๋ ฅ = /var/log/stunnel.logํด๋ผ์ด์ธํธ = ์๋์ค
์ ๊ฒฝ = ์
[redis-cli]
ํด๋ผ์ด์ธํธ = ์
์๋ฝ = 127.0.0.1:6379
์ฐ๊ฒฐ = redi sendpoint : 6379๋ ธ๋๊ฐ ๋ช ๋ถ๋ง๋ค ์๋ ์ค๋ฅ๋ก ์ฐ๊ฒฐ์ด ๋์ด์ง๋๋ค. Docker ์ปจํ ์ด๋๋ฅผ ํตํด ์คํํฉ๋๋ค.
127.0.0.1:6379์ ๋ํ Redis ์ฐ๊ฒฐ ์คํจ-ECONNRESET ์ฝ๊ธฐ
TCP.onStreamRead (internal / stream_base_commons.js : 111 : 27)์์
์ค๋ฅ : 127.0.0.1:6379์ ๋ํ Redis ์ฐ๊ฒฐ ์คํจ-ECONNRESET ์ฝ๊ธฐ
TCP.onStreamRead (internal / stream_base_commons.js : 111 : 27)์์
์ค๋ฅ : 127.0.0.1:6379์ ๋ํ Redis ์ฐ๊ฒฐ ์คํจ-ECONNRESET ์ฝ๊ธฐ
TCP.onStreamRead (internal / stream_base_commons.js : 111 : 27)์์
AbortError : Redis ์ฐ๊ฒฐ์ด ๋์ด์ง๊ณ ๋ช ๋ น์ด ์ค๋จ๋์์ต๋๋ค. ์ฒ๋ฆฌ๋์์ ์ ์์ต๋๋ค.์ด๋ค ํด์๋?
๋์๊ฒ๋ ์ด๊ฒ์ด stunnel์ ๋ฌธ์ ๋ผ๊ณ ์๊ฐํฉ๋๋ค.
๋๋ ๋ํ ๊ฐ์ ์ค๋ฅ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค
{ Error: Redis connection to xx.xx.x.x:6379 failed - read ECONNRESET"
at TCP.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read'
๋๋ ๋ํ ์ค๋ฅ ์ฒ๋ฆฌ๊ธฐ๋ฅผ ์ฌ์ฉํ๊ณ ์์ง๋ง ์ ์ด๋ฐ ์ผ์ด ๋ฐ์ํ๋์ง, ์ฟผ๋ฆฌ ํธ์ถ์ ์ํฅ์ ๋ฏธ์น๊ณ ๋ด ์์ฒญ์ ์ง์ฐ์ํฌ ์ ์์ต๋๋ค.
@Ayaz ์ด ๋ฌธ์ ๋ ์์ ํ ํด๊ฒฐ๋์ง ์์๊ธฐ ๋๋ฌธ์ ์ฌ๋๋ค์ด ์ค๋ฅ ์๋ต ๋ง ์ฒ๋ฆฌํ์ง๋ง ๋ฌธ์ ๋ ์ฌ์ ํ ํด๊ฒฐ๋์ง ์์๊ธฐ ๋๋ฌธ์์ด ๋ฌธ์ ๋ฅผ ์ด โโ์ ์์ต๋๊น?
๋ฒํ : ์ฌ๊ธฐ์ ๊ฐ์ ๋ฌธ์ :
error: Error: Redis connection to xx.yy.zz.aa:6379 failed - read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:205:27) {
errno: 'ECONNRESET',
code: 'ECONNRESET',
syscall: 'read'
},
๋ค์๊ณผ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
Redis๋ Google Cloud MemoryStore๋ฅผ ์ฌ์ฉํ์ฌ ์ ๊ณต๋ฉ๋๋ค.
๋ก๊ทธ์๋ ๋ค์์ด ํ์๋ฉ๋๋ค.
[ioredis] ์ฒ๋ฆฌ๋์ง ์์ ์ค๋ฅ ์ด๋ฒคํธ : ์ค๋ฅ : ECONNRESET ์ฝ๊ธฐ
์ด๊ฒ์ ํน๋ณํ ์ด์ ๋ ๋์ผํ ๋จ๊ณ์์ด 24 ์๊ฐ๋ง๋ค ํ ๋ฒ์ฉ ๋ฐ์ํฉ๋๋ค.
๋ฟก๋ฟก
๋๋ ๊ฐ์ ๋ฌธ์ ๋ฅผ ๋ณธ๋ค. Redis๋ Google Cloud MemoryStore๋ฅผ ์ฌ์ฉํ์ฌ ์ ๊ณต๋ฉ๋๋ค. ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์
จ์ต๋๊น?
๋ํ Cloud Memory Store์ ์ฐ๊ฒฐํ ๋ Cloud run / Cloud Functions์์ ๋งค์ฐ ์ ์ฌํ ๋ฌธ์ ๊ฐ ๋ํ๋ฉ๋๋ค. ๊ธฐ๋ณธ ๋ฆฌ์์ค๊ฐ Google์ ์ํด ๋๋ฌด ๋นจ๋ฆฌ ์์๋ก ์ค์ง ๋ ๋ ๋ฐ์ํ ์ ์์ต๋๋ค.
์ด ๋ฌธ์ ๋ Redis ์ฐ๊ฒฐ์ ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ณ๊ฒฝํ์ง ์๊ณ ์ฝ ์ผ์ฃผ์ผ ์ ์ ์์๋์์ต๋๋ค. ๋ํ ioredis๋ฅผ ์ฌ์ฉํ์ฌ ์ฐ๊ฒฐ์ ์ฒ๋ฆฌํ๊ณ ๋ ธ๋ 12๋ฅผ ์คํํฉ๋๋ค.
IORedis๋ ๊ธฐ๋ณธ ์ ๋ต์ผ๋ก ์ค๋ฅ ๋ฐ์์ ์ฌ ์ฐ๊ฒฐ์ ์ ๊ณตํ์ง๋ง ์ด๋ค ์ด์ ๋ก ๋ ๋ฐ์ํ์ง ์์ต๋๋ค.
๋ด๊ฐ ํ ๊ฒ์ ๊ตฌ์ฑ์ ๋ค์์ ์ถ๊ฐํ๋ ๊ฒ์ ๋๋ค.
reconnectOnError: (error): boolean => {
console.log('Always reconnect on error', error)
return true
}
ECONNRESET ์ค๋ฅ๊ฐ ์ฌ์ ํ ์กด์ฌํ์ง๋ง ์ด์ ์ฐ๊ฒฐ์ด ๋ค์ ์๋๋๊ณ ๋ด Google ์ธ์คํด์ค๊ฐ ๋ ์ด์ ๋ฉ์ถฐ ์์ง ์์ต๋๋ค.
CC : @ hkd987
reconnectOnError
์ ๋ํ ์์ธํ ๋ด์ฉ์ https://github.com/luin/ioredis์์ ํ์ธํ์ธ์.
@ robertop87 ํญ์ reconnectOnError
true๋ฅผ ๋ฐํํ๋๋ก ์ค์ ๋ ํน์ ๊ตฌ์ฑ์ผ๋ก ์ ๋ฐฐํฌ๋ฅผ ์ํํ์ต๋๋ค. ์ด๊ฒ์ ์ต์ ๋ฆด๋ฆฌ์ค์์ ๋ฐ์ํ๊ธฐ ๋๋ฌธ์ ๋ค์ ์ด๊ฑฐ ๋ ์ ํฐ์ผ์ ๋ง๋ค์ด์ผํ๋ ๋ฌธ์ ์ฒ๋ผ ๋ณด์
๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
@ ayazpasha2434 ์ด ์ค์ ๋ด ์ค๋ฅ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
client.on ( 'error', function (err) {console.error (err)})