Search in sources :

Example 1 with ClusterAcceptor

use of com.navercorp.pinpoint.web.cluster.connection.ClusterAcceptor in project pinpoint by naver.

the class ClusterManager method start.

@PostConstruct
public void start() throws InterruptedException, IOException, KeeperException {
    logger.info("start() started.");
    if (!config.isClusterEnable()) {
        logger.info("start() skipped. caused:cluster option disabled.");
        return;
    }
    try {
        clusterConnectionManager.start();
        clusterDataManager.start();
        ClusterAcceptor clusterAcceptor = clusterConnectionManager.getClusterAcceptor();
        if (clusterAcceptor != null) {
            String nodeName = clusterAcceptor.getBindHost() + ":" + clusterAcceptor.getBindPort();
            List<String> localIpList = NetUtils.getLocalV4IpList();
            clusterDataManager.registerWebCluster(nodeName, convertIpListToBytes(localIpList, "\r\n"));
        }
    } catch (Exception e) {
        logger.warn("start() failed. caused:{}.", e.getMessage(), e);
        clearResource();
    }
    logger.info("start() completed.");
}
Also used : KeeperException(org.apache.zookeeper.KeeperException) IOException(java.io.IOException) ClusterAcceptor(com.navercorp.pinpoint.web.cluster.connection.ClusterAcceptor) PostConstruct(javax.annotation.PostConstruct)

Aggregations

ClusterAcceptor (com.navercorp.pinpoint.web.cluster.connection.ClusterAcceptor)1 IOException (java.io.IOException)1 PostConstruct (javax.annotation.PostConstruct)1 KeeperException (org.apache.zookeeper.KeeperException)1