dxlance11 commented on issue #7361:
URL: 
https://github.com/apache/incubator-seata/issues/7361#issuecomment-2908996836

   > > 同问,似乎只有raft集群模式可以实现
   > 
   > 有试验过吗?
   
   ---
   apiVersion: v1
   kind: ConfigMap
   metadata:
     name: seata-server-config
     namespace: seata
   data:
     application.yml: |
       server:
         port: 7091
       
       console:
         user:
           username: seata
           password: seata
   
       spring:
         application:
           name: seata-server
   
       logging:
         file:
           path: /tmp/seata-logs
         level:
           root: INFO
           io.seata: DEBUG
         pattern:
           console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} 
- %msg%n"
   
       seata:
         server:
           raft:
             group: default
             server-addr: 
seata-server-0.seata-server.seata.svc.cluster.local:9091,seata-server-1.seata-server.seata.svc.cluster.local:9091,seata-server-2.seata-server.seata.svc.cluster.local:9091
             snapshot-interval: 600
             apply-batch: 32
             max-append-bufferSize: 262144
             max-replicator-inflight-msgs: 256
             disruptor-buffer-size: 16384
             election-timeout-ms: 1000
             reporter-enabled: false
             reporter-initial-delay: 60
             serialization: jackson
             compressor: none
             sync: true
             username: seata
             password: seata
         config:
           type: file
         registry:
           type: file
         store:
           mode: raft
           file:
             dir: /seata/sessionStore
         security:
           secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
           tokenValidityInMilliseconds: 1800000
           ignore:
             urls: 
/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.jpeg,/**/*.ico,/api/v1/auth/login,/version.json,/metadata/v1/**
   
   ---
   apiVersion: v1
   kind: Service
   metadata:
     name: seata-server
     namespace: seata
     labels:
       app.kubernetes.io/name: seata-server
   spec:
     type: ClusterIP
     clusterIP: None  # 设置为Headless Service
     ports:
       - port: 8091
         protocol: TCP
         targetPort: 8091
         name: http
       - port: 7091
         protocol: TCP
         targetPort: 7091
         name: web
       - port: 9091
         protocol: TCP
         targetPort: 9091
         name: raft
     selector:
       app.kubernetes.io/name: seata-server
   
   ---
   # 创建一个普通Service用于外部访问
   apiVersion: v1
   kind: Service
   metadata:
     name: seata-server-external
     namespace: seata
     labels:
       app.kubernetes.io/name: seata-server
   spec:
     type: ClusterIP
     ports:
       - port: 8091
         protocol: TCP
         targetPort: 8091
         name: http
       - port: 7091
         protocol: TCP
         targetPort: 7091
         name: web
     selector:
       app.kubernetes.io/name: seata-server
   
   ---
   apiVersion: apps/v1
   kind: StatefulSet
   metadata:
     name: seata-server
     namespace: seata
     labels:
       app.kubernetes.io/name: seata-server
   spec:
     serviceName: seata-server
     replicas: 3
     selector:
       matchLabels:
         app.kubernetes.io/name: seata-server
     template:
       metadata:
         labels:
           app.kubernetes.io/name: seata-server
       spec:
         containers:
           - name: seata-server
             image: docker.io/apache/seata-server:2.4.0
             imagePullPolicy: IfNotPresent
             env:
               - name: TZ
                 value: Asia/Shanghai
               - name: SEATA_IP
                 valueFrom:
                   fieldRef:
                     fieldPath: status.podIP
             ports:
               - name: http
                 containerPort: 8091
                 protocol: TCP
               - name: console
                 containerPort: 7091
                 protocol: TCP
               - name: raft
                 containerPort: 9091
                 protocol: TCP
             volumeMounts:
               - mountPath: /seata-server/resources/application.yml
                 name: seata-config
                 subPath: application.yml
               - name: seata-data
                 mountPath: /seata/sessionStore
         volumes:
           - name: seata-config
             configMap:
               name: seata-server-config
     volumeClaimTemplates:
       - metadata:
           name: seata-data
         spec:
           accessModes: ["ReadWriteOnce"]
           resources:
             requests:
               storage: 10Gi
           storageClassName: local-hostpath
   我的部署文档,你可以参考一下


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to