zoukankan      html  css  js  c++  java
  • docker中的FastDFS突然报错

    原因

    今天小伙伴突然告诉我官网的图片突然全部都访问不了了,我一看还真是

    图片是存在FastDFS上的,所以肯定是这一块出错了,于是我看了下服务器,果然果然是一个镜像为delron/fastdfs的容器挂掉了,然后将它重新启动,但是很遗憾,启动失败,一启动立刻又挂掉,我看了下日志大概是报了这个错误

    ngx_http_fastdfs_set pid=7
    try to start the storage node...
    tail: cannot open '/var/fdfs/logs/storaged.log' for reading: No such file or directory
    tail: no files remaining
    

    所以解决办法就是创建一个storaged.log就好了,一行命令解决

     docker cp /root/storaged.log 3de619363d4e:/var/fdfs/logs/storaged.log
    

    关于修改已停止了的容器的文件

    1. # 通过查看容器日志,确定是什么问题,docker logs -f -t --tail 行数 容器名
        docker logs -f -t --tail 100 <containerID> 
    2. # 将容器中导致错误的文件拷贝到宿主机上
        docker cp containerID:container_path host_path 
        ***说明***
        	containerID:容器ID
        	container_path:容器内文件路径(需拷贝的源文件)
        	host_path:宿主机路径(拷贝文件的目标)
    3. # 修改拷贝出来的配置文件, 再将配置文件拷贝回去容器 
        docker cp host_path containerID:container_path
    4. # 再次启动容器
        docker start containerID
    

    然后这个挂掉的容器就启动了起来,官网的图片也能正常访问了,哈哈哈

    ♪(^∇^*)♪(^∇^*)(~ ̄▽ ̄)~有没有感觉很棒呀!!!(#^.^#),(*^▽^*)O(∩_∩)O哈哈~
  • 相关阅读:
    批量管理增量日志(seek、tell)
    字符串和编码
    5.activiti--完成任务
    4.activiti--代理任务Claiming the task
    3.activiti--待办任务
    2.activiti-启动流程实例
    1.activiti-流程图
    html 各种高度
    redis-过期时间、访问限制与缓存
    spring mvc controller 接收参数
  • 原文地址:https://www.cnblogs.com/ygjzs/p/14785828.html
Copyright © 2011-2022 走看看