如何在docker中验证shardingproxy 已经2启动
时间: 2024-03-11 18:47:35 浏览: 120
您可以在 Docker 中使用以下命令检查 ShardingProxy 是否已经启动:
1. 查看 Docker 容器列表,找到正在运行的 ShardingProxy 容器的 ID:
```
docker ps
```
2. 进入 ShardingProxy 容器的命令行:
```
docker exec -it 容器ID /bin/bash
```
3. 查看 ShardingProxy 启动日志:
```
tail -f /opt/sharding-proxy/logs/stdout.log
```
如果 ShardingProxy 启动成功,您应该能够看到类似以下的日志信息:
```
2019-04-09 09:57:28.696 INFO main o.s.c.s.DefaultLifecycleProcessor - Starting beans in phase 0 before other processors start
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'configurationPropertiesRebinder' of type [class org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'refreshScope' of type [class org.springframework.cloud.context.scope.refresh.RefreshScope] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.boot.autoconfigure.AutoConfigurationPackages' of type [class org.springframework.boot.autoconfigure.AutoConfigurationPackages] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.context.properties.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.context.properties.ConfigurationPropertiesRebinderAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$ReloadConfigurationProperties' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$ReloadConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$ConfigurationPropertiesBeans' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$ConfigurationPropertiesBeans] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$ConfigurationPropertiesRebinderConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$ConfigurationPropertiesRebinderConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.704 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$InjectedConfigurationPropertiesRebinder' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$InjectedConfigurationPropertiesRebinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.705 INFO main org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$ConfigurationPropertiesRebinderMessageHandlerAdapter' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$ConfigurationPropertiesRebinderMessageHandlerAdapter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-09 09:57:28.705 INFO main o.s.c.s.DefaultLifecycleProcessor - Starting beans in phase 2147483647
2019-04-09 09:57:28.705 INFO main c.a.s.s.p.ShardingPropertiesLoader - Sharding-Proxy configuration is loaded from /opt/sharding-proxy/conf/config-sharding.yaml
2019-04-09 09:57:28.712 INFO main c.a.s.s.p.ShardingPropertiesLoader - Server lists configuration is loaded from /opt/sharding-proxy/conf/server.yaml
2019-04-09 09:57:28.713 INFO main o.a.s.proxy.frontend.netty.NettyFrontendEngine - Proxy context init, listen on [127.0.0.1:3307], pid is [1] and group is [default]
2019-04-09 09:57:28.713 INFO main o.a.s.proxy.frontend.netty.NettyFrontendEngine - Register Netty channel to Synchronizer success.
2019-04-09 09:57:28.713 INFO main o.a.s.p.s.SchemaChangedNotifier - === Sharding-Proxy start success ===
```
如果没有发现类似的日志信息,那么可能是 ShardingProxy 启动失败,请查看日志文件以确定失败原因。
阅读全文