# Service Objects and EMS Client URLs

The service object exposes the EMS server listen port (both inside and outside the cluster).

The service defined in `tibemsd-template.yaml` is of type `NodePort`, which means that the corresponding port number will be accessible through all nodes of the cluster.

For example, if your cluster runs on three nodes called `node1`, `node2` and `node3` that can be addressed by those host names. If you have exposed your EMS server through a service using port number `8222`, EMS clients running outside the cluster will be able to access it either through the `tcp://node1:8222, tcp://node2:8222` or `tcp://node3:8222` URL, regardless of the node where the container is actually running. This works by virtue of each node proxying port `8222` into the service.

EMS clients running inside the cluster will be able to access the EMS server either in the fashion described above or through its service name. Assuming the service name is `emsdev01` and the port still is `8222`, that amounts to using the `tcp://emsdev01:8222` URL.

To ensure EMS client automated fault-tolerance failover, these must connect with FT double URLs. Using the example above: `tcp://node1:8222`, `tcp://node1:8222` from outside the cluster or `tcp://emsdev01:8222`, `tcp://emsdev01:8222` from inside the cluster. For the first form, since all nodes will proxy port `8222` into the service, repeating the same node name twice fits our purpose. The connection factories in the sample EMS server configuration generated by default upon creating a container illustrate that pattern. Should the EMS server or its container fail, clients will automatically reconnect to the same URL once the server has been restarted.

You can use types of service other than `NodePort` if they fit your requirements.

Copyright © Cloud Software Group, Inc. All rights reserved.