这边nacos1.4.0启动,集群中一直有两个leader ,能给看看吗?apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nacos
spec:
podManagementPolicy: Parallel
serviceName: nacos-headless
template:
metadata:
labels:
app: nacos
annotations:
pod.alpha.kubernetes.io/initialized: "true"
spec:
initContainers:
- name: peer-finder-plugin-install
image: 'registry-vpc.cn-zhangjiakou.aliyuncs.com/youyierp/nacos-peer-finder-plugin:1.0'
imagePullPolicy: Always
volumeMounts:
- mountPath: "/home/nacos/plugins/peer-finder"
name: plugindir
containers:
- name: nacos
imagePullPolicy: Always
image: ''
resources:
requests:
memory: "3Gi"
cpu: "2"
limits:
memory: "5Gi"
cpu: "4"
readinessProbe:
exec:
command:
- /bin/bash
- -c
- 'line=`ps -elf | grep java | grep -v grep | wc -l`; if [ $line -gt 0 ];then echo "success"; exit 0; else exit 1 ;fi'
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
failureThreshold: 5
livenessProbe:
httpGet:
path: "/nacos/actuator/health"
port: 8848
initialDelaySeconds: 240
periodSeconds: 5
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
ports:
- containerPort: 8848
name: client-port
- containerPort: 7848
name: rpc
env:
- name: MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE
value: "*"
- name: NACOS_REPLICAS
value: "3"
- name: SERVICE_NAME
value: "nacos-headless"
- name: DOMAIN_NAME
value: "cluster.local"
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: MYSQL_SERVICE_HOST
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.host
- name: MYSQL_SERVICE_DB_NAME
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.db.name
- name: MYSQL_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.port
- name: MYSQL_SERVICE_USER
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.user
- name: MYSQL_SERVICE_PASSWORD
valueFrom:
configMapKeyRef:
name: nacos-config
key: mysql.password
- name: NACOS_SERVER_PORT
value: "8848"
- name: NACOS_APPLICATION_PORT
value: "8848"
- name: PREFER_HOST_MODE
value: "hostname"
- name: NACOS_CORE_AUTH_ENABLED
value: "true"
volumeMounts:
- name: plugindir
mountPath: /home/nacos/plugins/peer-finder
- name: datadir
mountPath: /home/nacos/data
- name: logdir
mountPath: /home/nacos/logs
volumeClaimTemplates:
- metadata:
name: plugindir
spec:
accessModes:
- ReadWriteMany
resources:
requests:
# 容量
storage: 3Gi
# 存储类名称
storageClassName: nacos-plugindir
- metadata:
name: datadir
spec:
accessModes:
- ReadWriteMany
resources:
requests:
# 容量
storage: 3Gi
# 存储类名称
storageClassName: nacos-datadir
- metadata:
name: logdir
spec:
accessModes:
- ReadWriteMany
resources:
requests:
# 容量
storage: 3Gi
# 存储类名称
storageClassName: nacos-logdir
selector:
matchLabels:
app: nacos 按照这个配置文件,启动之后,一直有两个master。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。