Соединение с кластером Redis потеряно - PullRequest
1 голос
/ 06 августа 2020

У меня есть кластер Redis, развернутый в Kubernetes, с диаграммой bitnami / redis-cluster. Я подключился к кластеру из nodejs с помощью пакета redis-cluster npm. После установления соединения я пытаюсь установить тысячи ключей непрерывно. Чтобы завершить sh, весь процесс должен занять десять минут. Но после двух минут подключения соединение Redis потеряно.

Не проблема с подключением, что мне делать? Например, изменение в конфигурации или что-то в этом роде.

Какая может быть точная причина потери этого соединения в моем сценарии или обычном сценарии ios?

Мой код:

const redis = require('redis');
const redisCluster = require('redis-clustr')
const redisClient = new redisCluster({
    servers: [
    { host: "IP", port: 6379 },
    { host: "IP", port: 6379 }, 
    { host: "IP", port: 6379 },  
    { host: "IP", port: 6379 },
    { host: "IP", port: 6379 }, 
    { host: "IP", port: 6379 } 
     ],
    createClient: (port, host) => {
      return redis.createClient({ 
       port,
       host,
       auth_pass: 'PASSWORD',
     });
   }
});
 <My data processing code to set thousands of keys>
(node:15827) UnhandledPromiseRejectionWarning: AbortError: Redis connection lost and command aborted. It might have been processed.
    at RedisClient.flush_and_error (/root/data-pipeline/node_modules/redis/index.js:362:23)
    at RedisClient.connection_gone (/root/data-pipeline/node_modules/redis/index.js:664:14)
    at Socket.<anonymous> (/root/data-pipeline/node_modules/redis/index.js:293:14)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:15827) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15827) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
...