提交 7e856dec 编写于 作者: A ascrutae

添加注册节点逻辑

上级 207561b1
......@@ -42,10 +42,9 @@
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
<groupId>com.a.eye</groupId>
<artifactId>skywalking-registry</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
......
......@@ -5,6 +5,10 @@ import com.a.eye.skywalking.logging.api.LogManager;
import com.a.eye.skywalking.logging.impl.log4j2.Log4j2Resolver;
import com.a.eye.skywalking.network.TransferService;
import com.a.eye.skywalking.network.TransferService.TransferServiceBuilder;
import com.a.eye.skywalking.registry.RegistryCenterFactory;
import com.a.eye.skywalking.registry.api.CenterType;
import com.a.eye.skywalking.registry.api.RegistryCenter;
import com.a.eye.skywalking.registry.impl.zookeeper.ZookeeperConfig;
import com.a.eye.skywalking.storage.config.Config;
import com.a.eye.skywalking.storage.config.ConfigInitializer;
import com.a.eye.skywalking.storage.data.IndexDataCapacityMonitor;
......@@ -37,6 +41,7 @@ public class Main {
transferService.start();
logger.info("transfer service started successfully!");
new Thread(new IndexDataCapacityMonitor()).start();
registryNode();
logger.info("storage service started successfully!");
Thread.currentThread().join();
} catch (Throwable e) {
......@@ -46,6 +51,15 @@ public class Main {
}
}
private static void registryNode() {
//TODO auth info auth schema
RegistryCenter registryCenter =
RegistryCenterFactory.INSTANCE.getRegistryCenter(CenterType.DEFAULT_CENTER_TYPE);
Properties registerConfig = new Properties();
registerConfig.setProperty(ZookeeperConfig.CONNECT_URL, Config.RegistryCenter.CONNECT_URL);
registryCenter.start(registerConfig);
}
private static void initializeParam() throws IllegalAccessException, IOException {
Properties properties = new Properties();
try {
......
......@@ -8,6 +8,7 @@ public class Config {
public static int PORT = 34000;
}
public static class BlockIndex {
public static String STORAGE_BASE_PATH = "/tmp/skywalking/block_index";
......@@ -33,4 +34,9 @@ public class Config {
public static long MAX_CAPACITY_PER_INDEX = 1000 * 1000 * 1000 * 1000;
}
public static class RegistryCenter {
public static String CONNECT_URL = "127.0.0.1:2181";
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册