7.0上手指南

git地址

源码:

https://gitee.com/enation/b2b2c.git

注意,要将b2b2c做为主Project,其它都属于他的Moudle

配置文件

https://gitee.com/enation/b2b2c-config.git

启动工程

一、指定配置服务git uri

/b2b2c/config-server/src/main/resources/application.properties 为你的config根目录:

spring.profiles.active=native
spring.cloud.config.server.native.search-locations=/opt/v70/b2b2c-config

二、修改总配置文件

修改config目录中的application.yml:

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/youdb
    username: root
    password: pwd
    driver-class-name: com.mysql.jdbc.Driver


  rabbitmq:
    host: 127.0.0.1
    port: 5672
    username: kingapex
    password: wangfeng

logging:
  level:
    org.springframework: ERROR
    com.enation.app : ERROR

redis:
  type: standalone
  config :
    type: manual
  host: 127.0.0.1
  port: 6379
  password:
  maxIdle: 500
  maxTotal: 500
  maxWaitMillis: -1

将mysql,redis,rabbitmq 配置好。

参考:配置中心教程

三、启动配置工程

启动 config-server

四、启动其它工程

配置工程启动后,默认是localhost:8888

其它工程已经默认指向这里,我直接启动其它工程就好。

如果需要指向其它config-server,您只需要修改/config/bootstrap.yml 文件中uri的指向

则所有工程均会生效

results matching ""

    No results matching ""