李明
|
mesos的服务发现
修改配置文件适应mesos的方式
通过域名的方式来访问,然后在每个slave机器上绑定一个host server.name=user-edge-service server.port=8082 thrift.user.ip=lb.idig88.com#thrift.user.ip=127.0.0.1thrift.user.port=10001 thrift.message.ip=lb.idig88.com thrift.message.port=10002#redis configspring.redis.host=${redis.address}#spring.redis.host=127.0.0.1spring.redis.port=6379 spring.redis.password=liming spring.redis.timeout=30000
server.port=8081#dubbo configspring.dubbo.application.name=course-dubbo-service spring.dubbo.registry.address=zookeeper://${zookeeper.address}:2181#spring.dubbo.registry.address=zookeeper://127.0.0.1:2181spring.dubbo.scan=com.idig8.course user.edge.service.addr=lb.idig88.com:10003
#dubbo 配置 spring.dubbo.application.name=course-dubbo-service spring.dubbo.registry.address=zookeeper://${zookeeper.address}:2181#spring.dubbo.registry.address=zookeeper://127.0.0.1:2181 spring.dubbo.protocol.name=dubbo spring.dubbo.protocol.port=20880 #spring.dubbo.protocol.host=127.0.0.1 spring.dubbo.scan=com.idig8.course #数据源的配置 spring.datasource.url=jdbc:mysql://${mysql.address}:3306/db_course#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/db_course spring.datasource.username=root spring.datasource.password=root spring.datasource.driver-class-name=com.mysql.jdbc.Driver thrift.user.ip=lb.idig88.com #thrift.user.ip=127.0.0.1 thrift.user.port=10001
server: port: 8080 spring: application: name: gateway-zuu cloud: gateway: routes: - id: course-edge-service uri: http://lb.idig88.com:10004 predicates: - Path=/course/** - id: user-edge-service uri: http://lb.idig88.com:10003 predicates: - Path=/user/** logging: level: org.springframework.cloud.gateway: debug
# 服务名称=新端口/老端口user-thrift-service=10001/7911 message-thrift-python-service=10002/9000 user.edge.service=10003/8082 course-edge-service=10004/8081 gayway-zuul-service=10005: PS:代码的微服务调整已经完毕,下一步连接mesos开始部署。
|
2019-02-11 23:12:17