问题描述
我在使用 mariadb 教程关注 apache hadoop-oozie 时出错。我是这样运行的:
ooziedb.sh create -sqlfile ooziedb_init_schema.sql -run
但我明白了:
ai@spkm:~/oozie$ ooziedb.sh create -sqlfile ooziedb_init_schema.sql -run
Validate DB Connection
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/aI/Oozie/lib/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/aI/Oozie/libext/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
DONE
DB schema does not exist
Check OOZIE_SYS table does not exist
DONE
Create sql schema
"~/.bashrc"
Error: org.apache.openjpa.persistence.PersistenceProductDerivation:java.util.MissingResourceException: The specified XML resource "persistence.xml" for persistence unit "oozie-mariadb" can't be found in your class path.
Stack trace for the error was (for debug purposes):
--------------------------------------
java.util.MissingResourceException: org.apache.openjpa.persistence.PersistenceProductDerivation:java.util.MissingResourceException: The specified XML resource "persistence.xml" for persistence unit "oozie-mariadb" can't be found in your class path.
at org.apache.openjpa.lib.conf.ProductDerivations.reportErrors(ProductDerivations.java:380)
at org.apache.openjpa.lib.conf.ProductDerivations.load(ProductDerivations.java:283)
at org.apache.openjpa.lib.conf.Configurations.populateConfiguration(Configurations.java:356)
at org.apache.openjpa.jdbc.Meta.MappingTool.run(MappingTool.java:1003)
at org.apache.openjpa.jdbc.Meta.MappingTool$1.run(MappingTool.java:949)
at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:764)
at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:754)
at org.apache.openjpa.jdbc.Meta.MappingTool.main(MappingTool.java:944)
at org.apache.oozie.tools.OozieDBCLI.createUpgradeDB(OozieDBCLI.java:1153)
at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:198)
at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:135)
at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:83)
Caused by: java.util.MissingResourceException: The specified XML resource "persistence.xml" for persistence unit "oozie-mariadb" can't be found in your class path.
at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:532)
at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:363)
at org.apache.openjpa.lib.conf.ProductDerivations.load(ProductDerivations.java:274)
... 10 more
-------------------------------------
core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://spkm:9000</value>
</property>
<property>
<name>hadoop.proxyuser.ai.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.ai.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.http.authentication.cookie.persistent</name>
<value>true</value>
</property>
</configuration>
hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/home/ai/data/dfs/namenode</value>
</property>
<property>
<name>dfs.namenode.checkpoint.dir</name>
<value>/home/ai/data/dfs/namesecondary</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/home/ai/data/dfs/datanode</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.http.address</name>
<value>spkm:9080</value>
</property>
</configuration>
mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
工人
spkw
我的 oozie-site.xml
<configuration>
<property>
<name>oozie.service.JPAService.jdbc.driver</name>
<value>com.MysqL.cj.jdbc.Driver</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.url</name>
<value>jdbc:mariadb://spkm:3306/oozie</value>
</property>
<property>
<name>oozie.service.JPAService.create.db.schema</name>
<value>true</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.username</name>
<value>oozie</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.password</name>
<value>oozie</value>
</property>
</configuration>
我的 /etc/profile
export JAVA_HOME=/usr/lib/jvm/java
export HADOOP_HOME=/home/ai/hadoop
export CLASS_PATH=$JAVA_HOME/lib:$CLASS_PATH
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
export SCRIPT_HOME=/home/ai/scripts
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
export SPARK_HOME=/home/ai/spark
export PATH=$PATH:$SPARK_HOME/bin:$PSARK_HOME/sbin
export MAVEN_HOME=/usr/bin/maven
export PATH=$PATH:$MAVEN_HOME/bin
export OOZIE_HOME=/home/aI/Oozie
export PATH=$PATH:$OOZIE_HOME/bin
**附加 Hadoop 版本 3.2.2 火花版本 3.0.2 oozie 版本 5.2.1 行家 3.6.3 java openjdk 1.8
我不知道为什么它不起作用。
为什么oozie 需要一个“presistence.xml”文件来运行sql?为什么我的代码不起作用?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)