zoukankan      html  css  js  c++  java
  • ambari安装问题

    1.Heartbeat lost for the host

     
    ambari-agent
    [root@oc-data-141 ~]# ambari-agent status  —查看客户端状态
    [root@oc-data-141 ~]# tailf /var/log/ambari-agent/ambari-agent.out
      File "/usr/lib/python2.6/site-packages/resource_management/core/logger.py", line 147, in get_function_repr
        return unicode("{0} {{{1}}}").format(name, arguments_str)
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 15: ordinal not in range(128)
     
    Traceback (most recent call last):
      File "/usr/lib/python2.6/site-packages/ambari_agent/main.py", line 306, in <module>
        main(heartbeat_stop_callback)
      File "/usr/lib/python2.6/site-packages/ambari_agent/main.py", line 297, in main
        ExitHelper.execute_cleanup()
     
    解决方案:
    在 /usr/lib/python2.6/site-packages/ambari_agent/main.py  中添加:
    import sys
    reload(sys)
    sys.setdefaultencoding('utf8') 
     

    2.安装ranger报错:

    java.sql.SQLException: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
    SQLException : SQL state: HY000 java.sql.SQLException: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) ErrorCode: 1418
    2016-05-21 09:38:57,077  [E] 007-updateBlankPolicyName.sql import failed!
     
    解决方案:
    This function has none of DETERMINISTIC, NO SQL解决办法

    创建存储过程时

    出错信息:

    ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

    原因:

    这是我们开启了bin-log, 我们就必须指定我们的函数是否是
    1 DETERMINISTIC 不确定的
    2 NO SQL 没有SQl语句,当然也不会修改数据
    3 READS SQL DATA 只是读取数据,当然也不会修改数据
    4 MODIFIES SQL DATA 要修改数据
    5 CONTAINS SQL 包含了SQL语句

    其中在function里面,只有 DETERMINISTIC, NO SQL 和 READS SQL DATA 被支持。如果我们开启了 bin-log, 我们就必须为我们的function指定一个参数。

    解决方法:

    SQL code
    mysql> show variables like 'log_bin_trust_function_creators';
    +---------------------------------+-------+
    | Variable_name                   | Value |
    +---------------------------------+-------+
    | log_bin_trust_function_creators | OFF   |
    +---------------------------------+-------+
    mysql> set global log_bin_trust_function_creators=1;
    mysql> show variables like 'log_bin_trust_function_creators';
    +---------------------------------+-------+
    | Variable_name                   | Value |
    +---------------------------------+-------+
    | log_bin_trust_function_creators | ON    |
    +---------------------------------+-------+

    这样添加了参数以后,如果mysqld重启,那个参数又会消失,因此记得在my.cnf配置文件中添加:
    log_bin_trust_function_creators=1
     

    3.Ranger页面Audit—admin页面报错

    打印ranger日志报错信息:
     which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
     
    解决办法:
     
    mysql>set global  sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
    立即生效
     
    还需要在my.cnf中添加配置,重启生效:
    [mysqld]
    sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' 
     

    4.spark streaming一直运行,但是kerberos默认24小时超时

    spark.authenticate 是给yarn用的  参数设置成yes 
     

    5.卸载hdp2.3,安装hdp2.4安装报错

    01 Sep 2016 14:36:37,791 ERROR [main] AmbariServer:844 - Failed to run the Ambari Server
    org.apache.ambari.server.AmbariException: Current database store version is not compatible with current server version, serverVersion=2.2.2.0, schemaVersion=2.2.1.1
            at org.apache.ambari.server.controller.utilities.DatabaseChecker.checkDBVersion(DatabaseChecker.java:185)
            at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:835)
     
    执行命令:ambari-server upgrade
     
    [root@ai185 ambari-server]# ambari-server upgrade
    Using python  /usr/bin/python
    Upgrading ambari-server
    Updating properties in ambari.properties ...
    WARNING: Can not find ambari.properties.rpmsave file from previous version, skipping import of settings
    WARNING: Can not find ambari-env.sh.rpmsave file from previous version, skipping restore of environment settings
    Fixing database objects owner
    Ambari Server configured for Embedded Postgres. Confirm you have made a backup of the Ambari Server database [y/n] (y)? y
    Upgrading database schema
    Adjusting ambari-server permissions and ownership...
    Ambari Server 'upgrade' completed successfully. 
     

    6.重新安装hdp2.4报错

    File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 293, in _call
        raise ExecutionFailed(err_msg, code, out, err)
    resource_management.core.exceptions.ExecutionFailed: Execution of 'ambari-sudo.sh /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.5.3.0-37 | tail -1`' returned 1. Traceback (most recent call last):
      File "/usr/bin/hdp-select", line 391, in <module>
        setPackages(pkgs, args[2], options.rpm_mode)
      File "/usr/bin/hdp-select", line 290, in setPackages
        os.symlink(target + "/" + dir, linkname)
    OSError: [Errno 17] File exists
     
    查看/usr/hdp/current下面有没有没有生成软链接的文件,如果没有,删除,类似下面spark2-client需要删除重试
    lrwxrwxrwx.  1 root root   27 Dec 14 10:50 slider-client -> /usr/hdp/2.4.2.0-258/slider
    drwxr-xr-x. 10  500  500 4096 Dec 14 11:28 spark2-client
    lrwxrwxrwx.  1 root root   26 Dec 15 15:37 spark2-historyserver -> /usr/hdp/2.5.3.0-37/spark2
     
    如果还是不行,需要使用hdp-select命令,比如hive-client没有软连接,先删除hive-client  然后再执行:
    hpd-select set hive-client 2.5.3.0-37
    这条命令会自动完成软连接,然后重试 
     

    7.datanode启动报错 

    2015-05-28 21:41:57,544 WARN org.apache.hadoop.hdfs.server.common.Storage: java.io.IOException: Incompatible clusterIDs in /usr/local/hadoop/dfs/datanode: namenode clusterID = CID-e77ee39a-ab4a-4de1-b1a4-9d4da78b83e8; datanode clusterID = CID-6c250e90-658c-4363-9346-972330ff8bf9
    2015-05-28 21:41:57,545 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool <registering> (Datanode Uuid unassigned) service to localhost/127.0.0.1:9000. Exiting. 
    java.io.IOException: All specified directories are failed to load.
        at.. org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:477)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:1387)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:1352)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:316)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:228)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:852)
        at java.lang.Thread.run(Thread.java:745)
    ...blah...
    SHUTDOWN_MSG: 
     
    解决方案:
    查看datanode存储路径中/opt/data1/hadoop/hdfs/data/current/VERSION中clusterID是否一致
    如果不一致,需要改成一致然后重启datanode节点即可 
     
     

    8.启动ambari-server报错

    ERROR: Exiting with exit code -1.
    REASON: Before starting Ambari Server, you must copy the MySQL JDBC driver JAR file to /usr/share/java and set property "server.jdbc.driver.path=[path/to/custom_jdbc_driver]" in ambari.properties.

    解决方案:

    将mysql的驱动包放到/usr/share/java
    在/etc/ambari-server/conf/ambari.properties中添加
    server.jdbc.driver.path=/usr/share/java/mysql-connector-java.jar

    9. 确保.ssh权限如下,权限给多了都不行

    drwx------   2 aif  aif      76 Jul 26 17:18 .ssh

  • 相关阅读:
    sort()的部分用法
    蓝桥杯 算法训练 审美课
    蓝桥杯 基础练习 查找整数
    2018年第九届蓝桥杯【C++省赛B组】【第二题:明码】
    蓝桥杯 特殊回文数
    比较两文本程序
    蓝桥杯 基础练习 十六进制转八进制
    Python | 用Pyinstaller打包发布exe应用
    SpringBoot-04-整合JDBC
    SpringBoot-03-自定义Starter
  • 原文地址:https://www.cnblogs.com/brownyangyang/p/9145859.html
Copyright © 2011-2022 走看看