zoukankan      html  css  js  c++  java
  • 软连接使用心得

    生产上有一个目录磁盘比较小为了预防日后磁盘被日志挤爆,所以要做一个软连接,把日志存到另外一个磁盘上去

    然后就出现了下面的心得

    ln -s   要放入的目录      原来的目录
    
    ln -s  /ccdata/log/hadoop-hdfs/ /var/log/hadoop-hdfs

    原来的目录因为已经存在了   所以你在创建的时候肯定会出现

     $ cd /var/log/hadoop-hdfs
    
     $ ll
    
    lrwxrwxrwx  1 root   root                 24 2019-11-08 15:29:37 hadoop-hdfs -> /ccdata/log/hadoop-hdfs/
    
     $cd hadoop-hdfs
    $ pwd
    
    /var/log/hadoop-hdfs/hadoop-hdfs

    这样就会出现双层的hadoop-hdfs目录,然后你就会奇怪 为啥为啥!!!!!

    • 解决途径

    因为你的软连接中ln -s  /ccdata/log/hadoop-hdfs/ /var/log/hadoop-hdfs    后边的/var/log/hadoop-hdfs 这个路径的hadoop-hdfs是不能存在的

    也就是说你需要删掉hadoop-hdfs,然后你会说里边原来的东西咋办,移走啊 !!!!!或者直接移动到 /ccdata/log/hadoop-hdfs/目录下,一步到位

    然后你 在创建就OK啦

    ln -s  /ccdata/log/hadoop-hdfs/ /var/log/hadoop-hdfs
  • 相关阅读:
    用php爬取网页
    无论我是一只菜鸟笨鸟
    有线网卡与无线网卡同时使用
    scapy 命令理解
    Wireshark Filter
    python OS/pdb 模块及数据类型基础
    scapy down and install
    python 字符操作函数
    python 类型集
    python 科学计算
  • 原文地址:https://www.cnblogs.com/xuziyu/p/11820788.html
Copyright © 2011-2022 走看看