可选auto可选autoWhether or not to resend unfulfilled commands on reconnect.
Unfulfilled commands are most likely to be blocking commands such as brpop or blpop.
可选autoWhen the client reconnects, channels subscribed in the previous connection will be
resubscribed automatically if autoResubscribe is true.
可选command可选commandIf a command does not return a reply within a set number of milliseconds, a "Command timed out" error will be thrown.
可选connectionSet the name of the connection to make it easier to identity the connection in client list.
可选Connector可选connectHow long the client will wait before killing a socket due to inactivity during initial connection.
可选dbDatabase index to use.
可选disconnect可选enable可选enableBy default, if the connection to Redis server has not been established, commands are added to a queue
and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means
the Redis server has loaded the database from disk, otherwise means the connection to the Redis
server has been established). If this option is false, when execute the command when the connection
isn't ready, an error will be returned.
可选enableThe client will sent an INFO command to check whether the server is still loading data from the disk (
which happens when the server is just launched) when the connection is established, and only wait until
the loading process is finished before emitting the ready event.
可选enable可选failover可选family可选host可选keepEnable/disable keep-alive functionality.
可选key可选lazyWhen a Redis instance is initialized, a connection to the server is immediately established. Set this to
true will delay the connection to the server until the first command is sent or redis.connect() is called
explicitly.
可选max可选maxThe commands that don't get a reply due to the connection to the server is lost are
put into a queue and will be resent on reconnect (if allowed by the retryStrategy option).
This option is used to configure how many reconnection attempts should be allowed before
the queue is flushed with a MaxRetriesPerRequestError error.
Set this options to null instead of a number to let commands wait forever
until the connection is alive again.
可选monitorThis option is used internally when you call redis.monitor() to tell Redis
to enter the monitor mode when the connection is established.
可选nameMaster group name of the Sentinel
可选nat可选noEnable/disable the use of Nagle's algorithm.
可选offline可选passwordIf set, client will send AUTH command with the value of this option when connected.
可选path可选port可选preferred可选read可选reconnectWhether or not to reconnect on certain Redis errors.
This options by default is null, which means it should never reconnect on Redis errors.
You can pass a function that accepts an Redis error, and returns:
true or 1 to trigger a reconnection.false or 0 to not reconnect.2 to reconnect and resend the failed command (who triggered the error) after reconnection.可选retry可选role可选scripts可选sentinel可选sentinel可选sentinel可选sentinel可选sentinel可选sentinels可选sentinel可选sentinel可选show可选socketIf the socket does not receive data within a set number of milliseconds:
可选stringWhen enabled, numbers returned by Redis will be converted to JavaScript strings instead of numbers.
This is necessary if you want to handle big numbers (above Number.MAX_SAFE_INTEGER === 2^53).
可选tls可选update可选url可选usernameIf set, client will send AUTH command with the value of this option as the first argument when connected. This is supported since Redis 6.
单机、哨兵配置