2

I am working with BAM for so many days and suddenly i am not even able to do a simple example(HTTPD Logs Analysis Sample) as demonstrated in BAM 2.0.1 documentation. I haven't changed offset.

The steps i am taking are:

-starting BAM server in linux

-reading access.log from $WSO2_BAM_HOME/samples/httpd-logs/resources Directory

-installing 'HTTPD logs and analysis' toolbox in management console

Now while installing i am having a hive script error::

"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 "

can you please tell me where i am going wrong ?

The errors in the backend are

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]
  

 
Community
  • 1
  • 1
madhurika
  • 191
  • 1
  • 8

4 Answers4

0

Can you please post the full error trace from server logs?

Can't discover the root cause with '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', Need the full exception trace to figure the root cause.

Sinthuja
  • 136
  • 3
0

It seems like Hive is unable to connect to cassandra. If you have started the BAM server with any offset, then casssandra port also will be changed as 9160+< port-offset >. Please replace the "cassandra.port" with 9160+< port-offset >.

And also you may need to drop the Hive tables which are mentioned in Httpd_log_script, to get the change to be reflected. This is because, you have already ran the script and table definitions for the specific table name would have been stored already and will not try to create it again since within the script table are created if not exists.(CREATE EXTERNAL TABLE IF NOT EXISTS).

Sinthuja
  • 136
  • 3
  • Offset is same as the default (i.e. 0), i haven't changed it.As you told me i have dropped my table. Now there is an error regarding gadget url [2013-01-17 16:40:32,099] ERROR {org.wso2.carbon.dashboard.mgt.gadgetrepo.Gadget RepoService} - Backend server error : Gadget Url already exist [2013-01-17 16:40:32,203] ERROR {org.wso2.carbon.dashboard.mgt.gadgetrepo.Gadget RepoService} - Backend server error : Gadget Url already exist. How should i delete the existing url? – madhurika Jan 17 '13 at 05:39
  • You can ignore this error log, as it's not harmful error logs. All gadgets associated with the toolbox will be added to gadget repository, if you mark that to be in your dashboard by design. And for this particular sample, since one gadget is re-used in many tabs, it's trying to add the gadget again to gadget repository and reports that the gadget is already existing message. So that, this error message is harmless. Were you able to rectify you initial hive script error? – Sinthuja Jan 21 '13 at 08:19
  • No :( I am still struggling. Same error is coming . I tried doing the same from the scratch but its not working. Should i paste the whole error maybe then you can tell me where i am going wrong ? – madhurika Jan 21 '13 at 09:45
  • yes, please paste the full trace from installing the toolbox. Then it would be better to narrow the root cause. – Sinthuja Jan 29 '13 at 08:43
0

It seems there is a problem with connecting to the server. Have you changed the user name or password? (Dafault username and password are admin and admin)

And also if you are creating the same existing Hive table with a different schema, you must delete the existing table before the CREATE ..... command as Sinthuja said.

e.g.: Deleting the table table1,

drop table table1;
Maninda
  • 2,086
  • 3
  • 15
  • 29
-1

Can you first try the HTTPD Logs sample in BAM 2.0.1 ? You can follow the instructions in the /samples/httpd-logs/README.txt. It worked well. These are the instructions given in that file;

  1. Start the WSO2 BAM Server
  2. Go to $WSO2_BAM_HOME/samples/httpd-logs directory via console
  3. Type 'ant' from the console (This will read the access.log from the $WSO2_BAM_HOME/samples/httpd-logs/resources Directory and send each log line as event )
  4. Go to Management console of WSO2 BAM server.
  5. Go to Main -> BAM ToolBox -> Add. Select "HTTPD Logs Analysis Toolbox" and click on Install button.
  6. Go to Main -> BAM Toolbox -> List. Wait until the 'HTTPD Logs Analysis Toolbox' toolbox status changes to Installed.
  7. Wait for some time, until script complete the first run after publishing the data (Script will run in each minute).
  8. Click on Main -> Gadgets -> View portal to see the populated gadgets which shows a summary of no of requests coming from different countries.
Maninda
  • 2,086
  • 3
  • 15
  • 29
  • Maninda i am following the same steps. After installing the toolbox hive script error is coming. ERROR {org.wso2.carbon.analytics.hive.task.HiveScriptExecutorTask} - Error while executing script : httpd_logs_script_507 – madhurika Jan 16 '13 at 07:19
  • Can you show us the error messages printed in the backend console? – Maninda Jan 16 '13 at 08:27