diff --git a/src/main/java/org/github/etcd/service/impl/ClusterManagerImpl.java b/src/main/java/org/github/etcd/service/impl/ClusterManagerImpl.java index 9c58345..0ff532f 100644 --- a/src/main/java/org/github/etcd/service/impl/ClusterManagerImpl.java +++ b/src/main/java/org/github/etcd/service/impl/ClusterManagerImpl.java @@ -45,10 +45,17 @@ public int compare(EtcdMember o1, EtcdMember o2) { private Map clusters = Collections.synchronizedMap(new LinkedHashMap()); + private static final String DEFAULT_ETCD_CLIENT = "ETCD_CLIENT_URL"; public ClusterManagerImpl() { - addCluster("default", "http://localhost:2379/"); - addCluster("kvm", "http://192.168.122.101:4001/"); + + String etcdAddress = System.getenv(DEFAULT_ETCD_CLIENT); + if (etcdAddress == null) { + etcdAddress = System.getProperty(DEFAULT_ETCD_CLIENT, "http://localhost:2379/"); + } + + addCluster("default", etcdAddress); + // addCluster("kvm", "http://192.168.122.201:2379/"); } @Override