hadoop dfsadmin -report
hadoop dfsadmin -refreshNodes
(1).配置Hadoop的 core-site.xml 文件,具体配置内容如下:
<property>
<name>hadoop.proxyuser.[OOZIE_SERVER_USER].hosts</name>
<value>[OOZIE_SERVER_HOSTNAME]</value>
</property>
<property>
<name>hadoop.proxyuser.[OOZIE_SERVER_USER].groups</name>
<value>[USER_GROUPS_THAT_ALLOW_IMPERSONATION]</value>
</property>
注释:[OOZIE_SERVER_USER]填写访问Tomcat的用户名
[OOZIE_SERVER_HOSTNAME]填写安装Tomcat服务器的机器的主机名
[USER_GROUP_THAT_ALLOW_TMPERSONATION]一般填写*标识符,表示所用用户都可以访问
<!--oozie配置-->
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
</property>
修改oozie-site.xml
<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://192.168.8.50:3306/oozie</value>
<description>
JDBC URL.
</description>
</property>
<property>
<name>oozie.service.JPAService.jdbc.username</name>
<value>oozie</value>
<description>
DB user name.
</description>
</property>
<property>
<name>oozie.service.JPAService.jdbc.password</name>
<value>oozie</value>
<description>
DB user password.
IMPORTANT: if password is emtpy leave a 1 space string, the service trims the value,
if empty Configuration assumes it is NULL.
</description>
</property>
<property>
<name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
<value>*=/hadoopdata1/soft/hadoop/etc/hadoop</value>
<description>
Comma separated AUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of
the Hadoop service (JobTracker, HDFS). The wildcard '*' configuration is
used when there is no exact match for an authority. The HADOOP_CONF_DIR contains
the relevant Hadoop *-site.xml files. If the path is relative is looked within
the Oozie configuration directory; though the path can be absolute (i.e. to point
to Hadoop client conf/ directories in the local filesystem.
</description>
</property>
<property>
<name>oozie.processing.timezone</name>
<value>GMT+0800</value>
<description>这个是设置时区,很重要,否则创建定时任务会有麻烦</description>
</property>
8)打war包
bin/oozie-setup.sh prepare-war
9)将oozie运行过程中需要的依赖包共享到hdfs上
bin/oozie-setup.sh sharelib create -fs hdfs://e6cluster -locallib oozie-sharelib-4.1.0-cdh5.9.0-yarn.tar.gz
10)初始化mysql oozie库
bin/oozie-setup.sh db create-run oozie.sql
11)启动检测运行
bin/oozied.sh start
ps -ef | grep oozie
netstat -tlnup | grep 11000
12)访问web ui
http://192.168.8.53:11000/oozie/
13)测试例子
hadoop fs -copyFromLocal /hadoopdata1/soft/oozie-4.1.0-cdh5.9.0/examples /user/hadoop
./oozie mapreduce -oozie http://localhost:11000/oozie -config /hadoopdata1/soft/oozie-4.1.0-cdh5.9.0/examples/apps/map-reduce/job.properties -run
./oozie job -oozie http://localhost:11000/oozie -config /hadoopdata1/soft/oozie-4.1.0-cdh5.9.0/examples/apps/map-reduce/job.properties -run
sudo -u hadoop hadoop job -oozie http://localhost:11000/oozie -config /hadoopdata1/soft/oozie-4.1.0-cdh5.9.0/examples/apps/map-reduce/job.properties -run
nameNode=hdfs://e6cluster
jobTracker=worker1:8032
queueName=default
examplesRoot=examples
user.name=hu
oozie.wf.application.path=/user/hu/examples/apps/map-reduce/workflow.xml
outputDir=map-reduce
hadoop dfsadmin -refreshNodes
(1).配置Hadoop的 core-site.xml 文件,具体配置内容如下:
<property>
<name>hadoop.proxyuser.[OOZIE_SERVER_USER].hosts</name>
<value>[OOZIE_SERVER_HOSTNAME]</value>
</property>
<property>
<name>hadoop.proxyuser.[OOZIE_SERVER_USER].groups</name>
<value>[USER_GROUPS_THAT_ALLOW_IMPERSONATION]</value>
</property>
注释:[OOZIE_SERVER_USER]填写访问Tomcat的用户名
[OOZIE_SERVER_HOSTNAME]填写安装Tomcat服务器的机器的主机名
[USER_GROUP_THAT_ALLOW_TMPERSONATION]一般填写*标识符,表示所用用户都可以访问
<!--oozie配置-->
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
</property>
修改oozie-site.xml
<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://192.168.8.50:3306/oozie</value>
<description>
JDBC URL.
</description>
</property>
<property>
<name>oozie.service.JPAService.jdbc.username</name>
<value>oozie</value>
<description>
DB user name.
</description>
</property>
<property>
<name>oozie.service.JPAService.jdbc.password</name>
<value>oozie</value>
<description>
DB user password.
IMPORTANT: if password is emtpy leave a 1 space string, the service trims the value,
if empty Configuration assumes it is NULL.
</description>
</property>
<property>
<name>oozie.service.HadoopAccessorService.hadoop.configurations</name>
<value>*=/hadoopdata1/soft/hadoop/etc/hadoop</value>
<description>
Comma separated AUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of
the Hadoop service (JobTracker, HDFS). The wildcard '*' configuration is
used when there is no exact match for an authority. The HADOOP_CONF_DIR contains
the relevant Hadoop *-site.xml files. If the path is relative is looked within
the Oozie configuration directory; though the path can be absolute (i.e. to point
to Hadoop client conf/ directories in the local filesystem.
</description>
</property>
<property>
<name>oozie.processing.timezone</name>
<value>GMT+0800</value>
<description>这个是设置时区,很重要,否则创建定时任务会有麻烦</description>
</property>
8)打war包
bin/oozie-setup.sh prepare-war
9)将oozie运行过程中需要的依赖包共享到hdfs上
bin/oozie-setup.sh sharelib create -fs hdfs://e6cluster -locallib oozie-sharelib-4.1.0-cdh5.9.0-yarn.tar.gz
10)初始化mysql oozie库
bin/oozie-setup.sh db create-run oozie.sql
11)启动检测运行
bin/oozied.sh start
ps -ef | grep oozie
netstat -tlnup | grep 11000
12)访问web ui
http://192.168.8.53:11000/oozie/
13)测试例子
hadoop fs -copyFromLocal /hadoopdata1/soft/oozie-4.1.0-cdh5.9.0/examples /user/hadoop
./oozie mapreduce -oozie http://localhost:11000/oozie -config /hadoopdata1/soft/oozie-4.1.0-cdh5.9.0/examples/apps/map-reduce/job.properties -run
./oozie job -oozie http://localhost:11000/oozie -config /hadoopdata1/soft/oozie-4.1.0-cdh5.9.0/examples/apps/map-reduce/job.properties -run
sudo -u hadoop hadoop job -oozie http://localhost:11000/oozie -config /hadoopdata1/soft/oozie-4.1.0-cdh5.9.0/examples/apps/map-reduce/job.properties -run
nameNode=hdfs://e6cluster
jobTracker=worker1:8032
queueName=default
examplesRoot=examples
user.name=hu
oozie.wf.application.path=/user/hu/examples/apps/map-reduce/workflow.xml
outputDir=map-reduce