安装HTTPD日志分析示例时出错

时间:2013-01-15 12:37:11

标签: wso2 wso2bam

我正在使用BAM这么多天,突然间我甚至无法做一个简单的例子(HTTPD Logs Analysis Sample),如BAM 2.0.1文档中所示。 我没有改变偏移量。

我正在采取的步骤是:

- 启动Linux中的BAM服务器

-read access.log来自$ WSO2_BAM_HOME / samples / httpd-logs / resources目录

在管理控制台中安装'HTTPD日志和分析'工具箱

现在安装时我遇到了一个hive脚本错误::

“执行Hive脚本时出错。查询返回非零代码:9,原因:失败:执行错误,从org.apache.hadoop.hive.ql.exec.DDLTask返回代码1”

你能告诉我我哪里出错吗?

后端的错误是

ERROR {org.apache.hadoop.hive.ql.exec.Task} -  FAILED: Error in metadata: MetaException(message:Unable to connect to the server org.apache.hadoop.hive.cassandra.CassandraException: unable to connect to server)
org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Unable to connect to the server org.apache.hadoop.hive.cassandra.CassandraException: unable to connect to server)
        at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:546)
        at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:3479)
        at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:225)
        at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:133)
        at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
        at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1334)
        at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1125)
        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:933)
        at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:201)
        at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:187)
        at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.call(HiveExecutorServiceImpl.java:325)
        at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.call(HiveExecutorServiceImpl.java:225)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: MetaException(message:Unable to connect to the server org.apache.hadoop.hive.cassandra.CassandraException: unable to connect to server)
        at org.apache.hadoop.hive.cassandra.CassandraManager.openConnection(CassandraManager.java:118)
        at org.apache.hadoop.hive.cassandra.CassandraStorageHandler.preCreateTable(CassandraStorageHandler.java:168)
        at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:397)
        at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:540)
        ... 16 more

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
[2013-01-16 20:03:01,464] ERROR {org.apache.hadoop.hive.ql.Driver} -  FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
[2013-01-16 20:03:01,470] ERROR {org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl} -  Error while executing Hive script.
Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
        at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:189)
        at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.call(HiveExecutorServiceImpl.java:325)
        at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.call(HiveExecutorServiceImpl.java:225)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
[2013-01-16 20:03:01,473] ERROR {org.wso2.carbon.analytics.hive.task.HiveScriptExecutorTask} -  Error while executing script : httpd_logs_script_507
org.wso2.carbon.analytics.hive.exception.HiveExecutionException: Error while executing Hive script.Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
        at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl.execute(HiveExecutorServiceImpl.java:110)
        at org.wso2.carbon.analytics.hive.task.HiveScriptExecutorTask.execute(HiveScriptExecutorTask.java:60)
        at org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:56)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
[2013-01-16 20:03:09,139]  INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  'admin@carbon.super [-1234]' logged in at [2013-01-16 20:03:09,139+0530]

4 个答案:

答案 0 :(得分:0)

您能否从服务器日志中发布完整的错误跟踪?

无法在执行Hive脚本时发现错误的根本原因。查询返回非零代码:9,原因:FAILED:执行错误,从org.apache.hadoop.hive.ql.exec返回代码1。 DDLTask',需要完整的异常跟踪来确定根本原因。

答案 1 :(得分:0)

似乎Hive无法连接到cassandra。如果您已使用任何偏移量启动BAM服务器,则casssandra端口也将更改为9160 +< port-offset>。 请用9160 +<“替换”cassandra.port“。 port-offset>。

此外,您可能需要删除Httpd_log_script中提到的Hive表,以便反映更改。这是因为,您已经运行了脚本,并且已经存储了特定表名的表定义,并且不会再尝试创建它,因为如果不存在则在脚本表中创建。(如果不是,则创建外部表)

答案 2 :(得分:0)

连接服务器似乎存在问题。你有没有更改用户名或密码? (Dafault用户名和密码是 admin admin

如果您使用不同的架构创建相同的现有Hive表,则必须在 CREATE .... 之前删除现有的表。 Sinthuja说道。

例如为: 删除表 table1

drop table table1;

答案 3 :(得分:-1)

您可以先在BAM 2.0.1中尝试HTTPD Logs示例吗?您可以按照/samples/httpd-logs/README.txt中的说明进行操作。它运作良好。这些是该文件中给出的说明;

  1. 启动WSO2 BAM服务器
  2. 通过控制台转到$ WSO2_BAM_HOME / samples / httpd-logs目录
  3. 从控制台输入'ant' (这将从$ WSO2_BAM_HOME / samples / httpd-logs / resources目录中读取access.log,并将每个日志行作为事件发送)
  4. 转到WSO2 BAM服务器的管理控制台。
  5. 转到Main - > BAM ToolBox - >加。选择“HTTPD Logs Analysis Toolbox”并单击Install按钮。
  6. 转到Main - > BAM工具箱 - >名单。等到“HTTPD日志分析工具箱”工具箱状态更改为“已安装”。
  7. 等待一段时间,直到脚本在发布数据后完成第一次运行(脚本将在每分钟运行)。
  8. 点击主要 - >小工具 - >查看门户网站,查看填充的小工具,其中显示来自不同国家/地区的请求的摘要。