apiVersion: batch/v1beta1
kind: CronJob
metadata:
labels:
app: skywalking
chart: skywalking-2.0.0
component: mysw-v2-skywalking-job
heritage: Helm
release: mysw-v2
name: mysw-v2-es-init-cj
namespace: skywalking
spec:
schedule: "0 1 * * *"
jobTemplate:
spec:
template:
metadata: {}
spec:
containers:
- env:
- name: JAVA_OPTS
value: -Xmx2g -Xms2g -Dmode=init
- name: SW_STORAGE
value: elasticsearch7
- name: SW_STORAGE_ES_CLUSTER_NODES
value: XXXXX:9200
image: apache/skywalking-oap-server:7.0.0-es7
imagePullPolicy: IfNotPresent
name: skywalking-oap
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
restartPolicy: Never
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
Requirement or improvement
- Please describe about your requirements or improvement suggestions.
Now esinit is in the form of job and is only executed once against Skywalking Heml, the ALARM_Record in ES will not if there is no data that day The ALARM_Record will continue to be verified by the OAP, causing the POD to fail to start and get stuck in: table: alarm_record does not exist. OAP is running in 'no-init' mode, waiting,instead of CronJo The ALARM_Record can be rebuilt periodically to handle this, and the CronJo can be executed manually at any time to see if the scheme is viable.
Attached is the YAML file of CronJo I am using:
apiVersion: batch/v1beta1
kind: CronJob
metadata:
labels:
app: skywalking
chart: skywalking-2.0.0
component: mysw-v2-skywalking-job
heritage: Helm
release: mysw-v2
name: mysw-v2-es-init-cj
namespace: skywalking
spec:
schedule: "0 1 * * *"
jobTemplate:
spec:
template:
metadata: {}
spec:
containers:
- env:
- name: JAVA_OPTS
value: -Xmx2g -Xms2g -Dmode=init
- name: SW_STORAGE
value: elasticsearch7
- name: SW_STORAGE_ES_CLUSTER_NODES
value: XXXXX:9200
image: apache/skywalking-oap-server:7.0.0-es7
imagePullPolicy: IfNotPresent
name: skywalking-oap
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
restartPolicy: Never
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
Requirement or improvement