昨晚装好了oozie,能启动了,并且配置了mysql作为数据库,好了,今天要执行oozie自带的demo了,好家伙,一执行就报错!报错很多,就不一一列举了,就说我最后解决的方法吧。

oozie job -oozie http://localhost:11000/oozie -config examples/apps/map-reduce/job.properties –run

这句话需要在oozie的目录里面执行,然后在网上查了很多资料,最后搞定了,需要修改三个配置文件。

在说修改配置文件之前,还漏了一些东西,先补上,首先我们需要解压目录下面的oozie-examples.tar.gz,oozie-client-3.3.2.tar.gz,

oozie-sharelib-3.3.2.tar.gz,然后把examples和share目录上传到fs上面去。

hadoop fs -put examples examples

hadoop fs -put share share

然后在/etc/profile配置oozie-client的环境变量。

接下来说怎么解决的oozie的吧。

1.修改oozie的conf目录下的oozie-site.xml

增加以下内容:

<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.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.CoordinatorStoreService,
            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.HadoopAccessorService
        </value>
        <description>
            All services to be created and managed by Oozie Services singleton.
            Class names must be separated by commas.
        </description>
    </property>

<property>
       <name>oozie.service.ProxyUserService.proxyuser.cenyuhai.hosts</name>
       <value>*</value>
       <description>
           List of hosts the '#USER#' user is allowed to perform 'doAs'
           operations.

           The '#USER#' must be replaced with the username o the user who is
           allowed to perform 'doAs' operations.

           The value can be the '*' wildcard or a list of hostnames.

           For multiple users copy this property and replace the user name
           in the property name.
       </description>
   </property>

   <property>
       <name>oozie.service.ProxyUserService.proxyuser.cenyuhai.groups</name>
       <value>*</value>
       <description>
           List of groups the '#USER#' user is allowed to impersonate users
           from to perform 'doAs' operations.

           The '#USER#' must be replaced with the username o the user who is
           allowed to perform 'doAs' operations.

           The value can be the '*' wildcard or a list of groups.

           For multiple users copy this property and replace the user name
           in the property name.
       </description>
   </property> 

2.修改oozie-env.sh,增加以下内容

export OOZIE_CONF=${OOZIE_HOME}/conf
export OOZIE_DATA=${OOZIE_HOME}/data
export OOZIE_LOG=${OOZIE_HOME}/logs
export CATALINA_BASE=${OOZIE_HOME}/oozie-server
export CATALINA_TMPDIR=${OOZIE_HOME}/oozie-server/temp
export CATALINA_OUT=${OOZIE_LOG}/catalina.out

3.修改所有节点的hadoop的配置文件core-site.xml,

<property>
    <name>hadoop.proxyuser.cenyuhai.hosts</name>
    <value>hadoop.Master</value>
 </property>
 <property>
    <name>hadoop.proxyuser.cenyuhai.groups</name>
    <value>cenyuhai</value>
</property>

然后重启就可以执行了,里面的cenyuhai是我的本机账号。

补充:在进行完上述配置之后,作业可以提交了,但是提交了MR作业之后,在web页面中查看,遇到了一个错误:

JA006: Call to localhost/127.0.0.1:9001 failed on connection exception: java.net.ConnectException: Connection refused

这个问题排查了很久,都没有得到解决 ,最后通过修改job.properties,把jobTracker从localhost:9001改成下面的全称才行,这个可能跟我的hadoop的

jobTracker设置有关,所以遇到有这方面问题的童鞋可以试试。

nameNode=hdfs://192.168.1.133:9000
jobTracker=http://192.168.1.133:9001

接下来我们接着运行hive的demo,运行之前记得修改hive的demo的job.properties,改为上面写的那样。

然后提交,提交成功了,但是在web页面上查看状态为KILLED,被干掉了。。。

错误代码:JA018,错误消息:org/apache/hadoop/hive/cli/CliDriver

然后我就想着可能是jar包的问题,删掉share目录下的hive目录里的所有jar包,然后把自己机器上的hive的所有jar包复制到该目录下。

然后上传到共享目录上:

hadoop fs -put share share

再次提交,就可以查看到成功的状态啦!

oozie job -oozie http://localhost:11000/oozie -config examples/apps/hive/job.properties -run

但是这个坑爹的玩意儿,其实是把数据插入到了Derby中。。。无语了,虽然现实成功了,但是没有用。。。因为我们配置了外置的mysql数据库,那怎么办呢?

需要修改workflow.xml,把其中的configuration的配置节改成下面的样子。

<configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>${queueName}</value>
                </property>
        <property>
                <name>hive.metastore.local</name>
                <value>true</value>
            </property>
            <property>
                <name>javax.jdo.option.ConnectionURL</name>
                <value>jdbc:mysql://192.168.1.133:3306/hive?createDatabaseIfNotExist=true</value>
            </property>
            <property>
                    <name>javax.jdo.option.ConnectionDriverName</name>
                <value>com.mysql.jdbc.Driver</value>
            </property>
            <property>
                <name>javax.jdo.option.ConnectionUserName</name>
                    <value>hive</value>
            </property>
            <property>
                <name>javax.jdo.option.ConnectionPassword</name>
                <value>mysql</value>
               </property>
        <property>
              <name>hive.metastore.warehouse.dir</name>
              <value>/user/hive/warehouse</value>
        </property>
 </configuration>

然后提交之后,在hive中就可以查询到你所建立的表啦,oh,yeah!

oozie 运行demo的更多相关文章

  1. JSBinding + SharpKit / 初体验:下载代码及运行Demo

    QQ群:189738580 以下是群主维护的JSB版本: git地址:https://github.com/qcwgithub/qjsbunitynew.git插件源码地址(不包含SpiderMonk ...

  2. dubbox下载编译运行demo

    最近公司要搞微服务改造,拿了一个小项目开刀,找来找去,还是偏向当当的dubbox作为分布式服务框架.这里介绍下怎么一条龙跑起一个demo. 1.下载代码 因为代码放在github上,所以我们直接用Ec ...

  3. xcode运行demo报错:Failed to create provisioning profile.cannot be registered to your development team

    问题:网上下载运行demo,出现Failed to create provisioning profile.cannot be registered to your development team此 ...

  4. Windows10 Faster R-CNN(GPU版) 运行 Demo

    上篇文章介绍了 TensorFlow 环境的搭建,这篇介绍 demo 运行 参考链接 参考链接2 1. 下载 TensorFlow object detection API 相关文件 点击跳转下载文件 ...

  5. RN 环境搭建 运行demo App

    1.环境搭建 1.1 JDK 1.2Android JDK  需要安装c++环境(我选择安装android studio) 1.3Node npm config set registry https: ...

  6. DuiLib学习笔记1——编译运行demo

    c++中皮肤问题比较麻烦,MFC自带的太难用.DirectUI界面库就比较强大了,之前像skin++之类的基于DirectUI收费昂贵.DuiLib是基于DirectUI的界面库,可以将用户界面和处理 ...

  7. VUE环境配置——运行Demo

    如果有Vue的Demo   不知道怎么运行的同学可以看这里 这里只讲Win下面环境配置 一.NodeJs安装 1.下载Windows 安装包(.msi),并安装https://nodejs.org/d ...

  8. conda pip 安装 dgl 并运行demo 出现:Segmentation fault (core dumped) 错误

    安装dgl 并运行的时候,出现了如上错误,很是郁闷:使用 gdb python; run train.py 进行调试,发现是torch的问题:我猜测估计是torch 安装的版本过于新:于是重新安装 1 ...

  9. 用IIS进行部署,发布网页,运行DEMO

    因项目需要,正在学习如何部署IIS服务,并发布网站,发布以后,运行网页,具体步骤如下: 一.IIS的部署 在进行部署前,需要将一些必要的配置选好,如图: 打开选项,进行设置,将箭头部分进行勾选 在wi ...

随机推荐

  1. getenv()函数

    在PHP中getenv(参数)函数是一个用于获取环境变量的函数,根据提供不同的参数可以获取不同的环境变量,具体如下: “PHP_SELF” 当前正在执行脚本的文件名,与document root 相关 ...

  2. BT5配置网络

    root@bt:~# vi /etc/network/interfaces 编辑IP地址auto eth0#iface eth0 inet dhcpiface eth0 inet staticaddr ...

  3. Java获取请求客户端的真实IP地址

    整理网友的材料,最后有源码,亲测能解决所有java获取IP真实地址的问题 整理的这里: 1.链接1 2.链接2 JSP里,获取客户端的IP地址的方法是: request.getRemoteAddr() ...

  4. django官方文档--对静态文件的管理

    一.入门级理解: 在django中对静态文件的管理和模板(template)的思路是一样的.在模板的管理中django是把app用到 到的模板都保存到app目录下的templates子目录中. 静态文 ...

  5. 集群扩容的常规解决:一致性hash算法

    写这篇博客是因为之前面试的一个问题:如果memcached集群需要增加机器或者减少机器,那么其他机器上的数据怎么办? 最后了解到使用一致性hash算法可以解决,下面一起来学习下吧. 声明与致谢: 本文 ...

  6. 使用maven-shade-plugin插件解决spark依赖冲突问题

    依赖冲突:NoSuchMethodError,ClassNotFoundException   当用户应用于Spark本身依赖同一个库时可能会发生依赖冲突,导致程序奔溃.依赖冲突表现为在运行中出现No ...

  7. [转载]关于generate用法的总结【Verilog】

    转载自http://www.cnblogs.com/nanoty/archive/2012/11/13/2768933.html Abtract generate语句允许细化时间(Elaboratio ...

  8. android使用百度地图SDK 去掉百度Logo的小技巧

    // 隐藏logoView child = mMapView.getChildAt(1); if (child != null && (child instanceof ImageVi ...

  9. IBAction:IBOutlet:注意事项

    1.IBAction: 1> 能保证方法能够连线 > 相当于void 2.IBOutlet: 1> 能保证属性能够连线 3.常见错误 setValue:forUndefinedKey ...

  10. android 去掉标题栏、状态栏、横屏

    // 去掉标题栏 supportRequestWindowFeature(Window.FEATURE_NO_TITLE); // 全屏.隐藏状态栏 getWindow().setFlags(Wind ...