init(registry) {
		super.init(registry);

		try {
			Redis = require("ioredis");
		} catch (err) {
			/* istanbul ignore next */
			this.broker.fatal(
				"The 'ioredis' package is missing. Please install it with 'npm install ioredis --save' command.",
				err,
				true
			);
		}

		this.logger.warn(
			kleur
				.yellow()
				.bold("Redis Discoverer is an EXPERIMENTAL module. Do NOT use it in production!")
		);

		// Using shorter instanceID to reduce the network traffic
		this.instanceHash = this.broker.instanceID.substring(0, 8);

		this.PREFIX = `MOL${this.broker.namespace ? "-" + this.broker.namespace : ""}-DSCVR`;
		this.BEAT_KEY = `${this.PREFIX}-BEAT:${this.broker.nodeID}|${this.instanceHash}`;
		this.INFO_KEY = `${this.PREFIX}-INFO:${this.broker.nodeID}`;

		/**
		 * ioredis client instance
		 * @memberof RedisCacher
		 */
		if (this.opts.cluster) {
			if (!this.opts.cluster.nodes || this.opts.cluster.nodes.length === 0) {
				throw new BrokerOptionsError("No nodes defined for cluster");
			}

			this.client = new Redis.Cluster(this.opts.cluster.nodes, this.opts.cluster.options);
		} else {
			this.client = new Redis(this.opts.redis);
		}

		this.client.on("connect", () => {
			/* istanbul ignore next */
			this.logger.info("Redis Discoverer client connected.");
			if (this.reconnecting) {
				this.reconnecting = false;
				this.sendLocalNodeInfo();
			}
		});

		this.client.on("reconnecting", () => {
			/* istanbul ignore next */
			this.logger.warn("Redis Discoverer client reconnecting...");
			this.reconnecting = true;
			this.lastInfoSeq = 0;
			this.lastBeatSeq = 0;
		});

		this.client.on("error", err => {
			/* istanbul ignore next */
			this.logger.error(err);

			this.broker.broadcastLocal("$discoverer.error", {
				error: err,
				module: "discoverer",
				type: C.CLIENT_ERROR
			});
		});

		if (this.opts.monitor && isFunction(this.client.monitor)) {
			this.client.monitor((err, monitor) => {
				this.logger.debug("Redis Discoverer entering monitoring mode...");
				monitor.on("monitor", (time, args /*, source, database*/) =>
					this.logger.debug(args)
				);
			});
		}

		// create an instance of serializer (default to JSON)
		this.serializer = Serializers.resolve(this.opts.serializer);
		this.serializer.init(this.broker);

		this.logger.debug("Redis Discoverer created. Prefix:", this.PREFIX);
	}
Initialize Discoverer

@param {any} registry

@memberof RedisDiscoverer