--- alias: operation-guide-configuration description: "Configure the Discovery Service settings for optimal system operation and integration" --- # Discovery Service Configuration The file you need for the configuration and settings of the **Discovery Service** is available here: * `InstallationFolder\DiscoveryService\config\config.json` The image below provides insight to the **Discovery Service** configuration: ![Discovery Service 01](images/discovery_service_01.png) ## Critical Manufacturing Discovery Service Configuration To enable the Critical Manufacturing Discovery Service you must follow the steps below: 1. In the `InstallationFolder\CriticalManufacturing\BusinessTier\Settings\LoadBalancingConfig.json`: * set the **IsLoadBalancerEnabled** property to `true`. * the **LoadBalancerConfig\Address** property should be pointing to the Discovery Service address. 2. In the `InstallationFolder\CriticalManufacturing\BusinessTier\Settings\TransportConfig.json`: * set the **UseLoadBalancing** property to `true`. * the **LoadBalancerConfig\Address** property should be pointing to the Discovery Service address. 3. In the `InstallationFolder\CriticalManufacturing\UI\Html\config.json`: * set the **host\isLoadBalancerEnabled** to `true`. * the **loadBalancer\address** property should be pointing to the Discovery Service address. ## Critical Manufacturing Host Configuration In the settings available in the `InstallationFolder\CriticalManufacturing\BusinessTier\Settings\LoadBalancingConfig.json` file you can also manage specific settings related to the connection of the Host to the Discovery Services. In this file location, for example, you can manage the weight of the Host in the Weighed Round-Robin algorithm, change its address or, if required, disable it altogether. The image below provides insight to the mentioned settings: ![Discovery Service 02](images/discovery_service_02.png) ## External Third-Party Load Balancer Configuration If an MES cluster environment, with more than one Application Server, is using a third-party Load Balancer (LB) instead of the out-of-the-box Discovery Services, then some MES settings need to be manually changed on each Application Server. The needed changes are as follows: 1. In the `$\UI\HTML\config.json`: * the **host\rest\address property** needs to point to the **LB Address** instead of the AppServer. 2. In the `$\BusinessTier\Settings\TransportConfig.json`: * the **TransportConfig\GatewaysConfig\ExternalAddress** needs to point to the **LB Address** instead of the AppServer. 3. In the `$\MessageBusGateway\config\config.json`: * the **cluster\broadcast** needs to be set to `null`. * the **cluster\unicast** needs to be set with the relevant Application Servers IPs `"IpAppServer01,IpAppServer02"`. Example: ![Discovery Service Load Balancer](images/discoveryservice_loadbalancer.png)