-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from linshenkx/dev
添加amoro、hbase、hive、kafka、kyuubi、spark组件
- Loading branch information
Showing
121 changed files
with
17,389 additions
and
761 deletions.
There are no files selected for viewing
175 changes: 95 additions & 80 deletions
175
cloudeon-server/src/main/java/org/dromara/cloudeon/controller/AlertController.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
rules: | ||
- alert: AmoroAms存活数检测 | ||
promql: sum(up{job="metrics-amoro-ams"})<#{{${serviceRoles['AMORO_AMS']?size}}}# | ||
alertLevel: exception | ||
serviceRoleName: AMORO_AMS | ||
alertAdvice: AmoroAms发生宕机,请检查日志或执行重启 | ||
alertInfo: "Flink历史服务器发生宕机,当前存活实例数为:{{$value}}" | ||
- alert: AmoroAms进程存活 | ||
promql: up{job="metrics-amoro-ams"} != 1 | ||
alertLevel: exception | ||
serviceRoleName: AMORO_AMS | ||
alertAdvice: AmoroAms发生宕机,请检查日志或执行重启 | ||
alertInfo: "{{ $labels.job }}的{{ $labels.instance }}实例发生宕机" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM registry.cn-guangzhou.aliyuncs.com/bigdata200/flink:1.15.4 | ||
|
||
ENV AMORO_HOME=/opt/amoro | ||
ENV PATH=$PATH:$AMORO_HOME/bin | ||
|
||
RUN yum install -y unzip | ||
|
||
RUN wget https://github.com/apache/amoro/releases/download/v0.6.1/amoro-flink-runtime-1.15-0.6.1.jar \ | ||
&& mv amoro-flink-runtime-1.15-0.6.1.jar ${FLINK_HOME}/lib/ | ||
|
||
RUN wget https://github.com/apache/amoro/releases/download/v0.6.1/amoro-0.6.1-bin.zip | ||
|
||
RUN unzip amoro-*-bin.zip -d /opt/ \ | ||
&& rm -f amoro-*-bin.zip && mv /opt/amoro-* $AMORO_HOME | ||
|
||
RUN yum install -y mariadb.x86_64 mariadb-libs.x86_64 | ||
|
||
ENV MYSQL_JDBC_DRIVER_VERSION=8.0.30 | ||
RUN wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_JDBC_DRIVER_VERSION}/mysql-connector-java-${MYSQL_JDBC_DRIVER_VERSION}.jar \ | ||
&& mv mysql-connector-java-${MYSQL_JDBC_DRIVER_VERSION}.jar $AMORO_HOME/lib/ | ||
|
||
WORKDIR $AMORO_HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
docker build --build-arg "https_proxy=http://my.win:7890" -t registry.cn-guangzhou.aliyuncs.com/bigdata200/amoro:0.6.1 . | ||
docker push registry.cn-guangzhou.aliyuncs.com/bigdata200/amoro:0.6.1 | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions
13
cloudeon-stack/EDP-2.0.0/amoro/k8s-render/metrics-service.yaml.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: metrics-amoro-ams | ||
labels: | ||
sname: ${serviceFullName} | ||
enable-default-service-monitor: true | ||
spec: | ||
selector: | ||
sname: ${serviceFullName} | ||
ports: | ||
- name: metrics | ||
port: 5559 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
<#if conf["data.path.list"]??&& conf["data.path.list"]?trim?has_content> | ||
<#assign primeDataPathList=conf["data.path.list"]?trim?split(",")> | ||
<#else > | ||
<#assign primeDataPathList=[conf['global.persistence.basePath']]> | ||
</#if> | ||
<#assign dataPathList = []> | ||
<#list primeDataPathList as dataPath> | ||
<#if dataPath?ends_with("/")> | ||
<#assign dataPathList = dataPathList + [dataPath+ roleFullName]> | ||
<#else> | ||
<#assign dataPathList = dataPathList + [dataPath+"/"+ roleFullName]> | ||
</#if> | ||
</#list> | ||
--- | ||
apiVersion: "apps/v1" | ||
kind: "Deployment" | ||
metadata: | ||
labels: | ||
name: "${roleServiceFullName}" | ||
sname: "${serviceFullName}" | ||
roleFullName: "${roleFullName}" | ||
name: "${roleServiceFullName}" | ||
spec: | ||
replicas: ${roleNodeCnt} | ||
selector: | ||
matchLabels: | ||
app: "${roleServiceFullName}" | ||
sname: "${serviceFullName}" | ||
roleFullName: "${roleFullName}" | ||
strategy: | ||
type: "RollingUpdate" | ||
rollingUpdate: | ||
maxSurge: 0 | ||
maxUnavailable: 1 | ||
minReadySeconds: 5 | ||
revisionHistoryLimit: 10 | ||
template: | ||
metadata: | ||
labels: | ||
name: "${roleServiceFullName}" | ||
sname: "${serviceFullName}" | ||
roleFullName: "${roleFullName}" | ||
app: "${roleServiceFullName}" | ||
podConflictName: "${roleServiceFullName}" | ||
inject-filebeat: "true" | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchLabels: | ||
name: "${roleServiceFullName}" | ||
podConflictName: "${roleServiceFullName}" | ||
topologyKey: "kubernetes.io/hostname" | ||
hostPID: false | ||
hostNetwork: true | ||
nodeSelector: | ||
${roleServiceFullName}: "true" | ||
terminationGracePeriodSeconds: 30 | ||
containers: | ||
- image: "${conf['serverImage']}" | ||
imagePullPolicy: "${conf['global.imagePullPolicy']}" | ||
name: "${roleServiceFullName}" | ||
command: ["/bin/bash","-c"] | ||
args: | ||
- | | ||
/bin/bash /opt/global/bootstrap.sh && \ | ||
/bin/bash /opt/service-common/bootstrap.sh; | ||
readinessProbe: | ||
exec: | ||
command: | ||
- "/bin/bash" | ||
- "-c" | ||
- "curl --fail --connect-timeout 15 --max-time 15 \"http://`hostname`:${conf['http-server.port']}/\"\ | ||
\n" | ||
failureThreshold: 3 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
resources: | ||
requests: | ||
memory: "${conf['amoro.ams.container.request.memory']}Mi" | ||
cpu: "${conf['amoro.ams.container.request.cpu']}" | ||
limits: | ||
memory: "${conf['amoro.ams.container.limit.memory']}Mi" | ||
cpu: "${conf['amoro.ams.container.limit.cpu']}" | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: MEM_LIMIT | ||
valueFrom: | ||
resourceFieldRef: | ||
resource: limits.memory | ||
- name: RENDER_TPL_DIR | ||
value: "/opt/service-render" | ||
- name: RENDER_MODEL | ||
value: "/opt/service-common/values.json" | ||
- name: ROLE_FULL_NAME | ||
value: "${roleFullName}" | ||
volumeMounts: | ||
- mountPath: "/etc/localtime" | ||
name: "timezone" | ||
- name: global-service-common | ||
mountPath: /opt/global/bootstrap.sh | ||
subPath: bootstrap.sh | ||
- name: global-render-config | ||
mountPath: /opt/global/10.render | ||
- name: global-usersync-config | ||
mountPath: /opt/global/20.usersync | ||
- name: global-copy-filebeat-config | ||
mountPath: /opt/global/30.copy-filebeat-config | ||
- name: service-render | ||
mountPath: /opt/service-render | ||
- name: service-common | ||
mountPath: /opt/service-common | ||
- name: hdfs-config | ||
mountPath: /etc/hdfs-config | ||
- name: yarn-config | ||
mountPath: /etc/yarn-config | ||
- mountPath: "/workspace" | ||
name: "workspace" | ||
<#list dataPathList as dataPath> | ||
- name: local-data-${dataPath?index+1} | ||
mountPath: /data/${dataPath?index+1} | ||
</#list> | ||
volumes: | ||
- hostPath: | ||
path: "/etc/localtime" | ||
name: "timezone" | ||
- name: global-service-common | ||
configMap: | ||
name: global-service-common | ||
- name: global-render-config | ||
configMap: | ||
name: global-render-config | ||
- name: global-usersync-config | ||
configMap: | ||
name: global-usersync-config | ||
- name: global-copy-filebeat-config | ||
configMap: | ||
name: global-copy-filebeat-config | ||
- name: service-render | ||
configMap: | ||
name: amoro-service-render | ||
- name: service-common | ||
configMap: | ||
name: amoro-service-common | ||
- name: hdfs-config | ||
configMap: | ||
name: hdfs-config | ||
- name: yarn-config | ||
configMap: | ||
name: yarn-config | ||
- name: "workspace" | ||
hostPath: | ||
type: DirectoryOrCreate | ||
path: "${dataPathList[0]}/workspace" | ||
<#list dataPathList as dataPath> | ||
- name: local-data-${dataPath?index+1} | ||
hostPath: | ||
path: ${dataPath}/data | ||
type: DirectoryOrCreate | ||
</#list> |
33 changes: 33 additions & 0 deletions
33
cloudeon-stack/EDP-2.0.0/amoro/kube-prometheus-render/alert-rule.yaml.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<#macro executeDynamicCode userInput> | ||
<#assign startIdx = userInput?index_of('#{{')> | ||
<#assign endIdx = userInput?last_index_of('}}#')> | ||
<#if startIdx gt 0 && endIdx gt 0> | ||
<#assign dynamicCode = userInput?substring(startIdx + 3, endIdx)> | ||
${userInput?substring(0,startIdx)}<@dynamicCode?interpret />${userInput?substring(endIdx+3)}<#t> | ||
<#else > | ||
${userInput} | ||
</#if><#t> | ||
</#macro> | ||
<#if alertRules ?? && alertRules?size gt 0> | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: ${serviceFullName} | ||
spec: | ||
groups: | ||
- name: ${serviceFullName} | ||
rules: | ||
<#list alertRules as rule> | ||
- alert: ${rule.ruleName} | ||
expr: <@executeDynamicCode rule.promql /> | ||
labels: | ||
receiver: "webhook" | ||
alertLevel: "${rule.alertLevel}" | ||
clusterId: "${rule.clusterId}" | ||
serviceRoleName: "${rule.stackRoleName}" | ||
serviceName: "${rule.stackServiceName}" | ||
annotations: | ||
alertAdvice: "${rule.alertAdvice}" | ||
alertInfo: "${rule.alertInfo}" | ||
</#list> | ||
</#if> |
28 changes: 28 additions & 0 deletions
28
cloudeon-stack/EDP-2.0.0/amoro/service-common/bootstrap.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
\cp -f /opt/service-render-output/* $AMORO_HOME/conf/ | ||
|
||
mv $AMORO_HOME/conf/flink-conf.yaml $FLINK_HOME/conf/ | ||
|
||
\cp -f /etc/hdfs-config/* $HADOOP_CONF_DIR | ||
\cp -f /etc/yarn-config/* $HADOOP_CONF_DIR | ||
|
||
mkdir -p /workspace/logs | ||
rm -rf $AMORO_HOME/logs | ||
ln -s /workspace/logs $AMORO_HOME/logs | ||
|
||
ams.sh start | ||
|
||
until find /workspace/logs -mmin -1 -type f -name '*.log' ! -name '*gc*' | grep -q . | ||
do | ||
echo "`date`: Waiting for logs..." | ||
sleep 2 | ||
done | ||
find /workspace/logs -mmin -1 -type f -name '*.log' ! -name '*gc*' -exec tail -F {} + | ||
|
||
echo "---------------------------------------------开始----------------------------------------------" | ||
tail -f /dev/null | ||
|
||
|
||
|
11 changes: 11 additions & 0 deletions
11
cloudeon-stack/EDP-2.0.0/amoro/service-common/filebeat.input.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- type: log | ||
enabled: true | ||
fields: | ||
service: AMORO | ||
role: AMORO_AMS | ||
paths: | ||
- /workspace/logs/ams*.log | ||
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}' | ||
multiline.negate: true | ||
multiline.match: after | ||
close_timeout: 5m |
Oops, something went wrong.