Proxy 有办法来找到集群中 broker 的地址。 你可以通过配置代理来直接连接到服务发现,或者在配置中指定broker URL。

Pulsar uses ZooKeeper for service discovery. To connect the proxy to ZooKeeper, specify the following in .

Option 2: Use broker URLs

配置代理的更安全的方法是指定连接到brokers的URL。

您可以在 conf/proxy.conf中配置broker URLs,如下所示。

Or if you use TLS:

提供的URLs中的主机名应该是指向多个 broker 的DNS条目,或由多个broker 的IP地址支持的虚拟IP,以便在单个 broker 不可用时 ,代理不会失去与 Pulsar 群集的连接。

The ports to connect to the brokers (6650 and 8080, or in the case of TLS, 6651 and 8443) should be open in the network ACLs.

Start the proxy

To start the proxy:

The Pulsar proxy runs by default in the foreground. To stop the proxy, simply stop the process in which the proxy is running.

Proxy frontends

You can run the Pulsar proxy behind some kind of load-distributing frontend, such as an HAProxy load balancer.

Proxy configuration

You can configure the Pulsar proxy using the proxy.conf configuration file. The following parameters are available in that file: