Oozie 大数据开发标配 (二)-定时任务
一、修改时间配置
查看当前时间:
[root@homaybd05 oozie]# date -R
Sat, 19 Mar 2022 18:10:59 +0800
进入oozie安装路径:
cd /usr/hdp/3.1.0.0-78/oozie
1) 、配置 oozie-site.xml
文件
属性:oozie.processing.timezone
属性值:GMT+0800
解释:修改时区为东八区区时
注:该属性去 oozie-default.xml
中找到即可
cd /usr/hdp/3.1.0.0-78/oozie/conf
vi oozie-site.xml
<property>
<name>oozie.processing.timezone</name>
<value>GMT+0800</value>
</property>
配置完之后:
[root@homaybd05 conf]# cat oozie-site.xml
<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
<property>
<name>credentialStoreClassPath</name>
<value>/var/lib/ambari-agent/cred/lib/*</value>
</property>
<property>
<name>hadoop.security.credential.provider.path</name>
<value>localjceks://file/usr/hdp/current/oozie-server/conf/oozie-site.jceks</value>
</property>
<property>
<name>oozie.action.retry.interval</name>
<value>30</value>
</property>
<property>
<name>oozie.action.sharelib.for.spark.exclude</name>
<value>oozie/jackson.*</value>
</property>
<property>
<name>oozie.authentication.authentication.provider.url</name>
<value></value>
</property>
<property>
<name>oozie.authentication.expected.jwt.audiences</name>
<value></value>
</property>
<property>
<name>oozie.authentication.jwt.cookie</name>
<value>hadoop-jwt</value>
</property>
<property>
<name>oozie.authentication.public.key.pem</name>
<value></value>
</property>
<property>
<name>oozie.authentication.simple.anonymous.allowed</name>
<value>true</value>
</property>
<property>
<name>oozie.authentication.type</name>
<value>simple</value>
</property>
<property>
<name>oozie.base.url</name>
<value>http://homaybd05:11000/oozie</value>
</property>
<property>
<name>oozie.credentials.credentialclasses</name>
<value>hcat=org.apache.oozie.action.hadoop.HiveCredentials,hive2=org.apache.oozie.action.hadoop.Hive2Credentials</value>
</property>
<property>
<name>oozie.db.schema.name</name>
<value>oozie</value>
</property>
<property>
<name>oozie.service.ActionService.executor.ext.classes</name>
<value>
org.apache.oozie.action.email.EmailActionExecutor,
org.apache.oozie.action.hadoop.ShellActionExecutor,
org.apache.oozie.action.hadoop.SqoopActionExecutor,
org.apache.oozie.action.hadoop.DistcpActionExecutor</value>
</property>
<property>
<name>oozie.service.AuthorizationService.security.enabled</name>
<value>true</value>
</property>
<property>
<name>oozie.service.CallableQueueService.callable.concurrency</name>
<value>3</value>
</property>
<property>
<name>oozie.service.CallableQueueService.queue.size</name>
<value>1000</value>
</property>
<property>
<name>oozie.service.CallableQueueService.threads</name>
<value>10</value>
</property>
<property>
<name>oozie.service.coord.normal.default.timeout</name>
<value>120</value>
</property>
<property>
<name>oozie.service.coord.push.check.requeue.interval</name>
<value>30000</value>
</property>
<property>
<name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
<value>*=/usr/hdp/3.1.0.0-78/hadoop/conf</value>
</property>
<property>
<name>oozie.service.HadoopAccessorService.kerberos.enabled</name>
<value>false</value>
</property>
<property>
<name>oozie.service.JPAService.create.db.schema</name>
<value>false</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.driver</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.url</name>
<value>jdbc:mysql://homaybd05/oozie</value>
</property>
<property>
<name>oozie.service.JPAService.jdbc.username</name>
<value>oozie</value>
</property>
<property>
<name>oozie.service.JPAService.pool.max.active.conn</name>
<value>10</value>
</property>
<property>
<name>oozie.service.PurgeService.older.than</name>
<value>30</value>
</property>
<property>
<name>oozie.service.PurgeService.purge.interval</name>
<value>3600</value>
</property>
<property>
<name>oozie.service.SchemaService.wf.ext.schemas</name>
<value>shell-action-0.1.xsd,email-action-0.1.xsd,hive-action-0.2.xsd,sqoop-action-0.2.xsd,ssh-action-0.1.xsd,distcp-action-0.1.xsd,shell-action-0.2.xsd,oozie-sla-0.1.xsd,oozie-sla-0.2.xsd,hive-action-0.3.xsd</value>
</property>
<property>
<name>oozie.service.SparkConfigurationService.spark.configurations</name>
<value>*=/usr/hdp/current/spark-client/conf</value>
</property>
<property>
<name>oozie.service.URIHandlerService.uri.handlers</name>
<value>org.apache.oozie.dependency.FSURIHandler,org.apache.oozie.dependency.HCatURIHandler</value>
</property>
<property>
<name>oozie.service.WorkflowAppService.system.libpath</name>
<value>/user/${user.name}/share/lib</value>
</property>
<property>
<name>oozie.services</name>
<value>
org.apache.oozie.service.SchedulerService,
org.apache.oozie.service.InstrumentationService,
org.apache.oozie.service.CallableQueueService,
org.apache.oozie.service.UUIDService,
org.apache.oozie.service.ELService,
org.apache.oozie.service.AuthorizationService,
org.apache.oozie.service.UserGroupInformationService,
org.apache.oozie.service.HadoopAccessorService,
org.apache.oozie.service.URIHandlerService,
org.apache.oozie.service.MemoryLocksService,
org.apache.oozie.service.DagXLogInfoService,
org.apache.oozie.service.SchemaService,
org.apache.oozie.service.LiteWorkflowAppService,
org.apache.oozie.service.JPAService,
org.apache.oozie.service.StoreService,
org.apache.oozie.service.SLAStoreService,
org.apache.oozie.service.DBLiteWorkflowStoreService,
org.apache.oozie.service.CallbackService,
org.apache.oozie.service.ActionService,
org.apache.oozie.service.ActionCheckerService,
org.apache.oozie.service.RecoveryService,
org.apache.oozie.service.PurgeService,
org.apache.oozie.service.CoordinatorEngineService,
org.apache.oozie.service.BundleEngineService,
org.apache.oozie.service.DagEngineService,
org.apache.oozie.service.CoordMaterializeTriggerService,
org.apache.oozie.service.StatusTransitService,
org.apache.oozie.service.PauseTransitService,
org.apache.oozie.service.GroupsService,
org.apache.oozie.service.ProxyUserService,
org.apache.oozie.service.JobsConcurrencyService,
org.apache.oozie.service.ShareLibService,
org.apache.oozie.service.SparkConfigurationService,
org.apache.oozie.service.XLogStreamingService</value>
</property>
<property>
<name>oozie.services.ext</name>
<value>
org.apache.oozie.service.JMSAccessorService,org.apache.oozie.service.PartitionDependencyManagerService,org.apache.oozie.service.HCatAccessorService</value>
</property>
<property>
<name>oozie.system.id</name>
<value>oozie-${user.name}</value>
</property>
<property>
<name>oozie.systemmode</name>
<value>NORMAL</value>
</property>
<property>
<name>use.system.libpath.for.mapreduce.and.pig.jobs</name>
<value>false</value>
</property>
<!-- Time Zone -->
<property>
<name>oozie.processing.timezone</name>
<value>GMT+0800</value>
</property>
</configuration>
[root@homaybd05 conf]#
然后停止服务:
[root@homaybd05 oozie]# bin/oozied.sh stop
2)修改js框架中的关于时间设置的代码
$ cd /usr/hdp/3.1.0.0-78/oozie/oozie-server/webapps/oozie
[root@homaybd05 oozie]# ls -l
total 124
drwxr-xr-x. 2 oozie hadoop 25 Mar 10 15:45 admin
drwxr-xr-x. 3 oozie hadoop 17 Mar 10 15:45 console
drwxr-xr-x. 2 oozie hadoop 31 Mar 10 15:45 docs
drwxr-xr-x. 9 oozie hadoop 254 Mar 10 15:45 ext-2.2
-rw-r--r--. 1 oozie hadoop 3734 Dec 6 2018 index.html
drwxr-xr-x. 3 oozie hadoop 57 Mar 10 15:45 META-INF
-rw-r--r--. 1 oozie hadoop 4660 Dec 6 2018 oozie_50x.png
-rw-r--r--. 1 oozie hadoop 1108 Dec 6 2018 oozie-console.css
-rw-r--r--. 1 oozie hadoop 107209 Dec 6 2018 oozie-console.js
drwxr-xr-x. 4 oozie hadoop 47 Mar 10 15:45 WEB-INF
$ vi /usr/hdp/3.1.0.0-78/oozie/oozie-server/webapps/oozie/oozie-console.js
修改如下:
function getTimeZone() {
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
return Ext.state.Manager.get("TimezoneId","GMT+0800");
}
3)重启oozie服务,并重启浏览器(一定要注意先清除缓存)
清除缓存:
①、清除oozie-server缓存
[root@homaybd05 oozie-server]# cd /usr/hdp/3.1.0.0-78/oozie/oozie-server
[root@homaybd05 oozie-server]# cd work
[root@homaybd05 work]# ls -l
total 0
drwxr-xr-x. 3 oozie hadoop 23 Mar 4 16:35 Catalina
[root@homaybd05 work]# rm -rf ./Catalina/
②、清除config缓存
[root@homaybd05 conf]# ls -l
total 200
drwxr-xr-x. 3 oozie hadoop 23 Mar 4 16:35 Catalina
-rwxr-xr-x. 1 oozie hadoop 10572 Dec 6 2018 catalina.policy
-rwxr-xr-x. 1 oozie hadoop 3803 Dec 6 2018 catalina.properties
-rwxr-xr-x. 1 oozie hadoop 1415 Dec 6 2018 context.xml
-rwxr-xr-x. 1 oozie hadoop 3237 Dec 6 2018 logging.properties
-rwxr-xr-x. 1 oozie hadoop 6607 Mar 10 15:44 server.xml
drwxr-xr-x. 2 oozie hadoop 65 Mar 4 16:21 ssl
-rwxr-xr-x. 1 oozie hadoop 1950 Dec 6 2018 tomcat-users.xml
-rwxr-xr-x. 1 oozie hadoop 164845 Dec 6 2018 web.xml
[root@homaybd05 conf]# pwd
/usr/hdp/3.1.0.0-78/oozie/oozie-server/conf
[root@homaybd05 conf]# cd /usr/hdp/3.1.0.0-78/oozie/oozie-server/conf
[root@homaybd05 conf]# rm -rf ./Catalina/
直接在界面重启oozie:
或者命令行重启:
[atguigu@hadoop102 oozie-4.0.0-cdh5.3.6]$ bin/oozied.sh stop
[atguigu@hadoop102 oozie-4.0.0-cdh5.3.6]$ bin/oozied.sh start
可以看到页面上已经是东八区了:
二、官方示例
1)拷贝官方模板配置定时任务
$ cd /usr/hdp/3.1.0.0-78/oozie/doc/examples/apps
$ cp -r doc/examples/apps/cron/ oozie-apps/
[root@homaybd05 cron]# pwd
/usr/hdp/3.1.0.0-78/oozie/oozie-apps/cron
[root@homaybd05 cron]# ls -l
total 12
-rw-r--r--. 1 root root 1600 Mar 12 00:59 coordinator.xml
-rw-r--r--. 1 root root 1105 Mar 12 00:53 job.properties
-rw-r--r--. 1 root root 1020 Mar 12 00:43 workflow.xml
创建 p3.sh
vi p3.sh
内容:
#!/bin/bash
date > /opt/module/p1.log
2)修改模板 job.properties
和 coordinator.xml
以及 workflow.xml
job.properties
#HDFS地址
nameNode=hdfs://homaybd01:8020
#ResourceManager地址,yarn,服务端口
jobTracker=homaybd01:8050
#队列名称
queueName=default
examplesRoot=oozie-apps
oozie.coord.application.path=${nameNode}/user/${user.name}/${examplesRoot}/cron
#start:必须设置为未来时间,否则任务失败
start=2022-03-12T01:00+0800
end=2022-03-13T01:00+0800
workflowAppUri=${nameNode}/user/${user.name}/${examplesRoot}/cron
EXEC3=p3.sh
coordinator.xml
<coordinator-app name="cron-coord" frequency="${coord:minutes(5)}" start="${start}" end="${end}" timezone="GMT+0800" xmlns="uri:oozie:coordinator:0.2">
<action>
<workflow>
<app-path>${workflowAppUri}</app-path>
<configuration>
<property>
<name>jobTracker</name>
<value>${jobTracker}</value>
</property>
<property>
<name>nameNode</name>
<value>${nameNode}</value>
</property>
<property>
<name>queueName</name>
<value>${queueName}</value>
</property>
</configuration>
</workflow>
</action>
</coordinator-app>
注意:这里的时区是:timezone="GMT+0800"
workflow.xml
<workflow-app xmlns="uri:oozie:workflow:0.5" name="one-op-wf">
<start to="p3-shell-node"/>
<action name="p3-shell-node">
<shell xmlns="uri:oozie:shell-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<exec>${EXEC3}</exec>
<file>/user/root/oozie-apps/cron/${EXEC3}#${EXEC3}</file>
<!-- <argument>my_output=Hello Oozie</argument>-->
<capture-output/>
</shell>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Shell action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<kill name="fail-output">
<message>Incorrect output, expected [Hello Oozie] but was [${wf:actionData('shell-node')['my_output']}]</message>
</kill>
<end name="end"/>
</workflow-app>
3)上传配置
[root@homaybd05 oozie]# hadoop fs -put oozie-apps/cron/ /user/root/oozie-apps
[root@homaybd05 oozie]# hadoop fs -ls /user/root/oozie-apps/cron
Found 4 items
-rw-r--r-- 3 root hdfs 1600 2022-03-12 01:23 /user/root/oozie-apps/cron/coordinator.xml
-rw-r--r-- 3 root hdfs 1105 2022-03-12 01:23 /user/root/oozie-apps/cron/job.properties
-rw-r--r-- 3 root hdfs 38 2022-03-12 01:23 /user/root/oozie-apps/cron/p3.sh
-rw-r--r-- 3 root hdfs 1840 2022-03-12 01:23 /user/root/oozie-apps/cron/workflow.xml
[root@homaybd05 oozie]#
shell脚本设置为可执行脚本:
[root@homaybd05 oozie]# hadoop fs -chmod 755 /user/root/oozie-apps/cron/p3.sh
[root@homaybd05 oozie]# hadoop fs -ls /user/root/oozie-apps/cron
Found 4 items
-rw-r--r-- 3 root hdfs 1600 2022-03-12 01:23 /user/root/oozie-apps/cron/coordinator.xml
-rw-r--r-- 3 root hdfs 1105 2022-03-12 01:23 /user/root/oozie-apps/cron/job.properties
-rwxr-xr-x 3 root hdfs 38 2022-03-12 01:23 /user/root/oozie-apps/cron/p3.sh
-rw-r--r-- 3 root hdfs 1840 2022-03-12 01:23 /user/root/oozie-apps/cron/workflow.xml
[root@homaybd05 oozie]#
在hadoop管理后台查看上传的文件:
http://homaybd01:50070/explorer.html#/user/root/oozie-apps/cron
4)启动任务
[root@homaybd05 oozie]# bin/oozie job -oozie http://homaybd05:11000/oozie -config oozie-apps/cron/job.properties -run
Error: E1003 : E1003: Invalid coordinator application attributes, parameter [start] = [2022-03-12T01:00+0800] must be Date in UTC format (yyyy-MM-dd'T'HH:mm'Z'). Parsing error java.text.ParseException: Could not parse [2022-03-12T01:00+0800] using [yyyy-MM-dd'T'HH:mm'Z'] mask
[root@homaybd05 oozie]#
报了这样的错误,原来是 oozie-site.xml
文件没有修改成功。
E325: ATTENTION
Found a swap file by the name ".oozie-site.xml.swp"
owned by: root dated: Fri Mar 11 23:35:34 2022
file name: /etc/oozie/3.1.0.0-78/0/oozie-site.xml
modified: no
user name: root host name: homaybd05
process ID: 14077 (still running)
While opening file "oozie-site.xml"
dated: Sat Mar 12 13:53:58 2022
NEWER than swap file!
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r oozie-site.xml"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".oozie-site.xml.swp"
to avoid this message.
-- More --
修改配置的起始时间必须大于当前时间,因为当前时间为凌晨 1:38,所以,job.properties 起始时间改为未来时间。
[root@homaybd05 oozie]# hadoop fs -rm -r /user/root/oozie-apps/cron/job.properties
[root@homaybd05 oozie]# hadoop fs -put oozie-apps/cron/job.properties /user/root/oozie-apps/cron/
注意:Oozie允许的最小执行任务的频率是 5 分钟
重新起任务:
[root@homaybd05 oozie]# bin/oozie job -oozie http://homaybd05:11000/oozie -config oozie-apps/cron/job.properties -run
job: 0000000-220320113610665-oozie-root-C
刚才的任务执行失败了,可以直接kill掉
[root@homaybd05 oozie]# bin/oozie job -oozie http://homaybd05:11000/oozie -kill 0000047-220320113610665-oozie-root-W
三、 调度Hive脚本
查看官方自带的Hive示例,先看目录结构:
[root@homaybd05 hive2]# ls -l
total 24
-rw-r--r--. 1 oozie hadoop 1046 Dec 6 2018 job.properties
-rw-r--r--. 1 oozie hadoop 1087 Dec 6 2018 job.properties.security
-rw-r--r--. 1 oozie hadoop 681 Dec 6 2018 README
-rw-r--r--. 1 oozie hadoop 966 Dec 6 2018 script.q
-rw-r--r--. 1 oozie hadoop 2073 Dec 6 2018 workflow.xml
-rw-r--r--. 1 oozie hadoop 2481 Dec 6 2018 workflow.xml.security
查看SQL脚本:
[root@homaybd05 hive2]# cat script.q
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
DROP TABLE IF EXISTS test;
CREATE EXTERNAL TABLE test (a INT) STORED AS TEXTFILE LOCATION '${INPUT}';
INSERT OVERWRITE DIRECTORY '${OUTPUT}' SELECT * FROM test;
[root@homaybd05 hive2]#
查看 workflow.xml
文件内容:
[root@homaybd05 hive2]# cat workflow.xml
<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns="uri:oozie:workflow:0.5" name="hive2-wf">
<start to="hive2-node"/>
<action name="hive2-node">
<hive2 xmlns="uri:oozie:hive2-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data/hive2"/>
<mkdir path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data"/>
</prepare>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<jdbc-url>${jdbcURL}</jdbc-url>
<script>script.q</script>
<param>INPUT=/user/${wf:user()}/${examplesRoot}/input-data/table</param>
<param>OUTPUT=/user/${wf:user()}/${examplesRoot}/output-data/hive2</param>
</hive2>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Hive2 (Beeline) action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
查看 job.properties
文件内容:
[root@homaybd05 hive2]# cat job.properties
nameNode=hdfs://localhost:8020
jobTracker=localhost:8021
queueName=default
jdbcURL=jdbc:hive2://localhost:10000/default
examplesRoot=examples
oozie.use.system.libpath=true
oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/hive2
[root@homaybd05 hive2]#
四、 常见问题总结
1)Mysql权限配置
授权所有主机可以使用root用户操作所有数据库和数据表
mysql> grant all on *.* to root@'%' identified by '000000';
mysql> flush privileges;
mysql> exit;
2)workflow.xml配置的时候不要忽略file属性
3)jps查看进程时,注意有没有bootstrap
4)关闭oozie
如果 bin/oozied.sh stop
无法关闭,则可以使用 kill -9 [pid]
,之后 oozie-server/temp/xxx.pid
文件一定要删除。
5)Oozie重新打包时,一定要注意先关闭进程,删除对应文件夹下面的pid文件。(可以参考第4条目)
6)配置文件一定要生效
起始标签和结束标签无对应则不生效,配置文件的属性写错了,那么则执行默认的属性。
7)libext下边的jar存放于某个文件夹中,导致share/lib创建不成功。
8)调度任务时,找不到指定的脚本,可能是oozie-site.xml里面的Hadoop配置文件没有关联上。
9)修改Hadoop配置文件,需要重启集群。一定要记得scp到其他节点。
10)JobHistoryServer必须开启,集群要重启的。
11)Mysql配置如果没有生效的话,默认使用derby数据库。
12)在本地修改完成的job配置,必须重新上传到HDFS。
13)将HDFS中上传的oozie配置文件下载下来查看是否有错误。
14)Linux用户名和Hadoop的用户名不一致。
15)如果出现这样的问题:
[root@hxxxbd05 oozie]# bin/oozie job -oozie http://xxxybd05:11000/oozie -config oozie-apps/shell/job.pr-run
Error: HTTP error code: 404 : Not Found
while starting oozie service getting below error:
oozie server status:Execution of 'source /usr/hdp/current/oozie-server/conf/oozie-env.sh ; oozie admin -oozie http://master1:11000/oozie -status' returned 255. Connection exception has occurred [ java.net.ConnectException Connection refused (Connection refused) ]. Trying after 1 sec. Retry count = 1 Connection exception has occurred [ java.net.ConnectException Connection refused (Connection refused) ].
请看官网解决方案:oozie not starting,giving below alert
解决步骤:
# Run below command
/usr/hdp/current/oozie-server/bin/oozie-setup.sh prepare-war
[root@hxxxbd05 oozie]# /usr/hdp/current/oozie-server/bin/oozie-setup.sh prepare-war
setting OOZIE_CONFIG=${OOZIE_CONFIG:-/usr/hdp/current/oozie-server/conf}
setting CATALINA_BASE=${CATALINA_BASE:-/usr/hdp/current/oozie-server/oozie-server}
setting CATALINA_TMPDIR=${CATALINA_TMPDIR:-/var/tmp/oozie}
setting OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat
setting JAVA_HOME=/usr/local/jdk1.8.0_131
setting JRE_HOME=${JAVA_HOME}
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx2048m"
setting OOZIE_LOG=/var/log/oozie
setting CATALINA_PID=/var/run/oozie/oozie.pid
setting OOZIE_DATA=/hadoop/oozie/data
setting OOZIE_HTTP_PORT=11000
setting OOZIE_ADMIN_PORT=11001
setting JAVA_LIBRARY_PATH=/usr/hdp/3.1.0.0-78/hadoop/lib/native/Linux-amd64-64
setting OOZIE_CLIENT_OPTS="${OOZIE_CLIENT_OPTS} -Doozie.connection.retry.count=5 "
setting OOZIE_CONFIG=${OOZIE_CONFIG:-/usr/hdp/current/oozie-server/conf}
setting CATALINA_BASE=${CATALINA_BASE:-/usr/hdp/current/oozie-server/oozie-server}
setting CATALINA_TMPDIR=${CATALINA_TMPDIR:-/var/tmp/oozie}
setting OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat
setting JAVA_HOME=/usr/local/jdk1.8.0_131
setting JRE_HOME=${JAVA_HOME}
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx2048m"
setting OOZIE_LOG=/var/log/oozie
setting CATALINA_PID=/var/run/oozie/oozie.pid
setting OOZIE_DATA=/hadoop/oozie/data
setting OOZIE_HTTP_PORT=11000
setting OOZIE_ADMIN_PORT=11001
setting JAVA_LIBRARY_PATH=/usr/hdp/3.1.0.0-78/hadoop/lib/native/Linux-amd64-64
setting OOZIE_CLIENT_OPTS="${OOZIE_CLIENT_OPTS} -Doozie.connection.retry.count=5 "
INFO: Adding extension: /usr/hdp/current/oozie-server/libext/mysql-connector-java.jar
New Oozie WAR file with added 'ExtJS library, JARs' at /usr/hdp/current/oozie-server/oozie-server/webapps/oozie.war
INFO: Oozie is ready to be started
然后重新启动:
[root@homaybd05 oozie]# bin/oozied.sh start
Setting OOZIE_HOME: /usr/hdp/3.1.0.0-78/oozie
Sourcing: /usr/hdp/3.1.0.0-78/oozie/bin/oozie-env.sh
setting OOZIE_CONFIG=${OOZIE_CONFIG:-/usr/hdp/current/oozie-server/conf}
setting CATALINA_BASE=${CATALINA_BASE:-/usr/hdp/current/oozie-server/oozie-server}
setting CATALINA_TMPDIR=${CATALINA_TMPDIR:-/var/tmp/oozie}
setting OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat
setting JAVA_HOME=/usr/local/jdk1.8.0_131
setting JRE_HOME=${JAVA_HOME}
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx2048m"
setting OOZIE_LOG=/var/log/oozie
setting CATALINA_PID=/var/run/oozie/oozie.pid
setting OOZIE_DATA=/hadoop/oozie/data
setting OOZIE_HTTP_PORT=11000
setting OOZIE_ADMIN_PORT=11001
setting JAVA_LIBRARY_PATH=/usr/hdp/3.1.0.0-78/hadoop/lib/native/Linux-amd64-64
setting OOZIE_CLIENT_OPTS="${OOZIE_CLIENT_OPTS} -Doozie.connection.retry.count=5 "
Using OOZIE_CONFIG: /usr/hdp/current/oozie-server/conf
Sourcing: /usr/hdp/current/oozie-server/conf/oozie-env.sh
setting OOZIE_CONFIG=${OOZIE_CONFIG:-/usr/hdp/current/oozie-server/conf}
setting CATALINA_BASE=${CATALINA_BASE:-/usr/hdp/current/oozie-server/oozie-server}
setting CATALINA_TMPDIR=${CATALINA_TMPDIR:-/var/tmp/oozie}
setting OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat
setting JAVA_HOME=/usr/local/jdk1.8.0_131
setting JRE_HOME=${JAVA_HOME}
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx2048m"
setting OOZIE_LOG=/var/log/oozie
setting CATALINA_PID=/var/run/oozie/oozie.pid
setting OOZIE_DATA=/hadoop/oozie/data
setting OOZIE_HTTP_PORT=11000
setting OOZIE_ADMIN_PORT=11001
setting JAVA_LIBRARY_PATH=/usr/hdp/3.1.0.0-78/hadoop/lib/native/Linux-amd64-64
setting OOZIE_CLIENT_OPTS="${OOZIE_CLIENT_OPTS} -Doozie.connection.retry.count=5 "
Setting OOZIE_CONFIG_FILE: oozie-site.xml
Using OOZIE_DATA: /hadoop/oozie/data
Using OOZIE_LOG: /var/log/oozie
Setting OOZIE_LOG4J_FILE: oozie-log4j.properties
Setting OOZIE_LOG4J_RELOAD: 10
Setting OOZIE_HTTP_HOSTNAME: homaybd05
Using OOZIE_HTTP_PORT: 11000
Using OOZIE_ADMIN_PORT: 11001
Setting OOZIE_HTTPS_PORT: 11443
Setting OOZIE_BASE_URL: http://homaybd05:11000/oozie
Using CATALINA_BASE: /usr/hdp/current/oozie-server/oozie-server
Setting OOZIE_HTTPS_KEYSTORE_FILE: /root/.keystore
Setting OOZIE_HTTPS_KEYSTORE_PASS: password
Setting OOZIE_INSTANCE_ID: homaybd05
Setting CATALINA_OUT: /var/log/oozie/catalina.out
Using CATALINA_PID: /var/run/oozie/oozie.pid
Using CATALINA_OPTS: -Dhdp.version=3.1.0.0-78 -Xmx2048m -Xmx2048m -Dderby.stream.error.file=/var/log/oozie/derby.log
Adding to CATALINA_OPTS: -Doozie.home.dir=/usr/hdp/3.1.0.0-78/oozie -Doozie.config.dir=/usr/hdp/current/oozie-server/conf -Doozie.log.dir=/var/log/oozie -Doozie.data.dir=/hadoop/oozie/data -Doozie.instance.id=homaybd05 -Doozie.config.file=oozie-site.xml -Doozie.log4j.file=oozie-log4j.properties -Doozie.log4j.reload=10 -Doozie.http.hostname=homaybd05 -Doozie.admin.port=11001 -Doozie.http.port=11000 -Doozie.https.port=11443 -Doozie.base.url=http://homaybd05:11000/oozie -Doozie.https.keystore.file=/root/.keystore -Doozie.https.keystore.pass=password -Djava.library.path=/usr/hdp/3.1.0.0-78/hadoop/lib/native/Linux-amd64-64
Setting up oozie DB
setting OOZIE_CONFIG=${OOZIE_CONFIG:-/usr/hdp/current/oozie-server/conf}
setting CATALINA_BASE=${CATALINA_BASE:-/usr/hdp/current/oozie-server/oozie-server}
setting CATALINA_TMPDIR=${CATALINA_TMPDIR:-/var/tmp/oozie}
setting OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat
setting JAVA_HOME=/usr/local/jdk1.8.0_131
setting JRE_HOME=${JAVA_HOME}
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx2048m"
setting OOZIE_LOG=/var/log/oozie
setting CATALINA_PID=/var/run/oozie/oozie.pid
setting OOZIE_DATA=/hadoop/oozie/data
setting OOZIE_HTTP_PORT=11000
setting OOZIE_ADMIN_PORT=11001
setting JAVA_LIBRARY_PATH=/usr/hdp/3.1.0.0-78/hadoop/lib/native/Linux-amd64-64
setting OOZIE_CLIENT_OPTS="${OOZIE_CLIENT_OPTS} -Doozie.connection.retry.count=5 "
setting OOZIE_CONFIG=${OOZIE_CONFIG:-/usr/hdp/current/oozie-server/conf}
setting CATALINA_BASE=${CATALINA_BASE:-/usr/hdp/current/oozie-server/oozie-server}
setting CATALINA_TMPDIR=${CATALINA_TMPDIR:-/var/tmp/oozie}
setting OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat
setting JAVA_HOME=/usr/local/jdk1.8.0_131
setting JRE_HOME=${JAVA_HOME}
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx2048m"
setting OOZIE_LOG=/var/log/oozie
setting CATALINA_PID=/var/run/oozie/oozie.pid
setting OOZIE_DATA=/hadoop/oozie/data
setting OOZIE_HTTP_PORT=11000
setting OOZIE_ADMIN_PORT=11001
setting JAVA_LIBRARY_PATH=/usr/hdp/3.1.0.0-78/hadoop/lib/native/Linux-amd64-64
setting OOZIE_CLIENT_OPTS="${OOZIE_CLIENT_OPTS} -Doozie.connection.retry.count=5 "
Validate DB Connection
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/oozie/libserver/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/oozie/libserver/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/oozie/lib/slf4j-simple-1.6.6.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.apache.logging.slf4j.Log4jLoggerFactory]
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
DONE
DB schema exists
The SQL commands have been written to: /tmp/ooziedb-501073718582315921.sql
Using CATALINA_BASE: /usr/hdp/current/oozie-server/oozie-server
Using CATALINA_HOME: /usr/lib/bigtop-tomcat
Using CATALINA_TMPDIR: /var/tmp/oozie
Using JRE_HOME: /usr/local/jdk1.8.0_131
Using CLASSPATH: /usr/lib/bigtop-tomcat/bin/bootstrap.jar
Using CATALINA_PID: /var/run/oozie/oozie.pid
[root@homaybd05 oozie]# jps
12850 DataNode
24551 AmbariServer
12520 QuorumPeerMain
7162 Bootstrap
9243 HRegionServer
7373 Jps
15246 ZeppelinServer
16622 ThriftServer
13486 NodeManager
21311 RemoteInterpreterServer
[root@homaybd05 oozie]#
然后再访问:
可以正常访问了哈~
16) Failed to add action specific sharelib oozie
如果出现 Failed to add action specific sharelib oozie
为者常成,行者常至
自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)