繁体   English   中英

WSO2 身份服务器关闭挂钩已触发

[英]WSO2 Identity Server Shutdown hook triggered

我正在尝试使用 helm 启动 WSO2 身份服务器,并且在 MAILTO 发件人启动后服务器突然关闭。

我在此处关注 wso2 文档以使用 helm 进行设置。

sql 服务器,一切正常。 当我查看身份服务器 pod 的日志时,跟踪显示启动关闭挂钩的错误。 没有关于背后原因的其他信息。

以下是用于部署服务器的 helm 图表:

kind: StatefulSet
metadata:
  name: wso2is-pattern-1-identity-server-statefulset
  namespace: wso2local
  uid: c00d52bc-d099-488b-9ff9-69cb7fbf7a99
  resourceVersion: '76433'
  generation: 5
  creationTimestamp: '2022-09-01T10:03:30Z'
  labels:
    app.kubernetes.io/managed-by: Helm
  annotations:
    meta.helm.sh/release-name: wso2-test
    meta.helm.sh/release-namespace: wso2local
  managedFields:
    - manager: helm
      operation: Update
      apiVersion: apps/v1
      time: '2022-09-01T10:03:30Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:meta.helm.sh/release-name: {}
            f:meta.helm.sh/release-namespace: {}
          f:labels:
            .: {}
            f:app.kubernetes.io/managed-by: {}
        f:spec:
          f:podManagementPolicy: {}
          f:replicas: {}
          f:revisionHistoryLimit: {}
          f:selector: {}
          f:serviceName: {}
          f:template:
            f:metadata:
              f:annotations:
                .: {}
                f:checksum.is.bin: {}
                f:checksum.is.conf: {}
              f:labels:
                .: {}
                f:deployment: {}
                f:monitoring: {}
            f:spec:
              f:containers:
                k:{"name":"identity-server"}:
                  .: {}
                  f:env:
                    .: {}
                    k:{"name":"JVM_MEM_OPTS"}:
                      .: {}
                      f:name: {}
                      f:value: {}
                    k:{"name":"NODE_IP"}:
                      .: {}
                      f:name: {}
                      f:valueFrom:
                        .: {}
                        f:fieldRef: {}
                  f:image: {}
                  f:imagePullPolicy: {}
                  f:lifecycle:
                    .: {}
                    f:preStop:
                      .: {}
                      f:exec:
                        .: {}
                        f:command: {}
                  f:livenessProbe:
                    .: {}
                    f:failureThreshold: {}
                    f:httpGet:
                      .: {}
                      f:path: {}
                      f:port: {}
                      f:scheme: {}
                    f:periodSeconds: {}
                    f:successThreshold: {}
                  f:name: {}
                  f:ports:
                    .: {}
                    k:{"containerPort":9443,"protocol":"TCP"}:
                      .: {}
                      f:containerPort: {}
                      f:protocol: {}
                    k:{"containerPort":9763,"protocol":"TCP"}:
                      .: {}
                      f:containerPort: {}
                      f:protocol: {}
                  f:readinessProbe:
                    .: {}
                    f:failureThreshold: {}
                    f:httpGet:
                      .: {}
                      f:path: {}
                      f:port: {}
                      f:scheme: {}
                    f:periodSeconds: {}
                    f:successThreshold: {}
                  f:resources:
                    .: {}
                    f:limits:
                      .: {}
                      f:cpu: {}
                      f:memory: {}
                    f:requests:
                      .: {}
                      f:cpu: {}
                      f:memory: {}
                  f:securityContext:
                    .: {}
                    f:runAsUser: {}
                  f:startupProbe:
                    .: {}
                    f:exec:
                      .: {}
                      f:command: {}
                    f:failureThreshold: {}
                    f:periodSeconds: {}
                    f:successThreshold: {}
                    f:timeoutSeconds: {}
                  f:terminationMessagePath: {}
                  f:terminationMessagePolicy: {}
                  f:volumeMounts:
                    .: {}
                    k:{"mountPath":"/home/wso2carbon/wso2-artifact-volume/repository/components/dropins"}:
                      .: {}
                      f:mountPath: {}
                      f:name: {}
                    k:{"mountPath":"/home/wso2carbon/wso2-config-volume/bin"}:
                      .: {}
                      f:mountPath: {}
                      f:name: {}
                    k:{"mountPath":"/home/wso2carbon/wso2-config-volume/repository/conf/deployment.toml"}:
                      .: {}
                      f:mountPath: {}
                      f:name: {}
                      f:subPath: {}
              f:dnsPolicy: {}
              f:initContainers:
                .: {}
                k:{"name":"init-is-db"}:
                  .: {}
                  f:command: {}
                  f:image: {}
                  f:imagePullPolicy: {}
                  f:name: {}
                  f:resources: {}
                  f:terminationMessagePath: {}
                  f:terminationMessagePolicy: {}
                k:{"name":"init-mysql-connector-download"}:
                  .: {}
                  f:command: {}
                  f:image: {}
                  f:imagePullPolicy: {}
                  f:name: {}
                  f:resources: {}
                  f:terminationMessagePath: {}
                  f:terminationMessagePolicy: {}
                  f:volumeMounts:
                    .: {}
                    k:{"mountPath":"/mysql-connector-jar"}:
                      .: {}
                      f:mountPath: {}
                      f:name: {}
              f:restartPolicy: {}
              f:schedulerName: {}
              f:securityContext: {}
              f:serviceAccount: {}
              f:serviceAccountName: {}
              f:terminationGracePeriodSeconds: {}
              f:volumes:
                .: {}
                k:{"name":"identity-server-bin"}:
                  .: {}
                  f:configMap:
                    .: {}
                    f:defaultMode: {}
                    f:name: {}
                  f:name: {}
                k:{"name":"identity-server-conf"}:
                  .: {}
                  f:configMap:
                    .: {}
                    f:defaultMode: {}
                    f:name: {}
                  f:name: {}
                k:{"name":"mysql-connector-jar"}:
                  .: {}
                  f:emptyDir: {}
                  f:name: {}
          f:updateStrategy:
            f:rollingUpdate:
              .: {}
              f:partition: {}
            f:type: {}
    - manager: kube-controller-manager
      operation: Update
      apiVersion: apps/v1
      time: '2022-09-01T10:12:48Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:status:
          f:collisionCount: {}
          f:currentReplicas: {}
          f:currentRevision: {}
          f:observedGeneration: {}
          f:replicas: {}
          f:updateRevision: {}
      subresource: status
    - manager: node-fetch
      operation: Update
      apiVersion: apps/v1
      time: '2022-09-01T11:22:16Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:spec:
          f:template:
            f:spec:
              f:containers:
                k:{"name":"identity-server"}:
                  f:livenessProbe:
                    f:timeoutSeconds: {}
                  f:readinessProbe:
                    f:initialDelaySeconds: {}
                    f:timeoutSeconds: {}
                  f:startupProbe:
                    f:initialDelaySeconds: {}
  selfLink: >-
    /apis/apps/v1/namespaces/wso2local/statefulsets/wso2is-pattern-1-identity-server-statefulset
status:
  observedGeneration: 5
  replicas: 1
  currentReplicas: 1
  currentRevision: wso2is-pattern-1-identity-server-statefulset-64cc67fc85
  updateRevision: wso2is-pattern-1-identity-server-statefulset-57c444f47c
  collisionCount: 0
  availableReplicas: 0
spec:
  replicas: 2
  selector:
    matchLabels:
      deployment: wso2is
      monitoring: jmx
  template:
    metadata:
      creationTimestamp: null
      labels:
        deployment: wso2is
        monitoring: jmx
      annotations:
        checksum.is.bin: cb0616cf02f9ede88abc214692596be0481794ba7c6437b96b5665949ba030eb
        checksum.is.conf: a108b1792060c91aa6424fadc6626ea97c7b669be0fd05978a02fb89f0f2a537
    spec:
      volumes:
        - name: identity-server-conf
          configMap:
            name: wso2is-pattern-1-identity-server-conf
            defaultMode: 420
        - name: identity-server-bin
          configMap:
            name: wso2is-pattern-1-identity-server-bin
            defaultMode: 420
        - name: mysql-connector-jar
          emptyDir: {}
      initContainers:
        - name: init-is-db
          image: busybox:1.31
          command:
            - sh
            - '-c'
            - >-
              echo -e "Checking for the availability of MySQL Server
              deployment"; while ! nc -z wso2is-mysql-db-service 3306; do sleep
              1; printf "-"; done; echo -e "  >> MySQL Server has started";
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
        - name: init-mysql-connector-download
          image: busybox:1.32
          command:
            - /bin/sh
            - '-c'
            - >
              set -e

              connector_version=8.0.17

              wget
              https://repo1.maven.org/maven2/mysql/mysql-connector-java/${connector_version}/mysql-connector-java-${connector_version}.jar
              -P /mysql-connector-jar/
          resources: {}
          volumeMounts:
            - name: mysql-connector-jar
              mountPath: /mysql-connector-jar
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      containers:
        - name: identity-server
          image: wso2/wso2is:5.11.0
          ports:
            - containerPort: 9763
              protocol: TCP
            - containerPort: 9443
              protocol: TCP
          env:
            - name: NODE_IP
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: status.podIP
            - name: JVM_MEM_OPTS
              value: '-Xms1024m -Xmx2048m'
          resources:
            limits:
              cpu: '2'
              memory: 4Gi
            requests:
              cpu: '1'
              memory: 2Gi
          volumeMounts:
            - name: identity-server-conf
              mountPath: >-
                /home/wso2carbon/wso2-config-volume/repository/conf/deployment.toml
              subPath: deployment.toml
            - name: identity-server-bin
              mountPath: /home/wso2carbon/wso2-config-volume/bin
            - name: mysql-connector-jar
              mountPath: >-
                /home/wso2carbon/wso2-artifact-volume/repository/components/dropins
          livenessProbe:
            httpGet:
              path: /carbon/admin/login.jsp
              port: 9443
              scheme: HTTPS
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /api/health-check/v1.0/health
              port: 9443
              scheme: HTTPS
            initialDelaySeconds: 100
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          startupProbe:
            exec:
              command:
                - /bin/sh
                - '-c'
                - nc -z localhost 9443
            initialDelaySeconds: 300
            timeoutSeconds: 1
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 30
          lifecycle:
            preStop:
              exec:
                command:
                  - sh
                  - '-c'
                  - ${WSO2_SERVER_HOME}/bin/wso2server.sh stop
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
          securityContext:
            runAsUser: 802
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: wso2is-pattern-1-svc-account
      serviceAccount: wso2is-pattern-1-svc-account
      securityContext: {}
      schedulerName: default-scheduler
  serviceName: wso2is-pattern-1-identity-service
  podManagementPolicy: OrderedReady
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      partition: 0
  revisionHistoryLimit: 10

这是日志跟踪:

[2022-09-01 11:26:49,499] []  INFO {org.wso2.carbon.humantask.deployer.HumanTaskDeployer} - Initializing HumanTask Deployer for tenant -1234.
[2022-09-01 11:26:49,581] []  INFO {org.apache.axis2.transport.mail.MailTransportSender} - MAILTO Sender started
[2022-09-01 11:26:56,787] []  INFO {org.wso2.carbon.core.init.CarbonServerManager} - Shutdown hook triggered....
[2022-09-01 11:26:56,782] []  INFO {org.wso2.carbon.bpel.core.internal.BPELServiceComponent} - Shutting down BPEL Server........
[2022-09-01 11:26:57,055] []  INFO {org.apache.ode.bpel.engine.BpelServerImpl} - BPEL Server Stopped.
[2022-09-01 11:26:57,077] []  INFO {org.wso2.carbon.core.init.CarbonServerManager} - Gracefully shutting down WSO2 Identity Server...
[2022-09-01 11:26:57,143] []  INFO {org.wso2.carbon.core.ServerManagement} - Starting to switch to maintenance mode...
[2022-09-01 11:26:57,152] []  INFO {org.wso2.carbon.core.ServerManagement} - Stopped all transport listeners
[2022-09-01 11:26:57,155] []  INFO {org.wso2.carbon.core.ServerManagement} - Waiting for request service completion...
[2022-09-01 11:26:57,180] []  INFO {org.wso2.carbon.bpel.core.ode.integration.BPELServerImpl} - BPEL Server shutdown completed.
[2022-09-01 11:26:57,191] []  INFO {org.wso2.carbon.core.ServerManagement} - All requests have been served.
[2022-09-01 11:26:57,193] []  INFO {org.wso2.carbon.core.ServerManagement} - Waiting for deployment completion...
[2022-09-01 11:26:57,253] []  INFO {org.wso2.carbon.core.ServerManagement} - All deployment tasks have been completed.
[2022-09-01 11:26:57,255] []  INFO {org.wso2.carbon.core.ServerManagement} - Waiting for server task completion...
[2022-09-01 11:26:57,271] []  INFO {org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent} - Writing logs 
[2022-09-01 11:26:57,486] []  INFO {org.wso2.carbon.humantask.core.HumanTaskServerShutdown} - Shutting down human task scheduler
[2022-09-01 11:26:57,540] []  INFO {org.wso2.carbon.core.ServerManagement} - All server tasks have been completed.
[2022-09-01 11:26:57,542] []  INFO {org.wso2.carbon.core.init.CarbonServerManager} - Shutting down WSO2 Identity Server...
[2022-09-01 11:26:57,987] []  INFO {org.wso2.carbon.core.init.CarbonServerManager} - Shutting down OSGi framework...
[2022-09-01 11:26:58,142]  INFO {org.wso2.carbon.core.init.CarbonServerManager} - Shutdown complete 

对于容器,生命周期钩子定义如下。 根据共享数据,容器似乎没有在时间间隔内启动,它已经触发了生命周期钩子。

 lifecycle:
            preStop:
              exec:
                command:
                  - sh
                  - '-c'
                  - ${WSO2_SERVER_HOME}/bin/wso2server.sh stop

您可以移除探针并让容器先启动,否则您也可以调整探针配置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM