prontera / spring-cloud-rest-tcc

以Spring Cloud Netflix作为服务治理基础, 展示基于tcc思想所实现的分布式事务解决方案
2.58k stars 1.21k forks source link

[个人建议]为basic和monitor的服务加上hostname,更便于单机部署学习 #41

Closed tanjianhui1979 closed 4 years ago

tanjianhui1979 commented 6 years ago

为basic和monitor的服务加上hostname如:

services:
    jce_java:
        build: ./docker-jce-jre
        image: pronter/jce-java
        read_only: true
        command: echo "jce java"
        environment:
            - TZ=Asia/Shanghai
    gateway:
        hostname: gateway
        build: ./api-gateway-ms
        image: prontera/gateway-ms
        ports:
            - "7291:7291"
            - "10211:10211"
        depends_on:
            - 'jce_java'
        environment:
            - TZ=Asia/Shanghai

然后在主机hosts文件中为所有服务hostname映射: 127.0.0.1 solar_mysql 127.0.0.1 rabbitmq 127.0.0.1 eureka1 127.0.0.1 eureka2 127.0.0.1 config_server 127.0.0.1 zipkin_server 127.0.0.1 gateway 127.0.0.1 hystrix_dashboard 127.0.0.1 spring_boot_admin 127.0.0.1 zipkin_server 127.0.0.1 account 127.0.0.1 membership 127.0.0.1 product 127.0.0.1 tcc_coordinator

prontera commented 6 years ago

十分感谢,因为当初考虑到是单机学习,所以我直接使用的是localhost进行访问,您的提议也是可以的,我会把这列为一个enhancement。