#–hive运行出错
#–在当前运行环境下tmp/运行用户名(root)/hive.log
#–如果不能发现问题,或者只包code 1/2之间的数据,可以通过namenode检查hadoop运行日志
---☆☆☆☆☆☆☆☆关于服务启动问题
hadoop [ha] running
hadoop ha nn1/nn2 active
mysql[d] running
hiveserver2(RunJar) running
--☆☆☆☆☆☆☆☆检查resourcemanger运行日志,发现异常如下:
Get exception:org.qpache.hadoop.yarn.exception.YarnException: Unauthorized request to start container.
This token is expired. current time is 1598286603872 found 1598258405375
Note: System times on machines may be out of sync.Check system time and time zones.
--解决办法:date +'&z'查看时区
--简单方法
--1、设置时区
rm /etc/localtime
mkdir /etc/locatime
ln -sf /usr/share/zoneinfo/Universal /etc/localtime
--2、查看时区
yum -y install ntp.x86_64
timedatectl
--高阶方法
--本地时钟服务器搭建
rmp -qa|grep ntp
yum -y remove ntpdate-4.2.6p5-29.e17.centos.x86_64
--安装ntp
yum -y install ntp
--修改所有节点的 /etc/ntp.conf
vi /etc/ntp.conf
restrict 20.0.0.100 nomodify notrp nopeer noquery // 当前节点IP地址(剩余110,120,130)
restrict 20.0.0.2 mask 255.255.255.0 nomodify notrap //集群所在网段的网关Gateway,子网掩码Netmask
--主节点配置(选择一个主节点 20.0.0.100)
#server 0.centos.pool.ntp.nog iburst
#server 1.centos.pool.ntp.nog iburst
#server 2.centos.pool.ntp.nog iburst
#server 3.centos.pool.ntp.nog iburst
server 127.127.1.0
Fudge 127.127.1.0 stratum 10
--其他节点
#server 0.centos.pool.ntp.nog iburst
#server 1.centos.pool.ntp.nog iburst
#server 2.centos.pool.ntp.nog iburst
#server 3.centos.pool.ntp.nog iburst
server 127.127.1.100
Fudge 127.127.1.100 stratum 10
--启动ntp服务
server ntpd start
--设置开机启动
chkconfig ntpd on
--查看ntp状态
ntpstat
watch "ntpq -p"
--☆☆☆☆☆☆☆☆控制台报如下错
Error:Error while processiig startement: FAILED:Execution Error,return code 1 f rom org.apache.hadoop.hive.ql.exec.mr.MapRedTask(state=08S01,code=1)
--解决方法1:文件权限无法访问
--设置hdfs访问权限:
hdfs dfs -chmod 777 /path/file
--解决办法2:hive-site.xml : hdfs.permissions 默认是开启的 ->注意:仅测试环境使用
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
--hadoop进去安全模式
NameNode is in safe mode
--解决方案:退出安全模式
hadoop dfsadmin --safemode leave
--内存溢出
java.lang.OutOfMemoryError: Java heap space
--解决方案:修改hadoop配置文件yarn-site.xml
<property>
<name>yarn.scheduler.maximum-allication-mb</name>
<value>2048</value>
</property>
<property>
<name>yarn.scheduler.minimum-allication-mb</name>
<value>2048</value>
</property>
<property>
<name>yarn.nodemanager.vmen-pmem-ratio</name>
<value>2.1</value>
</property>
<property>
<name>mapred.child.java.opts</name>
<value>-Xmx1024m</value>
</property>
---☆☆☆☆☆☆☆☆Hive cli 不显示表头信息:hive-site.xml
<property>
<name>hive.cli.print.header</name>
<value>true</value>
</property>
---☆☆☆☆☆☆☆ yarn集群中所有的namenode都处于standby,通过一下命令强制激活一台namenode
hdfs haadmin -transtitionToAction nn1