Fix zk path error. (#963)

This commit is contained in:
吴晟 Wu Sheng 2018-03-19 18:03:17 +08:00 committed by GitHub
parent b1265dfc1c
commit afcd3314d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -34,6 +34,7 @@ import org.apache.skywalking.apm.collector.cluster.DataMonitor;
import org.apache.skywalking.apm.collector.cluster.ModuleRegistration;
import org.apache.skywalking.apm.collector.core.CollectorException;
import org.apache.skywalking.apm.collector.core.util.CollectionUtils;
import org.apache.skywalking.apm.util.StringUtil;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
@ -165,7 +166,11 @@ public class ClusterZKDataMonitor implements DataMonitor, Watcher {
}
@Override public String getBaseCatalog() {
return "/" + namespace + "/skywalking";
if (StringUtil.isEmpty(namespace)) {
return "/skywalking";
} else {
return "/" + namespace + "/skywalking";
}
}
void setNamespace(String namespace) {