您的位置:首页 > 财经 > 金融 > 网页客服聊天系统_浏览国外服务器的网站_淄博seo推广_天津百度网站快速排名

网页客服聊天系统_浏览国外服务器的网站_淄博seo推广_天津百度网站快速排名

2024/10/31 3:05:00 来源:https://blog.csdn.net/qq_36669347/article/details/143211051  浏览:    关键词:网页客服聊天系统_浏览国外服务器的网站_淄博seo推广_天津百度网站快速排名
网页客服聊天系统_浏览国外服务器的网站_淄博seo推广_天津百度网站快速排名

一、构建eureka集群镜像

1、编写dockerfile文件,此处基础镜像为arm版本,eureka目录中文件内容:application-dev.yml、Dockerfile、eureka-server-1.0-SNAPSHOT.jar(添加登录认证模块,文章最后附上下载连接)

FROM  mdsol/java8-jdk-arm:latest
COPY eureka /opt/eureka
RUN chmod -R 777 /opt/eureka/*
ENTRYPOINT ["java","-jar","/opt/eureka/eureka-server-1.0-SNAPSHOT.jar","--spring.config.location=classpath:/bootstrap.yml,/opt/eureka/application-dev.yml","&"]

2、配置文件基础信息,application-dev.yml ,此处可忽略暂不修改

spring:application:name: eurekaServerjackson:date-format: yyyy-MM-dd HH:mm:sstime-zone: GMT+8default-property-inclusion: non_nullsecurity:user:name: eurekapassword: e4!u$8&R*kA111
server:port: 8761
eureka:instance:hostname: 10.10.127.106lease-expiration-duration-in-seconds: 60server:enable-self-preservation: falseeviction-interval-timer-in-ms: 30000client:#不向Eureka注册自己register-with-eureka: false#不检查其他的EurekaServer节点fetch-registry: falseservice-url:#设置eureka服务器所在的地址,查询服务和注册服务程序都注册到这个地址(服务暴露的地址)defaultZone: http://10.10.127.106:8761/eureka/

 二、使用有状态服务StatefulSet部署eureka集群

 1、配置文件使用configmap挂载至eureka集群中,账号密码可以自己调整修改

apiVersion: v1
data:application.yml: |spring:application:name: eurekaServerjackson:date-format: yyyy-MM-dd HH:mm:sstime-zone: GMT+8default-property-inclusion: non_nullsecurity:user:name: usrpassword: passwordserver:port: 8761eureka:instance:hostname: eurekalease-expiration-duration-in-seconds: 60server:enable-self-preservation: trueeviction-interval-timer-in-ms: 3000client:#不向Eureka注册自己register-with-eureka: true#不检查其他的EurekaServer节点fetch-registry: trueservice-url:#设置eureka服务器所在的地址,查询服务和注册服务程序都注册到这个地址(服务暴露的地址)defaultZone: http://usr:password@eureka-dev-0.eureka-dev:8761/eureka/,http://usr:password@eureka-dev-1.eureka-dev:8761/eureka/,http://uer:password@eureka-dev-2.eureka-dev:8761/eureka/
kind: ConfigMap
metadata:name: eureka-config-devnamespace: paas

2、service 配置文件内容,eureka-svc.yaml

apiVersion: v1
kind: Service
metadata:name: eureka-devnamespace: paas
spec:ports:- name: httpport: 8761protocol: TCPtargetPort: 8761selector:app: eureka-devtype: NodePort

3、StatefulSet 文件信息,eureka-sts.yaml ,需修改参数 EUREKA_CLIENT_SERVICEURL_DEFAULTZONE ,启动命令需配置configmap文件同步修改,可保持默认启动。

apiVersion: apps/v1
kind: StatefulSet
metadata:labels:app: eureka-devname: eureka-devnamespace: paas
spec:replicas: 3selector:matchLabels:app: eureka-devserviceName: eureka-devtemplate:metadata:creationTimestamp: nulllabels:app: eureka-devspec:containers:- args:- --spring.config.location=classpath:/bootstrap.yml,/opt/eureka/application.ymlcommand:- java- -jar- /opt/eureka/eureka-server-1.0-SNAPSHOT.jarenv:- name: EUREKA_INSTANCE_HOSTNAMEvalue: $(POD_NAME)- name: EUREKA_INSTANCE_IDvalue: $(POD_NAME)- name: EUREKA_CLIENT_SERVICEURL_DEFAULTZONEvalue: http://usr:password@eureka-dev-0.eureka-dev:8761/eureka/,http://usr:password@eureka-dev-1.eureka-dev:8761/eureka/,http://usr:password@eureka-dev-2.eureka-dev:8761/eureka/image: harbor.dcos.xixian.unicom.local/armtianti/cetp-eureke-arm-dev:latestimagePullPolicy: IfNotPresentname: eureka-devports:- containerPort: 8761protocol: TCPterminationMessagePath: /dev/termination-logterminationMessagePolicy: FilevolumeMounts:- mountPath: /opt/eureka/application.ymlname: eureka-config-devsubPath: application.ymlvolumes:- configMap:defaultMode: 420items:- key: application.ymlpath: application.ymlname: eureka-config-devname: eureka-config-dev

4、查看集群部署状态

5、登录eureka集群,查看是否已添加登录认证,此处登录地址 http://masterIP:nodeport 方式登录

 eureka-server-1.0-SNAPSHOT.jar 下载地址:

https://pan.baidu.com/s/1RVPxZ_1riYlAWcL6_At8Ew

提取码:kuer

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com