linux环境:Oracle Linux Server release 6.3 (64位)
编译环境:由于公司服务器不能联网,故在本机win8下的虚拟机中编译(虚拟机中同样是Oracle Linux Server release 6.3 (64位))
节点:一共配置了三个节点,主节点qzj05(ip:192.168.10.199),子节点qzj02(ip:192.168.10.197)和qzj04(ip:192.168.10.198)
用户:专门创建了个名为grid的用户来进行本次安装配置
吐个小槽:本来以为搭个环境,应该很容易,没想到前前后后花了差不多两个星期,期间各种问题,每天chrome标签栏开几十个网页来找原因,感觉自己像在泡实验室一样。还好期间得到某男程序员大力支持,好多我无力解决的问题都靠他解决了,瞬间觉得自己好菜,希望未来能变成一个强大的人,上得了厅堂下得了厨房,写得出代码查得出异常 = =分享此文与大家共勉
ii. 报错:
[ERROR]Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run(make) on project hadoop-pipes: An Ant BuildException has occured: execreturned: 1
[ERROR]around Ant part ...<execdir="/home/grid/release-2.3.0/hadoop-tools/hadoop-pipes/target/native"executable="cmake" failonerror="true">... @ 5:118 in/home/grid/release-2.3.0/hadoop-tools/hadoop-pipes/target/antrun/build-main.xml
解决方法:openssl-devel没装上,重装下openssl-devel就好了
CREATE TABLE hbase_table_1(key int,valuestring) STORED BY
'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" =":key,cf1:val") TBLPROPERTIES ("hbase.table.name" ="xyz");
复制代码
8. 报错及解决方法
i. 报错:
Exception in thread "main"java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiateorg.apache.hadoop.hive.metastore.HiveMetaStoreClient
Caused by: MetaException(message:Versioninformation not found in metastore. )
修改权限为777 (chmod 777 mysql-connector-java-3.1.12-bin.jar)
修改conf/hive-site.xml 中的“hive.metastore.schema.verification” 值为 false
ii. 报错:
javax.jdo.JDOFatalDataStoreException:Unable to open a test connection to the given database. JDBC url =jdbc:mysql://qzj05:3306/metastore?createDatabaseIfNotExist=true, username =root. Terminating connection pool. Original Exception: ------
java.sql.SQLException: Access denied foruser 'root'@'qzj05' (using password: YES)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3649)
at com.mysql.jdbc.MysqlIO.doHandshake(
MysqlIO.java:1176)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2558)
解决方法:将mysql中密码为空的设置为123456
iii. 报错:
: command not found14.0/bin/ext/beeline.sh:line 15:
: command not found14.0/bin/ext/beeline.sh:line 19:
/u02/hadoop/hive-0.14.0/bin/ext/beeline.sh:line 20: syntax error near unexpected t'ken `{
'u02/hadoop/hive-0.14.0/bin/ext/beeline.sh:line 20: `beeline () {
: command notfound14.0/bin/ext/metatool.sh: line 15:
: command notfound14.0/bin/ext/metatool.sh: line 18:
/u02/hadoop/hive-0.14.0/bin/ext/metatool.sh:line 19: syntax error near unexpected 'oken `{
'u02/hadoop/hive-0.14.0/bin/ext/metatool.sh:line 19: `metatool () {
Service cli not found
orcfiledump rcfilecat schemaTool versionineage metastore metatool 解决方法:
vi -b $HIVE_HOME/bin/ext/beeline.sh 发现每行行尾多了个^M,这是由于该文本应该在C环境下编辑过,Linux编辑器对文件行末的回车符处理不一致,在Linux下经常能看到C文件或者TXT文件每行末尾都有一个^M符号,这个会导致shell脚本运行错误
在命令编辑行<按ESC键然后shift+:冒号>输入:%s/^M//g 这样就删除了行尾的^M,同理处理$HIVE_HOME/bin/ext/metatool.sh
sqoop:000> set server --host192.168.10.199 --port 12000 --webapp sqoop
sqoop:000> show version --all
复制代码
在server上
./bin/sqoop.sh client
复制代码
create connection --cid 1
复制代码
Connection with id 1 and name Firstconnection (Enabled: true, Created by grid at 4/16/14 4:21 PM, Updated by gridat 4/17/14 1:06 PM)
Using Connector id 1
Connection configuration
JDBC Driver Class: com.mysql.jdbc.Driver
JDBC Connection String: jdbc:mysql://192.168.10.199:3306/hiveMeta
Username: root
Password:
JDBC Connection Properties:
Security related configuration options
Max connections: 100
6. 报错及解决方法
i. submission start --jid 1 时
报错:No such property: start for class: groovysh_evaluate
解决方法:改成start job --jid 1
ii. status job --jid 1时
报错:Exception: org.apache.sqoop.common.SqoopException Message:CLIENT_0001:Server has returned exception
解决方法:show job 发现没有id为1的job,之前删除了id为1的job,新建的job id为2
status job --jid 2
iii. 运行job最后状态为failed,检查日志报错
Application application_1397717698978_0004failed 2 times due to AM Container for appattempt_1397717698978_0004_000002exited with exitCode: 1 due to: Exception from container-launch:org.apache.hadoop.util.Shell$ExitCodeException:
org.apache.hadoop.util.Shell$ExitCodeException:
atorg.apache.hadoop.util.Shell.runCommand(Shell.java:505)
atorg.apache.hadoop.util.Shell.run(Shell.java:418)
atorg.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:650)
atorg.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
atorg.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:283)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:79)
atjava.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
atjava.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Container exited with a non-zero exit code1
.Failing this attempt.. Failing theapplication.
执行如下命令测试job:
$HADOOP_HOME/bin/hadoop jar$HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.3.0.jar pi 10 5
如果报错则说明hadoop配置有问题,检查$HADOOP_HOME/etc/hadoop/mapred-site.xml
发现mapreduce.jobhistory.webapp.address这个参数配错了,应为qzj05:19888
iv. 编译时报错:Too many unapproved licenses: 1
vi /etc/profile
export MAVEN_OPTS="-Xms512m -Xmx1024m-XX:PermSize=256m -XX:MaxPermSize=512m"
v. 编译时报错:
Arequired class was missing while executingorg.apache.maven.plugins:maven-site-plugin:3.0-beta-3:site:org/sonatype/aether/graph/DependencyFilter
解决方法:
vi ./docs/pom.xml
将
<id>packaging-documentation</id>
<phase>package</phase>