您的位置:首页 > 运维架构

hadoop 日常错误解决方法整理

2016-02-24 12:14 309 查看
hadoop 日常错误整理

====描述

hive 执行show tables;

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.unset(Ljava/lang/String;)V

解决方法

hive的版本是0.13.0太高,hadoop的版本较低。 hadoop中没有对应的方法。降低hive的版本到0.11.0

====描述

hive 的sql报错

Expression not in GROUP BY key

原因

sql语句含有groupby 但是意义不明确,比如没有聚合函数

解决方法

修改sql

====描述

hive 的sql报错

Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again

原因

yum install gcc kernel kernel-devel , 重启机器

解决方法

====描述

Building the OpenGL support module

原因

解决方法

export MAKE='/usr/bin/gmake -i'

./VBoxLinuxAdditions.run

====描述

hiveserver 执行的时候报错

jdbc前端报错

Query returned non-zero code: 2, cause: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask

hiveserver日志

org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row

任务的日志

UDFArgumentException: The UDF implementation class 'com.udf.Converter_long2str' is not present in the class path

原因

把udf的jar包放到hive的lib之后, hiveserver 并未加载udf类

解决方法

需要重新启动hiveserver ,重新加载jar包

====描述

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

OpenJDK 64-Bit Server VM warning: You have loaded library /home/soulmachine/local/opt/hadoop-2.2.0/lib/native/libhadoop.so which might have disabled stack guard. The VM will try to fix the stack guard now.

It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

14/02/14 13:14:50 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

localhost

原因

dns中找不到机器名

解决方法

配置文件指定一个 ServerName localhost 即可

====描述

httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.12.210 for ServerName

原因

dns中找不到机器名

解决方法

配置文件指定一个 ServerName localhost 即可

====描述

java.io.IOException: File <filename> could only be replicated to 0 nodes, instead of 1

原因

datanode没有启动成功

解决方法

重新启动datanode,或者namenode 重新format。

====描述:

jianghehui@YunWei-Jumper:~/softs$ mysql -h xxxx -P 3306 -uroot -p

jianghehui@YunWei-Jumper:~/softs$ mysql -h

jianghehui@YunWei-Jumper:~/softs$ mysql -V

jianghehui@YunWei-Jumper:~/softs$ mysql

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

jianghehui@YunWei-Jumper:~/softs$

原因:

编译的时候,bin指定到绝对路径了。

解决方法:

使用绝对路径,或者加到path

====描述:

You don't have permission to access /index.html on this server

原因:

index.html是用root用户建的文件,apache权限不够

解决方法:

打开apache配置文件httpd.conf,找到这么一段:

<Directory />

Options FollowSymLinks

AllowOverride None

Order deny,allow

deny from all

Satisfy all

</Directory>

然后试着把deny from all中的deny改成了allow,保存后重起了apache,然后再一测试我的网页就正常了.

====描述:

mysql reset slave 执行还有遗留信息

原因:

xxx

解决方法:

使用reset slave all

====描述:

No job jar file set. User classes may not be found.See JobConf(Class) or JobConf#setJar(String).

需要将class放到jar包中运行

not a SequenceFile

指定为seqfile,需要创建seqfile

job Submission failed with exception 'java.io.IOException(The ownership/permissions on the staging directory /tmp/hadoop-hadoop-user1/mapred/staging/hadoop-user1/.staging is not as expected. It is owned by hadoop-user1 and permissions are rwxrwxrwx. The directory
must be owned by the submitter hadoop-user1 or by hadoop-user1 and permissions must be rwx------)

hadoop fs -chmod -R 700 /tmp/hadoop-hadoop-user1/mapred/staging/hadoop-user1/.staging

Permission denied: user=xxj, access=WRITE, inode="user":hadoop:supergroup:rwxr-xr-x

<property>

<name>dfs.permissions</name>

<value>false</value>

</property>

writablename cannot load class

自己写的writable对象不在classpath中

Type mismatch in key from map: expected org.apache.hadoop.io.BytesWritable, recieved org.apache.hadoop.io.LongWritable

key的类型和指定的不匹配

Cleaning up the staging area hdfs://192.168.12.200:9000/tmp/hadoop-root/mapred/staging/jianghehui/.staging/job_201307172232_0004

原因:

hadoop

解决方法:

sql语句执行有问题,比如没有指定库名 直接使用表名字

====描述:

PHP startup: Unable to load dynamic library './php_mysql.dll 找不到指定的模块

undefined function mysql_connect()

原因:

xxx

解决方法:

总结如下:

extension_dir要设置正确。

PHP的安装目录添加到%path%中

还有 把所依赖的dll拷贝到%windir%\system32

====描述

device "eth0" does not seem to be present, delaying initialization

原因

虚拟机用模板做linux的时候因为网卡配置信息(主要是MAC)也复制过去,但是虚拟服务器会分配另外的一个mac地址,启用的时候会出错

解决方法

1.打开etc/sysconfig/network-scripts/ ficfg-eth0,确定ONBOOT应该为yes,

2.检查ficfg-eth0的MAC和ifconfig现实的MAC是否相符,并修改ficfg-eth0的MAC。

3.重启服务,service NetworkManager restart ,service network restart.

4.然后系统会自动识别到网卡信息,就ok了。

====描述

Keepalived 测试不成功,查看 /var/log/messages

Keepalived_healthcheckers: IPVS: Can't initialize ipvs: Protocol not available

原因

是否lvs模块加载异常,于是lsmod|grep ip_vs发现果然没有相应的模块,而正常情况下应该是有的

解决方法

手动加载ip_vs模块

modprobe ip_vs

modprobe ip_vs_wrr

添加进/etc/rc.local开机自动加载

modprobe ip_vs

modprobe ip_vs_wrr

====描述

hive> show tables;

FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught.

NestedThrowables:

java.lang.reflect.InvocationTargetException

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

原因

不知道

解决方法

delete $HADOOP_HOME/build

====描述

WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.

文档格式(如下):

原因

过时的类

解决方法

把所有配置文件中的EventCounter 替换成org.apache.hadoop.metrics.jvm.EventCounter。包括lib/hive-common-0.10.0.jar!/hive-log4j.properties。

====描述

java.io.IOException: File <filename> could only be replicated to 0 nodes, instead of 1

原因

datanode没有启动成功

解决方法

重新启动datanode,或者namenode 重新format。

====描述

hadoop 启动的时候 JAVA_HOME is not set and could not be found.

原因

xxx

解决方法

libexec/hadoop-config.sh 或者其他的脚本里面手动设置JAVA_HOME变量

====描述

hive> show tables;

FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

原因

驱动没加载成功

数据库没有创建,并且url没有配置createDatabaseIfNotExist=true

解决方法

把mysql或者derby的驱动加到path里面去

====描述

eclipse cdt 启动的时候报错

Failed to load the JNI shared library

原因

jdk的版本是64bit , 而eclipse是32bit。位数不一致。

解决方法

安装bit一致的jdk和eclipse

====描述

hive 使用mysql元数据库的时候 ,show tables 报错 Index column size too large. The maximum column size is 767 bytes.

原因

xxx

解决方法

将数据库的字符集改成latin1

====描述

hive 执行查询的时候,表明明存在,却报错Table not found

原因

xxx

解决方法

表名字前面加上库名

====描述

xxx

原因

xxx

解决方法

xxx

====描述

xxx

原因

xxx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: