2

我与 BAM 合作了这么多天,突然间我什至无法做一个简单的示例(HTTPD 日志分析示例),如 BAM 2.0.1 文档中所示。我没有改变偏移量。

我正在采取的步骤是:

- 在 linux 中启动 BAM 服务器

- 从 $WSO2_BAM_HOME/samples/httpd-logs/resources 目录中读取 access.log

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

现在在安装时我遇到了一个配置单元脚本错误::

“执行 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

4 回答 4

0

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

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

于 2013-01-16T08:41:29.507 回答
0

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

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

于 2013-01-16T09:15:00.997 回答
0

连接到服务器似乎有问题。您是否更改了用户名或密码?(默认用户名和密码分别为adminadmin

而且,如果您使用不同的架构创建相同的现有 Hive 表,则必须在CREATE ....之前删除现有表。正如辛图亚所说的那样。

例如:删除表table1

drop table table1;
于 2013-01-16T10:18:38.840 回答
-1

您可以先尝试 BAM 2.0.1 中的 HTTPD 日志示例吗?您可以按照 /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. 转到主 -> BAM 工具箱 -> 添加。选择“HTTPD 日志分析工具箱”并单击安装按钮。
  6. 转到主 -> BAM 工具箱 -> 列表。等到“HTTPD 日志分析工具箱”工具箱状态更改为已安装。
  7. 等待一段时间,直到脚本完成发布数据后的第一次运行(脚本将在每分钟运行一次)。
  8. 单击 Main -> Gadgets -> View portal 以查看填充的小工具,其中显示来自不同国家/地区的请求的摘要。
于 2013-01-16T05:50:42.510 回答