From 09343e8efac4f431974d2b487411dc91e1757eee Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Wed, 12 Jul 2023 14:38:35 +0800 Subject: [PATCH] =?UTF-8?q?feature(all):=20=E5=88=87=E6=8D=A2=E4=BD=BF?= =?UTF-8?q?=E7=94=A8zookeeper=E4=BD=9C=E4=B8=BA=E6=B3=A8=E5=86=8C=E4=B8=AD?= =?UTF-8?q?=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/template/deploy.ftl | 2 +- .../main/resources/application-discovery.yml | 7 +++---- service-hudi-query/pom.xml | 19 +++++++++++++++++++ .../web/controller/CloudController.java | 2 +- test/test.http | 4 ++++ 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/service-cli/service-cli-runner/src/main/resources/template/deploy.ftl b/service-cli/service-cli-runner/src/main/resources/template/deploy.ftl index cda1742..66a3428 100644 --- a/service-cli/service-cli-runner/src/main/resources/template/deploy.ftl +++ b/service-cli/service-cli-runner/src/main/resources/template/deploy.ftl @@ -21,7 +21,7 @@ echo "${info.name} $host $hostname $datetime" ssh $host 'bash -s' < stop.sh ${runtime.jarPath}/${info.name}.jar <#if selectedHosts?seq_contains(host)> ssh $host "mkdir -p ${runtime.jarPath};curl ftp://yyy:QeY\!68\)4nH1@132.121.122.15:2222/${info.sourceJar} -o ${runtime.jarPath}/${info.name}.jar" -ssh $host "export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.';nohup ${runtime.jdkPath} <#list environments?keys as key>-D${key?replace("_", ".")}=${environments[key]?string} -jar ${runtime.jarPath}/${info.name}.jar<#noparse> --datetime=${datetime} --hostname=${hostname} --spring.cloud.zookeeper.discovery.instance-host=${hostname} --eureka.instance.hostname=${hostname} --logging.parent=${log_path} --loki.url=${loki_url} --spring.cloud.zookeeper.connect-string=${zk_url} --eureka.client.service-url.defaultZone='${eureka_url}' --spring.security.meta.authority='${security_authority}' --spring.security.meta.username='${security_username}' --spring.security.meta.darkcode='${security_darkcode}' <#list arguments?keys as key>--${key?replace("_", ".")}=${arguments[key]?string} > /dev/null 2>&1 &" +ssh $host "export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.';nohup ${runtime.jdkPath} <#list environments?keys as key>-D${key?replace("_", ".")}=${environments[key]?string} -jar ${runtime.jarPath}/${info.name}.jar<#noparse> --datetime=${datetime} --hostname=${hostname} --eureka.instance.hostname=${hostname} --logging.parent=${log_path} --loki.url=${loki_url} --spring.cloud.zookeeper.connect-string=${zk_url} --eureka.client.service-url.defaultZone='${eureka_url}' --spring.security.meta.authority='${security_authority}' --spring.security.meta.username='${security_username}' --spring.security.meta.darkcode='${security_darkcode}' <#list arguments?keys as key>--${key?replace("_", ".")}=${arguments[key]?string} > /dev/null 2>&1 &" echo '' diff --git a/service-configuration/src/main/resources/application-discovery.yml b/service-configuration/src/main/resources/application-discovery.yml index 0a722ab..a87ea5e 100644 --- a/service-configuration/src/main/resources/application-discovery.yml +++ b/service-configuration/src/main/resources/application-discovery.yml @@ -1,20 +1,19 @@ spring: cloud: zookeeper: - enabled: false + enabled: true connect-string: 127.0.0.1:2181 discovery: enabled: ${spring.cloud.zookeeper.enabled} root: /hudi-services - instance-host: localhost - instance-id: ${spring.application.name}-${spring.cloud.zookeeper.discovery.instance-host}-${random.uuid}-${datetime:19700101} + instance-id: ${spring.application.name}-${hostname}-${random.uuid}-${datetime:19700101} eureka: instance: hostname: localhost prefer-ip-address: true instance-id: ${spring.application.name}-${eureka.instance.hostname}-${random.uuid}-${datetime} client: - enabled: true + enabled: false service-url: defaultZone: http://localhost:35670/eureka/ registry-fetch-interval-seconds: 10 diff --git a/service-hudi-query/pom.xml b/service-hudi-query/pom.xml index c7728e5..3b9765e 100644 --- a/service-hudi-query/pom.xml +++ b/service-hudi-query/pom.xml @@ -73,6 +73,10 @@ commons-logging commons-logging + + org.apache.curator + curator-client + @@ -80,6 +84,21 @@ hudi-flink1.13-bundle 0.12.0-eshore-SNAPSHOT + + org.apache.curator + curator-framework + 5.1.0 + + + log4j + log4j + + + netty + io.netty + + + diff --git a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/CloudController.java b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/CloudController.java index d9be776..8152206 100644 --- a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/CloudController.java +++ b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/CloudController.java @@ -76,7 +76,7 @@ public class CloudController extends BaseController { return services() .groupBy(groupByField) .toMap() - .collectValues((serviceId, services) -> new CloudServiceVO(serviceId, services.toSortedListBy(CloudServiceVO.Service::getServiceUpTime).toImmutable())) + .collectValues((serviceId, services) -> new CloudServiceVO(serviceId, services.toSortedListBy(CloudServiceVO.Service::getHost).toImmutable())) .valuesView() .toSortedListBy(CloudServiceVO::getName) .toImmutable(); diff --git a/test/test.http b/test/test.http index 9959c4a..6d46229 100644 --- a/test/test.http +++ b/test/test.http @@ -5,6 +5,7 @@ @url = http://{{username}}:{{password}}@{{host}}:{{port}} @queue-url = {{url}}/hudi_services/queue @scheduler-url = {{url}}/hudi_services/service_scheduler +@web-url = {{url}}/hudi_services/service_web ### 队列名称 GET {{queue-url}}/queue/names @@ -50,5 +51,8 @@ GET {{scheduler-url}}/schedule/all_focus ### schedule table force GET {{scheduler-url}}/schedule/table?flink_job_id=1542097993662164992&alias=acct_oa_attach_dg&force=b5-sync +### Query Scheduler +GET {{web-url}}/cloud/list + ### Yarn query GET http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.143:34903/job/list?cluster=a4