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哈哈~
  • 相关阅读:
    WPF Timer替代者
    <转>Change the Background of a selected ListBox Item
    WPF Button样式模板
    WPF中自定义只能输入数字的TextBox
    ansible playbook模式及语法
    数据挖掘Kaggle
    电影网站
    数据挖掘面临的科学和工程的新问题
    KDD Cup 2012(今年数据挖掘在中国)
    能力是在执行中实现的,要高节奏不要详细的设计
  • 原文地址:https://www.cnblogs.com/ygjzs/p/14785828.html
Copyright © 2011-2022 走看看