From 7e856decebcd5e1f31876256a6d88ba2f39d0e78 Mon Sep 17 00:00:00 2001 From: ascrutae Date: Sat, 12 Nov 2016 19:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E5=86=8C=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skywalking-storage/pom.xml | 7 +++---- .../java/com/a/eye/skywalking/storage/Main.java | 14 ++++++++++++++ .../a/eye/skywalking/storage/config/Config.java | 6 ++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/skywalking-storage-center/skywalking-storage/pom.xml b/skywalking-storage-center/skywalking-storage/pom.xml index 25a5153262..00e887303f 100644 --- a/skywalking-storage-center/skywalking-storage/pom.xml +++ b/skywalking-storage-center/skywalking-storage/pom.xml @@ -42,10 +42,9 @@ - junit - junit - 4.12 - test + com.a.eye + skywalking-registry + ${project.version} diff --git a/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java b/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java index d57372674b..7379c89af6 100644 --- a/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java +++ b/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java @@ -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 { diff --git a/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/config/Config.java b/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/config/Config.java index b1e984f617..e4af3922c5 100644 --- a/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/config/Config.java +++ b/skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/config/Config.java @@ -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"; + } } -- GitLab