微服务应用部署笔记

History

运行jar文件,指定配置文件
  • java -jar eurekaserver-0.0.1-SNAPSHOT.jar --spring.profiles.active=peer1

DockerSwarm

  • docker service create --name eureka-server --publish 8761:8761 --replicas 3 --network docker-net 10.128.222.245:5000/eureka-server

  • docker service create --name ydmh-api-zdhd --publish 2219:2219 --replicas 2 --network docker-net 10.128.222.245:5000/ydmh-api-zdhd

  • docker service create --name zuul-server --publish 8081:8081 --network docker-net 10.128.222.245:5000/zuul-server
Docker
  • docker run -ti --name eureka-server -p 8761:8761 10.128.222.245:5000/eureka-server
  • docker run -ti --name zuul-server -p 8081:8081 10.128.222.245:5000/zuul-server
  • docker run -ti --name ydmh-api-zdhd -p 2219:2219 10.128.222.245:5000/ydmh-api-zdhd

服务名称
端口
备注
eureka
8761
http://10.128.223.234:8761/
zuul
8081
 
微服务应用
2219
api测试地址: http://10.128.223.234:8081/zdhd_api/swagger-ui.html
     

docker network create --driver overlay --subnet 10.0.9.0/24 my-network

docker network create --driver overlay --subnet 192.168.1.0/24 docker-net

你可能感兴趣的:(Docker,Kubernetes,DockerSwarm,Linux)