V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lcdxiangzi
V2EX  ›  Hadoop

请教, CDH 集群管理工具, centos 普通用户可以安装吗?还是必须使用 root 用户

  •  
  •   lcdxiangzi · 2019-04-02 17:20:13 +08:00 · 5955 次点击
    这是一个创建于 2062 天前的主题,其中的信息可能已经有所发展或是发生改变。
    用好几台机器尝试过,普通用户都在报错,sudo 也不行。一定要 root 用户直接操作才可以吗?
    +======================================================================+
    | Error: Unable to find a compatible version of Java on this host,|
    | either because JAVA_HOME has not been set or because a |
    | compatible version of Java is not installed. |
    +----------------------------------------------------------------------+
    | Please install either: |
    | - a supported version of the Oracle JDK from the Oracle Java web |
    | site: |
    | > http://www.oracle.com/technetwork/java/javase/index.html < |
    | OR |
    | - a supported version of the OpenJDK from your OS vendor. Help for |
    | some OSes are available at: |
    | > http://openjdk.java.net/install/ < |
    | |
    | Cloudera Manager requires Oracle JDK or OpenJDK 1.8 or later. |
    | NOTE: Cloudera Manager will find the Oracle JDK when starting, |
    | regardless of whether you installed the JDK using a binary |
    | installer or the RPM-based installer. |
    +======================================================================+
    error: %pre(cloudera-manager-server-6.2.0-968826.el7.x86_64) scriptlet failed, exit status 1
    Error in PREIN scriptlet in rpm package cloudera-manager-server-6.2.0-968826.el7.x86_64
    验证中 : cloudera-manager-agent-6.2.0-968826.e 1/3
    验证中 : cloudera-manager-daemons-6.2.0-968826 2/3
    验证中 : cloudera-manager-server-6.2.0-968826. 3/3

    已安装:
    cloudera-manager-agent.x86_64 0:6.2.0-968826.el7

    失败:
    cloudera-manager-daemons.x86_64 0:6.2.0-968826.el7
    cloudera-manager-server.x86_64 0:6.2.0-968826.el7



    只要是 sudo,就会报这个错,如果 su - root 后,就可以成功。
    新手上路有点懵,一般情况下 root 用户都不大用的啊。
    27 条回复    2019-04-03 14:30:24 +08:00
    liprais
        1
    liprais  
       2019-04-02 17:28:59 +08:00   ❤️ 1
    | Error: Unable to find a compatible version of Java on this host,|
    | either because JAVA_HOME has not been set or because a |
    | compatible version of Java is not installed. |

    这行没看到么......
    boris1993
        2
    boris1993  
       2019-04-02 19:18:35 +08:00 via Android
    1 楼正解

    请学会阅读程序的输出,而不是全靠蒙全靠猜
    lcdxiangzi
        3
    lcdxiangzi  
    OP
       2019-04-03 08:52:28 +08:00
    @liprais 报错日志肯定会看的。这个都看到了,我本地 java 都装好的。但是实际的问题是,非 root 安装就是报错,尝试了两次了。root 安装,同样的命令就可以通过。我都是尝试过的。
    lcdxiangzi
        4
    lcdxiangzi  
    OP
       2019-04-03 08:54:11 +08:00
    @boris1993
    @liprais
    而且我本地 java 也是 1.8.x 的版本,所以有点懵逼。搞不懂
    boris1993
        5
    boris1993  
       2019-04-03 08:58:21 +08:00 via Android
    所以检查 JAVA_HOME 的值对不对
    lcdxiangzi
        6
    lcdxiangzi  
    OP
       2019-04-03 09:02:42 +08:00
    @boris1993
    /etc/profile 内容如下
    export JAVA_HOME=/home/hadoop/jdk1.8.0_161
    export JRE_HOME=/home/hadoop/jdk1.8.0_161/jre
    export CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
    export HADOOP_HOME=/home/hadoop/hadoop-3.1.1
    export HIVE_HOME=/home/hadoop/apache-hive-3.1.0-bin
    export HBASE_HOME=/home/hadoop/hbase-1.4.8
    export ZOOKEEPER_HOME=/home/hadoop/zookeeper-3.4.12
    export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HIVE_HOME/bin:$HBASE_HOME/bin:$ZOOKEEPER_HOME/bin:$ZOOKEEPER_HOME/conf
    应该是正常的吧,因为我现在搭 cdh 用的都是之前跑过原生 hadoop 的环境。
    defunct9
        7
    defunct9  
       2019-04-03 09:04:33 +08:00
    开 ssh,让我上去试试
    lcdxiangzi
        8
    lcdxiangzi  
    OP
       2019-04-03 09:08:55 +08:00
    @defunct9 这个搞不定,公司的服务器,虽然是测试环境,但是肯定没有对外开放的。你需要看什么,我可以贴上来
    defunct9
        9
    defunct9  
       2019-04-03 09:29:49 +08:00
    猜不了火车
    catcalse
        10
    catcalse  
       2019-04-03 09:35:57 +08:00
    vi ~/.bashrc
    source ~/.bashrc
    scalaer
        11
    scalaer  
       2019-04-03 09:36:14 +08:00
    你看看 jps 能用不
    lcdxiangzi
        12
    lcdxiangzi  
    OP
       2019-04-03 09:39:24 +08:00
    正在解决依赖关系
    --> 正在检查事务
    ---> 软件包 cloudera-manager-agent.x86_64.0.6.2.0-968826.el7 将被 安装
    ---> 软件包 cloudera-manager-daemons.x86_64.0.6.2.0-968826.el7 将被 安装
    ---> 软件包 cloudera-manager-server.x86_64.0.6.2.0-968826.el7 将被 安装
    --> 解决依赖关系完成

    依赖关系解决

    =======================================================================================================
    Package 架构 版本 源 大小
    =======================================================================================================
    正在安装:
    cloudera-manager-agent x86_64 6.2.0-968826.el7 cloudera-manager 9.7 M
    cloudera-manager-daemons x86_64 6.2.0-968826.el7 cloudera-manager 1.1 G
    cloudera-manager-server x86_64 6.2.0-968826.el7 cloudera-manager 9.8 k

    事务概要
    =======================================================================================================
    安装 3 软件包

    总下载量:1.1 G
    安装大小:1.4 G
    Is this ok [y/d/N]: y
    Downloading packages:
    (1/3): cloudera-manager-agent-6.2.0-968826.el7.x86_64.rpm | 9.7 MB 00:00:07
    (2/3): cloudera-manager-server-6.2.0-968826.el7.x86_64.rpm | 9.8 kB 00:00:00
    (3/3): cloudera-manager-daemons-6.2.0-968826.el7.x86_64.rpm | 1.1 GB 00:03:22
    -------------------------------------------------------------------------------------------------------
    总计 5.6 MB/s | 1.1 GB 00:03:22
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
    正在安装 : cloudera-manager-daemons-6.2.0-968826.e [######################### ] 1/3^ 正在安装 : cloudera-manager-daemons-6.2.0-968826.el7.x86_64 1/3
    正在安装 : cloudera-manager-agent-6.2.0-968826.el7.x86_64 2/3
    Created symlink from /etc/systemd/system/multi-user.target.wants/cloudera-scm-agent.service to /usr/lib/systemd/system/cloudera-scm-agent.service.
    Created symlink from /etc/systemd/system/multi-user.target.wants/supervisord.service to /usr/lib/systemd/system/supervisord.service.
    正在安装 : cloudera-manager-server-6.2.0-968826.el7.x86_64 3/3
    验证中 : cloudera-manager-agent-6.2.0-968826.el7.x86_64 1/3
    验证中 : cloudera-manager-daemons-6.2.0-968826.el7.x86_64 2/3
    验证中 : cloudera-manager-server-6.2.0-968826.el7.x86_64 3/3

    已安装:
    cloudera-manager-agent.x86_64 0:6.2.0-968826.el7 cloudera-manager-daemons.x86_64 0:6.2.0-968826.el7
    cloudera-manager-server.x86_64 0:6.2.0-968826.el7

    完毕!


    这次是 root 用户安装的,成功了。貌似我开出来的普通用户有哪里没有配置好?算了,暂时觉得 root 一路走下去了。实在不能再等了。
    感谢回复的各位
    lcdxiangzi
        13
    lcdxiangzi  
    OP
       2019-04-03 09:40:43 +08:00
    @catcalse
    .bashrc
    # .bashrc

    # Source global definitions
    if [ -f /etc/bashrc ]; then
    . /etc/bashrc
    fi

    # Uncomment the following line if you don't like systemctl's auto-paging feature:
    # export SYSTEMD_PAGER=

    # User specific aliases and functions
    lcdxiangzi
        14
    lcdxiangzi  
    OP
       2019-04-03 09:41:40 +08:00
    @mggis0or1
    jps 好用的
    [SNOTEST02][root][/root]#jps
    19650 Jps
    7701 QuorumPeerMain
    [SNOTEST02][root][/root]#
    lcdxiangzi
        15
    lcdxiangzi  
    OP
       2019-04-03 09:42:14 +08:00
    大家感兴趣可以继续讨论,需要啥,告诉我,我来贴。两条路一起走吧。应该不影响的。
    fireapp
        16
    fireapp  
       2019-04-03 09:51:53 +08:00 via iPhone
    一步步试,先 suodo yum install cloudera-manager-agent.x86_64 安装下试试
    fireapp
        17
    fireapp  
       2019-04-03 09:56:21 +08:00 via iPhone
    再 sudo export JAVA_HOME=java_path && sudo yum install cloudera-manager-agent.x86_64 继续试
    lcdxiangzi
        18
    lcdxiangzi  
    OP
       2019-04-03 10:04:16 +08:00
    @fireapp #16 试过,报错。
    #17 sudo export 好像不可以合用吧,我把 sudo 拿掉,试下
    fireapp
        19
    fireapp  
       2019-04-03 10:09:55 +08:00 via iPhone
    继续写个脚步 ,export && yum install,然后 sudo 执行它
    lcdxiangzi
        20
    lcdxiangzi  
    OP
       2019-04-03 10:14:11 +08:00
    @fireapp #17
    +======================================================================+
    | Error: Unable to find a compatible version of Java on this host,|
    | either because JAVA_HOME has not been set or because a |
    | compatible version of Java is not installed. |
    +----------------------------------------------------------------------+
    | Please install either: |
    | - a supported version of the Oracle JDK from the Oracle Java web |
    | site: |
    | > http://www.oracle.com/technetwork/java/javase/index.html < |
    | OR |
    | - a supported version of the OpenJDK from your OS vendor. Help for |
    | some OSes are available at: |
    | > http://openjdk.java.net/install/ < |
    | |
    | Cloudera Manager requires Oracle JDK or OpenJDK 1.8 or later. |
    | NOTE: Cloudera Manager will find the Oracle JDK when starting, |
    | regardless of whether you installed the JDK using a binary |
    | installer or the RPM-based installer. |
    +======================================================================+
    error: %pre(cloudera-manager-daemons-6.2.0-968826.el7.x86_64) scriptlet failed, exit status 1
    Error in PREIN scriptlet in rpm package cloudera-manager-daemons-6.2.0-968826.el7.x86_64
    error: cloudera-manager-daemons-6.2.0-968826.el7.x86_64: install failed
    正在安装 : cloudera-manager-agent-6.2.0-968826.el7.x86_64 2/2
    Created symlink from /etc/systemd/system/multi-user.target.wants/cloudera-scm-agent.service to /usr/lib/systemd/system/cloudera-scm-agent.service.
    Created symlink from /etc/systemd/system/multi-user.target.wants/supervisord.service to /usr/lib/systemd/system/supervisord.service.
    验证中 : cloudera-manager-agent-6.2.0-968826.el7.x86_64 1/2
    验证中 : cloudera-manager-daemons-6.2.0-968826.el7.x86_64 2/2

    已安装:
    cloudera-manager-agent.x86_64 0:6.2.0-968826.el7

    失败:
    cloudera-manager-daemons.x86_64 0:6.2.0-968826.el7

    完毕!


    还是报错
    boris1993
        21
    boris1993  
       2019-04-03 10:17:35 +08:00 via Android
    它说找不到兼容的 Java,检查下你现在安装的 Java 与工具要求的 Java 版本是否一致
    fireapp
        22
    fireapp  
       2019-04-03 10:29:49 +08:00 via iPhone
    楼主说 su root 下能安装,但是 sudo 就报错,感觉是安装脚本在 sudo 下找不到 java_home,手动指定它试试,不行的话下个源码看看,改改自己编译一个
    lcdxiangzi
        23
    lcdxiangzi  
    OP
       2019-04-03 10:51:11 +08:00
    @boris1993
    @fireapp
    感谢提供思路
    xiaonoah
        24
    xiaonoah  
       2019-04-03 12:19:35 +08:00 via Android
    普通用户下执行 which java,看看你 java 安装路径是在哪里。root 用的 java 版本和普通用户的可能不一样
    sunchen
        25
    sunchen  
       2019-04-03 13:31:37 +08:00
    JAVA_HOMe 改成和 CDH 要求的一致的 /usr/java/jdkxxxxx
    lcdxiangzi
        27
    lcdxiangzi  
    OP
       2019-04-03 14:30:24 +08:00 via Android
    @sunchen 多谢,我这里不是仔细不仔细的问题,我是压根没有看文档,网上找了个帖子就开干了。😅😅😅
    吸取教训,老实看文档去了
    谢谢👏👏👏
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2699 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 03:56 · PVG 11:56 · LAX 19:56 · JFK 22:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.