我的微服务状态是关闭,我登录到 docker 容器:
docker exec -it {container_id} /bin/bash
容器中的应用日志输出:
2019-09-04 14:51:02.244 INFO 61 --- [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2019-09-04 14:51:02.244 INFO 61 --- [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient : Application is null : false
2019-09-04 14:51:02.244 INFO 61 --- [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2019-09-04 14:51:02.244 INFO 61 --- [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2019-09-04 14:51:02.244 INFO 61 --- [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2019-09-04 14:51:02.326 INFO 61 --- [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_APOLLO-ADMINSERVICE/b24984e8c669:apollo-adminservice:8090 - Re-registering apps/APOLLO-ADMINSERVICE
2019-09-04 14:51:02.326 INFO 61 --- [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_APOLLO-ADMINSERVICE/b24984e8c669:apollo-adminservice:8090: registering service...
2019-09-04 14:51:02.470 INFO 61 --- [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_APOLLO-ADMINSERVICE/b24984e8c669:apollo-adminservice:8090 - registration status: 204
2019-09-04 14:51:02.485 INFO 61 --- [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient : The response status is 200
2019-09-04 14:51:02.747 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:51:32.068 INFO 61 --- [AsyncResolver-bootstrap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2019-09-04 14:51:32.802 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:52:02.857 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:52:32.069 INFO 61 --- [AsyncResolver-bootstrap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2019-09-04 14:52:32.912 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:53:02.968 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:53:32.070 INFO 61 --- [AsyncResolver-bootstrap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2019-09-04 14:53:33.026 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:54:03.083 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:54:32.071 INFO 61 --- [AsyncResolver-bootstrap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2019-09-04 14:54:33.149 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:55:03.247 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:55:32.072 INFO 61 --- [AsyncResolver-bootstrap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2019-09-04 14:55:33.306 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:56:03.360 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
2019-09-04 14:56:32.074 INFO 61 --- [AsyncResolver-bootstrap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2019-09-04 14:56:33.417 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
tail: unrecognized file system type 0x794c7630 for ‘apollo-adminservice.log’. please report this to bug-coreutils@gnu.org. reverting to polling
2019-09-04 14:57:03.558 WARN 61 --- [DiscoveryClient-InstanceInfoReplicator-0] o.s.b.a.system.DiskSpaceHealthIndicator : Free disk space below threshold. Available: 0 bytes (threshold: 10485760 bytes)
我签出容器磁盘:
root@b24984e8c669:/opt/logs/100003172# df -lh
Filesystem Size Used Avail Use% Mounted on
overlay 40G 38G 0 100% /
tmpfs 64M 0 64M 0% /dev
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/vda1 40G 38G 0 100% /etc/hosts
shm 64M 0 64M 0% /dev/shm
tmpfs 7.8G 0 7.8G 0% /proc/acpi
tmpfs 7.8G 0 7.8G 0% /proc/scsi
tmpfs 7.8G 0 7.8G 0% /sys/firmware
我应该怎么做才能解决问题? 如何调整容器磁盘使用情况?谢谢!
如何调整容器磁盘使用情况?
实际上,这与容器磁盘使用情况无关,这与 docker 主机的磁盘使用情况有关。
如果使用主机上的docker info | grep Dir
查看,您可能会看到如下所示的内容:
Docker Root Dir: /var/lib/docker
此文件夹是用于所有容器的覆盖文件系统 docker。
因此,overlay 40G 38G 0 100% /
仅表示主机磁盘已满/var/lib/docker
。你的40G
分区是不够的,你可以做的是下一步:
选项 1:
如果您有其他大于40G
的分区,请更改docker的存储位置,如下所示。
选项 2:
只需释放当前磁盘(40G(上的一些空间(删除未使用的大图片,文档,安装程序等(。此外,我想你可能有很多未使用的图像和容器,那么你可以使用docker system prune -a
来清理它们。但要注意接下来:
警告!这将删除:
- 所有停止的容器 - 至少一个容器未使用的所有网络 - 所有没有至少一个容器
关联的
映像 - 所有构建缓存