docker-compose 部署读取不到配置${blade.datasource.dev.url}

Blade 未结 3 1777
luying777
luying777 2021-08-16 15:54
悬赏:5

一、该问题的重现步骤是什么?

1. 部署在docker 里,通过.env 文件进行配置;不管是配置 dev,test,prod 都拿不到配置;

2.  获取不到 配置,java.sql.SQLException: connect error, url ${blade.datasource.dev.url}, driverClass com.mysql.cj.jdbc.Driver

3.但是,如果不通过.env 配置 spring.profiles.active=${PROFILE} 

blade-auth1:
  image: "${REGISTER}/blade-auth:${TAG}"
  environment:
    - TZ=Asia/Shanghai
  privileged: true
  restart: always
  networks:
    blade_net:
      ipv4_address: 172.30.0.91

codker-compose.yml 这样部署的话,默认获取test,运行正常;

但如果用下面方式部署

blade-auth1:
  image: "${REGISTER}/blade-auth:${TAG}"
  environment:
    - TZ=Asia/Shanghai
  privileged: true
  restart: always
  command:
    - --spring.profiles.active=${PROFILE}
    - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}
    - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}
    - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}
    - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}
    - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}
    - --spring.cloud.nacos.config.group=${NACOS_GROUP}
    - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}
    - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}
    - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}
    - --sentinel.heartbeat.client.ip=${ADMIN_IP}
  networks:
    blade_net:
      ipv4_address: 172.30.0.91

PROFILE 不管是 dev,test,prod 都出以上错误,就是读取不到 nacos 的配置;

image.png

nacos 里监听不到任务记录;


二、你期待的结果是什么?实际看到的又是什么?

image.png

这个配置,应该是怎么样配置?有没有完整示例?

我想部署在docker里,profile 变量希望是 dev,test 可以切换的;


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladeX2.8.1 linux docker 

四、请提供详细的错误堆栈信息,这很重要。

----启动中,读取到的环境变量:[test],jar地址:[file:/blade/auth/app.jar]----

                   ______  _             _       ___   ___

                   | ___ \| |           | |      \  \ /  /

                   | |_/ /| |  __ _   __| |  ___  \  V  /

                   | ___ \| | / _` | / _` | / _ \   > <

                   | |_/ /| || (_| || (_| ||  __/ /  .  \

                   \____/ |_| \__,_| \__,_| \___|/__/ \__\


:: BladeX 2.8.1.RELEASE :: blade-auth:test :: Running SpringBoot 2.2.13.RELEASE ::


2021-08-16 15:38:47.283  INFO 1 --- [           main] c.a.n.c.c.impl.LocalConfigInfoProcessor  : LOCAL_SNAPSHOT_PATH:/root/nacos/config

2021-08-16 15:38:47.485  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 148 ms to scan 1 urls, producing 3 keys and 6 values

2021-08-16 15:38:47.582  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 68 ms to scan 1 urls, producing 4 keys and 9 values

2021-08-16 15:38:47.651  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 62 ms to scan 1 urls, producing 3 keys and 10 values

2021-08-16 15:38:48.205  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 546 ms to scan 266 urls, producing 0 keys and 0 values

2021-08-16 15:38:48.247  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 41 ms to scan 1 urls, producing 1 keys and 5 values

2021-08-16 15:38:48.317  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 65 ms to scan 1 urls, producing 1 keys and 7 values

2021-08-16 15:38:48.373  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 50 ms to scan 1 urls, producing 2 keys and 8 values

2021-08-16 15:38:48.932  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 554 ms to scan 266 urls, producing 0 keys and 0 values

2021-08-16 15:38:48.934  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]RpcClient init label, labels={module=config, Vipserver-Tag=null, source=sdk, Amory-Tag=null, Location-Tag=null, taskId=0, AppName=unknown}

2021-08-16 15:38:48.935  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$261/000000003454EAC0

2021-08-16 15:38:48.936  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$262/000000003454F390

2021-08-16 15:38:48.937  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1

2021-08-16 15:38:48.939  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]RpcClient init, ServerListFactory =com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2

2021-08-16 15:38:48.946  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8] Try to connect to server on start up, server: {serverIp='172.30.0.48', server main port=8848}

2021-08-16 15:38:50.889  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8] Success to connect to server [172.30.0.48:8848] on start up,connectionId=1629099530452_172.30.0.92_54294

2021-08-16 15:38:50.891  INFO 1 --- [t.remote.worker] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Notify connected event to listeners.

2021-08-16 15:38:50.892  INFO 1 --- [t.remote.worker] c.a.n.client.config.impl.ClientWorker    : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8] Connected,notify listen context...

2021-08-16 15:38:50.893  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler

2021-08-16 15:38:50.894  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$4

2021-08-16 15:38:51.095  INFO 1 --- [           main] c.a.nacos.client.config.impl.Limiter     : limitTime:5.0

2021-08-16 15:38:51.141  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade.yaml] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.154  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade-test.yaml] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.165  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade-auth] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.173  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade-auth.yaml] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.190  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade-auth-test.yaml] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.192  INFO 1 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-blade-auth-test.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade-auth.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade-auth,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade-test.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade.yaml,DEFAULT_GROUP'}]

2021-08-16 15:38:51.255  INFO 1 --- [           main] org.springblade.auth.AuthApplication     : The following profiles are active: test

2021-08-16 15:38:51.638  WARN 1 --- [           main] o.s.c.c.u.SpringFactoryImportSelector    : More than one implementation of @EnableCircuitBreaker (now relying on @Conditionals to pick one): [org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration, com.alibaba.cloud.sentinel.custom.SentinelCircuitBreakerConfiguration]

2021-08-16 15:38:58.528  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!

2021-08-16 15:38:58.536  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.

2021-08-16 15:38:58.659  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 17ms. Found 0 Redis repository interfaces.

2021-08-16 15:38:58.991  WARN 1 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.

2021-08-16 15:38:59.065  WARN 1 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'hystrix.stream' contains invalid characters, please migrate to a valid format.

2021-08-16 15:38:59.507  WARN 1 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[org.springblade.auth]' package. Please check your configuration.

2021-08-16 15:39:00.137  INFO 1 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=1ada99cf-dbaa-33fd-b2a9-af6a2ba20b64

2021-08-16 15:39:00.149  INFO 1 --- [           main] s.c.l.p.BladePropertySourcePostProcessor : BladePropertySourcePostProcessor init.

2021-08-16 15:39:00.149  INFO 1 --- [           main] s.c.l.p.BladePropertySourcePostProcessor : BladePropertySourcePostProcessor process @BladePropertySource bean.

2021-08-16 15:39:01.812  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.cloud.sentinel-com.alibaba.cloud.sentinel.SentinelProperties' of type [com.alibaba.cloud.sentinel.SentinelProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2021-08-16 15:39:02.049  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration' of type [com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2021-08-16 15:39:02.594  WARN 1 --- [           main] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used

2021-08-16 15:39:02.628  INFO 1 --- [           main] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext

2021-08-16 15:39:02.629  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 11224 ms

2021-08-16 15:39:03.014  WARN 1 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.

2021-08-16 15:39:03.014  INFO 1 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.

2021-08-16 15:39:03.052  INFO 1 --- [           main] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@e275730f

2021-08-16 15:39:04.264  INFO 1 --- [           main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource

2021-08-16 15:39:05.012 ERROR 1 --- [           main] com.alibaba.druid.pool.DruidDataSource   : init datasource error, url: ${blade.datasource.test.url}


java.sql.SQLException: connect error, url ${blade.datasource.test.url}, driverClass com.mysql.cj.jdbc.Driver

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1722) ~[druid-1.2.5.jar!/:1.2.5]

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:915) ~[druid-1.2.5.jar!/:1.2.5]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_262]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1920) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1862) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1525) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1489) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1378) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1265) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:409) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) [spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) [spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50) [blade-core-launch-2.8.1.RELEASE.jar!/:na]

at org.springblade.auth.AuthApplication.main(AuthApplication.java:35) [classes!/:na]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_262]

at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [app.jar:na]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [app.jar:na]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [app.jar:na]

at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [app.jar:na]


2021-08-16 15:39:05.033 ERROR 1 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} init error


java.sql.SQLException: connect error, url ${blade.datasource.test.url}, driverClass com.mysql.cj.jdbc.Driver

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1722) ~[druid-1.2.5.jar!/:1.2.5]

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:915) ~[druid-1.2.5.jar!/:1.2.5]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_262]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1920) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1862) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1525) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1489) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1378) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1265) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:409) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) [spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) [spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50) [blade-core-launch-2.8.1.RELEASE.jar!/:na]

at org.springblade.auth.AuthApplication.main(AuthApplication.java:35) [classes!/:na]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_262]

at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [app.jar:na]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [app.jar:na]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [app.jar:na]

at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [app.jar:na]


2021-08-16 15:39:05.034  INFO 1 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited

2021-08-16 15:39:05.035 ERROR 1 --- [eate--274000221] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: ${blade.datasource.test.url}, errorCode 0, state null


java.sql.SQLException: connect error, url ${blade.datasource.test.url}, driverClass com.mysql.cj.jdbc.Driver

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1722) ~[druid-1.2.5.jar!/:1.2.5]

at com.alibaba.druid.pool.Dr




3条回答
  •  luying777
    luying777 (楼主)
    2021-08-16 16:09

    样式出错了,后面添加的文件没有看到了;补充在这里

    .env  文件


    REGISTER=registry.cn-shanghai.aliyuncs.com/test_07077_cn

    TAG=2.8.1

    PROFILE=dev

    ADMIN_IP=192.168.100.157

    ADMIN_PORT=8848

    ADMIN_SENTINEL_PORT=8858

    NACOS_NAMESPACE=public

    NACOS_GROUP=DEFAULT_GROUP

    NACOS_SERVER_ADDR=172.30.0.48

    SENTINEL_DASHBOARD_ADDR=172.30.0.58

    DOCKERPATH=/docker



    deploy.sh文件


    #!/bin/bash


    #使用说明,用来提示输入参数

    usage() {

     echo "Usage: sh 执行脚本.sh [port|mount|base|monitor|modules|prometheus|alertmanager|stop|rm|rmiNoneTag]"

     exit 1

    }


    #开启所需端口

    port(){

        #ssh

     firewall-cmd --add-port=22/tcp --permanent

     #默认

     firewall-cmd --add-port=80/tcp --permanent



     #nginx-gateway

     firewall-cmd --add-port=88/tcp --permanent

     #nginx-web

     firewall-cmd --add-port=8000/tcp --permanent

     #nginx-word

     firewall-cmd --add-port=8001/tcp --permanent

      #nginx-exam

     firewall-cmd --add-port=8002/tcp --permanent



     #nacos

     firewall-cmd --add-port=8848/tcp --permanent

     firewall-cmd --add-port=9848/tcp --permanent

     firewall-cmd --add-port=9849/tcp --permanent

     #sentinel

     firewall-cmd --add-port=8858/tcp --permanent

     #grafana

     firewall-cmd --add-port=3000/tcp --permanent

     #mysql

     firewall-cmd --add-port=3306/tcp --permanent

     #redis

     firewall-cmd --add-port=3379/tcp --permanent

     #admin

     firewall-cmd --add-port=7002/tcp --permanent

     #turbine

     firewall-cmd --add-port=7003/tcp --permanent

     #ureport

     firewall-cmd --add-port=8108/tcp --permanent

     #zipkin

     firewall-cmd --add-port=9411/tcp --permanent

     #prometheus

     firewall-cmd --add-port=9090/tcp --permanent

     #flowdesign

     firewall-cmd --add-port=9999/tcp --permanent


     #blade-xxljob

     firewall-cmd --add-port=7008/tcp --permanent

     #blade-xxljob-admin

     firewall-cmd --add-port=7009/tcp --permanent


     #blade-flow

     firewall-cmd --add-port=8008/tcp --permanent

     #blade-flow-design

     firewall-cmd --add-port=9999/tcp --permanent


        #blade-develop

        rewall-cmd --add-port=7007/tcp --permanent


     #swagger

     firewall-cmd --add-port=18000/tcp --permanent

     #firewalld

     service firewalld restart

    }


    ##放置挂载文件

    mount(){

     #挂载配置文件

     if test ! -f "/docker/nginx/api/nginx.conf" ;then

      mkdir -p /docker/nginx/api

      cp nginx/api/nginx.conf /docker/nginx/api/nginx.conf

     fi

     if test ! -f "/docker/nginx/web/nginx.conf" ;then

      mkdir -p /docker/nginx/web

      cp nginx/web/nginx.conf /docker/nginx/web/nginx.conf

      cp -r nginx/web/html /docker/nginx/web/html

      ### 其他vue项目在这里复制

      cp -r nginx/web/word /docker/nginx/web/word

      cp -r nginx/web/exam /docker/nginx/web/exam

     fi


     if test ! -f "/docker/nacos/init.d/custom.properties" ;then

      mkdir -p /docker/nacos/init.d

      cp nacos/init.d/custom.properties /docker/nacos/init.d/custom.properties

     fi

     if test ! -f "/docker/prometheus/prometheus.yml" ;then

      mkdir -p /docker/prometheus

      cp prometheus/config/prometheus.yml /docker/prometheus/prometheus.yml

     fi

     if test ! -f "/docker/prometheus/rules/alert_rules.yml" ;then

      mkdir -p /docker/prometheus/rules

      cp prometheus/config/alert_rules.yml /docker/prometheus/rules/alert_rules.yml

     fi

     if test ! -f "/docker/grafana/grafana.ini" ;then

      mkdir -p /docker/grafana

      cp prometheus/config/grafana.ini /docker/grafana/grafana.ini

     fi

     if test ! -f "/docker/alertmanager/alertmanager.yml" ;then

      mkdir -p /docker/alertmanager

      cp prometheus/config/alertmanager.yml /docker/alertmanager/alertmanager.yml

     fi

     if test ! -f "/docker/alertmanager/templates/wechat.tmpl" ;then

      mkdir -p /docker/alertmanager/templates

      cp prometheus/config/wechat.tmpl /docker/alertmanager/templates/wechat.tmpl

     fi

     if test ! -f "/docker/webhook_dingtalk/dingtalk.yml" ;then

      mkdir -p /docker/webhook_dingtalk

      cp prometheus/config/dingtalk.yml /docker/webhook_dingtalk/dingtalk.yml

     fi

     #增加目录权限

     chmod -R 777 /docker/prometheus

     chmod -R 777 /docker/grafana

     chmod -R 777 /docker/alertmanager

    }


    #启动基础模块

    base(){

     docker-compose up -d nacos sentinel seata-server web-nginx blade-nginx blade-redis

    }


    #启动监控模块

    monitor(){

     docker-compose up -d blade-admin blade-turbine

    }


    #启动程序模块

    modules(){

     docker-compose up -d blade-gateway1 blade-gateway2 blade-auth1 blade-auth2 blade-swagger blade-report blade-user blade-desk blade-system blade-log blade-flow blade-flow-design blade-resource blade-base-jpa blade-xxljob blade-xxljob-admin blade-develop blade-exam blade-word blade-ftpai

    }


    #启动普罗米修斯模块

    prometheus(){

     docker-compose up -d prometheus node-exporter mysqld-exporter cadvisor grafana

    }


    #启动监听模块

    alertmanager(){

     docker-compose up -d alertmanager webhook-dingtalk

    }


    #关闭所有模块

    stop(){

     docker-compose stop

    }


    #删除所有模块

    rm(){

     docker-compose rm

    }


    #删除Tag为空的镜像

    rmiNoneTag(){

     docker images|grep none|awk '{print $3}'|xargs docker rmi -f

    }


    #根据输入参数,选择执行对应方法,不输入则执行使用说明

    case "$1" in

    "port")

     port

    ;;

    "mount")

     mount

    ;;

    "base")

     base

    ;;

    "monitor")

     monitor

    ;;

    "modules")

     modules

    ;;

    "prometheus")

     prometheus

    ;;

    "alertmanager")

     alertmanager

    ;;

    "stop")

     stop

    ;;

    "rm")

     rm

    ;;

    "rmiNoneTag")

     rmiNoneTag

    ;;

    *)

     usage

    ;;

    esac



    docker-compose.yml 文件

    version: '3'

    ####################################################################################################

    ###===================================  操作步骤记录  =========================================###

    ####################################################################################################


    services:


      ####################################################################################################

      ###===================================  以下为中间件模块  =========================================###

      ####################################################################################################


      nacos:

        image: nacos/nacos-server:2.0.1

        hostname: "nacos-standalone"

        environment:

          - MODE=standalone

          - TZ=Asia/Shanghai

        volumes:

          - /docker/nacos/standalone-logs/:/home/nacos/logs

          - /docker/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties

        ports:

          - 8848:8848

          - 9848:9848

          - 9849:9849

        networks:

          blade_net:

            ipv4_address: 172.30.0.48


      sentinel:

        image: bladex/sentinel-dashboard:1.8.0

        hostname: "sentinel"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 8858:8858

        restart: on-failure

        networks:

          blade_net:

            ipv4_address: 172.30.0.58


      seata-server:

        image: seataio/seata-server:1.4.1

        hostname: "seata-server"

        ports:

          - 8091:8091

        environment:

          - TZ=Asia/Shanghai

          - SEATA_PORT=8091

          - STORE_MODE=file

        networks:

          blade_net:

            ipv4_address: 172.30.0.68


      blade-redis:

        image: redis:5.0.8-alpine

        hostname: "blade-redis"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 3379:6379

        volumes:

          - /docker/redis/data:/data

        command: "redis-server --appendonly yes"

        privileged: true

        restart: always

        networks:

          - blade_net


      blade-nginx:

        image: nginx:stable-alpine-perl

        hostname: "blade-nginx"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 88:88

        volumes:

          - /docker/nginx/api/nginx.conf:/etc/nginx/nginx.conf

        privileged: true

        restart: always

        networks:

          - blade_net


      web-nginx:

        image: nginx:stable-alpine-perl

        hostname: "web-nginx"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 8000:8000

          - 8001:8001

          - 8002:8002

        volumes:

          - /docker/nginx/web/html:/usr/share/nginx/html

          - /docker/nginx/web/word:/usr/share/nginx/word

          - /docker/nginx/web/exam:/usr/share/nginx/exam

          - /docker/nginx/web/nginx.conf:/etc/nginx/nginx.conf

        privileged: true

        restart: always

        networks:

          - blade_net


      ####################################################################################################

      ###=================================  以下为BladeX服务模块  =======================================###

      ####################################################################################################


      blade-admin:

        image: "${REGISTER}/blade-admin:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 7002:7002

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          blade_net:

            ipv4_address: 172.30.0.72


      blade-swagger:

        image: "${REGISTER}/blade-swagger:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 18000:18000

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          - blade_net


      blade-turbine:

        image: "${REGISTER}/blade-turbine:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 7003:7003

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          - blade_net


      blade-gateway1:

        image: "${REGISTER}/blade-gateway:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          blade_net:

            ipv4_address: 172.30.0.81


      blade-gateway2:

        image: "${REGISTER}/blade-gateway:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          blade_net:

            ipv4_address: 172.30.0.82


      blade-auth1:

        image: "${REGISTER}/blade-auth:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          blade_net:

            ipv4_address: 172.30.0.91


      blade-auth2:

        image: "${REGISTER}/blade-auth:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          blade_net:

            ipv4_address: 172.30.0.92


      blade-report:

        image: "${REGISTER}/blade-report:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 8108:8108

        networks:

          blade_net:

            ipv4_address: 172.30.0.98


      blade-log:

        image: "${REGISTER}/blade-log:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          - blade_net


      blade-desk:

        image: "${REGISTER}/blade-desk:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          - blade_net


      blade-user:

        image: "${REGISTER}/blade-user:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          - blade_net


      blade-system:

        image: "${REGISTER}/blade-system:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          - blade_net


      blade-flow:

        image: "${REGISTER}/blade-flow:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          - blade_net


      blade-flow-design:

        image: "${REGISTER}/blade-flow-design:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 9999:9999

        networks:

          - blade_net


      blade-resource:

        image: "${REGISTER}/blade-resource:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        networks:

          - blade_net


      blade-base-jpa:

        image: "${REGISTER}/blade-base-jpa:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 17043:17043

        networks:

          blade_net:

            ipv4_address: 172.30.0.110


      blade-word:

        image: "${REGISTER}/blade-word:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 18086:18086

        networks:

          blade_net:

            ipv4_address: 172.30.0.111


      blade-ftpai:

        image: "${REGISTER}/blade-ftpai:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 18085:18085

        networks:

          blade_net:

            ipv4_address: 172.30.0.112


      blade-exam:

        image: "${REGISTER}/blade-exam:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 18097:18097

        networks:

          blade_net:

            ipv4_address: 172.30.0.113


      blade-zhzhpt:

        image: "${REGISTER}/blade-zhzhpt:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        restart: always

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 8058:8058

        networks:

          blade_net:

            ipv4_address: 172.30.0.114


      blade-xxljob:

        image: "${REGISTER}/blade-xxljob:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 7008:7008

        restart: always

        networks:

          - blade_net


      blade-xxljob-admin:

        image: "${REGISTER}/blade-xxljob-admin:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 7009:7009

        restart: always

        networks:

          - blade_net


      blade-develop:

        image: "${REGISTER}/blade-develop:${TAG}"

        environment:

          - TZ=Asia/Shanghai

        privileged: true

        command:

          - --spring.profiles.active=${PROFILE}

          - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}

          - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}

          - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}

          - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}

          - --spring.cloud.nacos.config.group=${NACOS_GROUP}

          - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}

          - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}

          - --sentinel.heartbeat.client.ip=${ADMIN_IP}

        ports:

          - 7007:7007

        restart: always

        networks:

          - blade_net



      ####################################################################################################

      ###===============================  以下为Prometheus监控模块  =====================================###

      ####################################################################################################


      prometheus:

        image: prom/prometheus:v2.24.1

        hostname: "prometheus"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 9090:9090

        volumes:

          - /docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml

          - /docker/prometheus/rules:/etc/prometheus/rules

        command: "--config.file=/etc/prometheus/prometheus.yml  --web.enable-lifecycle"

        privileged: true

        restart: always

        networks:

          blade_net:

            ipv4_address: 172.30.0.90


      node-exporter:

        image: prom/node-exporter:v1.0.1

        hostname: "node-exporter"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 9190:9100

        privileged: true

        restart: always

        networks:

          blade_net:

            ipv4_address: 172.30.0.93


      mysqld-exporter:

        image: prom/mysqld-exporter:v0.12.1

        hostname: "mysqld-exporter"

        environment:

          - TZ=Asia/Shanghai

          # 需要先在mysql服务执行如下语句

          # =====================================================================================

          # === CREATE USER 'exporter'@'mysql服务ip' IDENTIFIED BY '密码';                     ===

          # === GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'mysql服务ip';  ===

          # === flush privileges;                                                             ===

          # =====================================================================================

          - DATA_SOURCE_NAME=exporter:Abc#***********@192.168.100.133:23308/

        ports:

          - 9104:9104

        privileged: true

        restart: always

        networks:

          blade_net:

            ipv4_address: 172.30.0.94


      cadvisor:

        image: google/cadvisor:v0.33.0

        hostname: "cadvisor"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 18080:8080

        volumes:

          - /:/rootfs:ro

          - /var/run:/var/run:rw

          - /sys:/sys:ro

          - /var/lib/docker/:/var/lib/docker:ro

          - /dev/disk/:/dev/disk:ro

        command: "detach=true"

        privileged: true

        restart: always

        networks:

          blade_net:

            ipv4_address: 172.30.0.180


      grafana:

        image: grafana/grafana:7.3.7

        hostname: "grafana"

        environment:

          - TZ=Asia/Shanghai

          - GF_SERVER_ROOT_URL=https://grafana.bladex.cn

          - GF_SECURITY_ADMIN_PASSWORD=1qaz@WSX

        ports:

          - 3000:3000

        volumes:

          - /docker/grafana/grafana.ini:/etc/grafana/grafana.ini

          - /docker/grafana:/var/lib/grafana

        privileged: true

        restart: always

        networks:

          blade_net:

            ipv4_address: 172.30.0.30


      alertmanager:

        image: prom/alertmanager:v0.21.0

        hostname: "alertmanager"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 9093:9093

        volumes:

          - /docker/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml

          - /docker/alertmanager/data:/etc/alertmanager/data

          - /docker/alertmanager/templates:/etc/alertmanager/templates

        command: "--config.file=/etc/alertmanager/alertmanager.yml --storage.path=/etc/alertmanager/data"

        privileged: true

        restart: always

        networks:

          blade_net:

            ipv4_address: 172.30.0.99


      webhook-dingtalk:

        image: timonwong/prometheus-webhook-dingtalk:v1.4.0

        hostname: "webhook-dingtalk"

        environment:

          - TZ=Asia/Shanghai

        ports:

          - 8060:8060

        command: "ding.profile=webhook_robot=https://oapi.dingtalk.com/robot/send?access_token=xxxxx"

        privileged: true

        restart: always

        networks:

          blade_net:

            ipv4_address: 172.30.0.96


    networks:

      blade_net:

        driver: bridge

        ipam:

          config:

            - subnet: 172.30.0.0/16

     

提交回复