开发者社区 > 云原生 > 正文

图片上的Nacos问题怎么解决?

lQDPJxC_NMsCPrrNA1nNCeewoqI5rwWF84kEcEyyaUDDAA_2535_857.jpg 图片上的Nacos问题怎么解决?

展开
收起
三分钟热度的鱼 2023-06-06 15:48:28 145 0
1 条回答
写回答
取消 提交回答
  • apiVersion: apps/v1 kind: StatefulSet metadata: labels: app: nacos component: nacos middleware: nacos name: nacos namespace: nacos spec: podManagementPolicy: Parallel replicas: 3 revisionHistoryLimit: 10 selector: matchLabels: app: nacos component: nacos middleware: nacos serviceName: nacos-headless template: metadata: labels: app: nacos component: nacos middleware: nacos spec: containers: - command: - sh - -c - "array=(nacos-0.nacos-headless.nacos.svc.cluster.local nacos-1.nacos-headless.nacos.svc.cluster.local nacos-2.nacos-headless.nacos.svc.cluster.local )\nsucc = 0\n\nfor element in ${array[@]} \ndo\n while true\n do\n ping $element -c 1 > /dev/stdout\n \ if [[ $? -eq 0 ]]; then\n echo $element "all domain ready"\n \ break\n else\n echo $element "wait for other domain ready"\n \ fi\n sleep 1\n done\ndone\nsleep 1\n\necho "init success"&&bin/docker-startup.sh" env: - name: PREFER_HOST_MODE value: hostname - name: SPRING_DATASOURCE_PLATFORM value: mysql - name: MYSQL_SERVICE_HOST value: 192.168.123.50 - name: MYSQL_SERVICE_PORT value: "58665" - name: MYSQL_SERVICE_DB_NAME value: nacos - name: MYSQL_SERVICE_USER value: nacos - name: MYSQL_SERVICE_PASSWORD value: nacos - name: NACOS_REPLICAS value: "3" - name: NACOS_SERVERS value: nacos-0.nacos-headless.nacos.svc.cluster.local:8848 nacos-1.nacos-headless.nacos.svc.cluster.local:8848 nacos-2.nacos-headless.nacos.svc.cluster.local:8848 - name: NACOS_AUTH_IDENTITY_KEY value: "5FWxUrJ9WUepFmnW" - name: NACOS_AUTH_IDENTITY_VALUE value: "5FWxUrJ9WUepFmnW" - name: NACOS_AUTH_TOKEN value: "SecretKeyNUZXeFVySjlXVWVwRm1uVwo=" #- name: NACOS_AUTH_ENABLE # value: "true" image: nacos/nacos-server:v2.2.1 imagePullPolicy: IfNotPresent name: nacos ports: - containerPort: 8848 name: client protocol: TCP - containerPort: 7848 name: rpc protocol: TCP - containerPort: 9848 name: new-rpc protocol: TCP resources: limits: cpu: "2" memory: 2Gi requests: cpu: 100m memory: 512Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 updateStrategy: rollingUpdate: partition: 0 type: RollingUpdate

    apiVersion: v1 kind: Service metadata: name: nacos-headless namespace: nacos spec: clusterIP: None clusterIPs: - None internalTrafficPolicy: Cluster ipFamilies: - IPv4 ipFamilyPolicy: SingleStack ports: - name: client port: 8848 protocol: TCP targetPort: 8848 - name: rpc port: 7848 protocol: TCP targetPort: 7848 - name: new-rpc port: 9848 protocol: TCP targetPort: 9848 publishNotReadyAddresses: true selector: app: nacos component: nacos middleware: nacos sessionAffinity: None type: ClusterIP

    apiVersion: v1 kind: Service metadata: annotations: labels: app: nacos component: nacos middleware: nacos name: nacos namespace: nacos spec: internalTrafficPolicy: Cluster ipFamilies: - IPv4 ipFamilyPolicy: SingleStack ports: - name: client port: 8848 protocol: TCP targetPort: 8848 publishNotReadyAddresses: true selector: app: nacos component: nacos middleware: nacos sessionAffinity: None type: NodePort

    此回答整理自钉群“Nacos社区群3”

    2023-06-06 15:54:40
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

热门讨论

热门文章

相关电子书

更多
Nacos架构&原理 立即下载
workshop专场-微服务专场-开发者动手实践营-微服务-使用Nacos进行服务的动态发现和流量调度 立即下载
Nacos 启航,发布第一个版本, 云原生时代助力用户微服务平台建设 立即下载