1

我的用例:将 ESB 中配置的流中的数据推送到 BAM 并使用“小工具生成工具”创建报告</p>

将代理添加到代理服务后,将流从 ESB 发布到 BAM 工作正常。

从流中,我使用 Analytics->Add 屏幕创建了一个表,并且该表似乎仍然存在,因为我能够进行选择并从同一屏幕查看结果。

现在我正在尝试使用小工具生成工具生成仪表板,但该表不可用,虽然 jdbc 连接工作正常,但该表无处可去:

从 Analytics->Add 屏幕运行分析表脚本

CREATE EXTERNAL TABLE IF NOT EXISTS CREDITTABLE(creditkey STRING, creditFlag STRING, version STRING)
  STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler'
  WITH SERDEPROPERTIES ( "cassandra.host" = "127.0.0.1" , 
    cassandra.port" = "9163" , "cassandra.ks.name" = "EVENT_KS" ,
    "cassandra.ks.username" = "admin" ,
    "cassandra.ks.password" = "admin" ,
    "cassandra.cf.name" = "firstStream" ,
    "cassandra.columns.mapping" = ":key,payload_k1-constant, Version" );

尝试在以下数据库中查找表:

jdbc:h2:repository/database/WSO2CARBON_DB;AUTO_SERVER=TRUE
jdbc:h2:repository/database/metastore_db;AUTO_SERVER=TRUE
jdbc:h2:repository/database/samples/BAM_STATS_DB;AUTO_SERVER=TRUE

尚未进行任何自定义数据库配置。

4

2 回答 2

0

你试过了jdbc:h2:repository/database/samples/WSO2CARBON_DB;AUTO_SERVER=TRUE吗?此外,您粘贴的是 Cassandra 存储定义,可能用于获取输入,而不是持久化输出。如果您提供完整的配置单元查询,这将有助于更多地找出问题。

于 2013-03-23T02:02:55.403 回答
0

为什么我没有看到小工具生成工具中的表格?

我使用 Hive 脚本创建的表是 Casandra 分布式数据库表,我在查找表时在小工具生成工具中提供的参考来自 h2 RDBMS数据库表。

以下是对 WSO2 开箱即用的 h2 RDBMS 数据库的引用

jdbc:h2:repository/database/WSO2CARBON_DB;AUTO_SERVER=TRUE
jdbc:h2:repository/database/metastore_db;AUTO_SERVER=TRUE
jdbc:h2:repository/database/samples/BAM_STATS_DB;AUTO_SERVER=TRUE

解决方法 -----如何获取小工具生成工具中列出的表?

To get the tables listed in the Gadget Generation tool you have to extensively use the Hive Script to complete the following 3 steps:

  1. Create a Hive table reference for the Casandra data stream to which data is pushed from ESB in my case.

    CREATE EXTERNAL TABLE IF NOT EXISTS CREDITTABLE( payload_creditkey STRING, payload_creditFlag STRING, payload_version STRING) STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler' WITH SERDEPROPERTIES ( "cassandra.host" = "127.0.0.1" , "cassandra.port" = "9163" , "cassandra.ks.name" = "EVENT_KS" , "cassandra.ks.username" = "admin" , "cassandra.ks.password" = "admin" , "cassandra.cf.name" = "firstStream" , "cassandra.columns.mapping" = ":key,payload_k1-constant, Version" );

  2. Using Hive script create a H2 RDBMS script and reference to which I would be copying my data from the Casandra stream.

    CREATE EXTERNAL TABLE IF NOT EXISTS CREDITTABLEh2summary( creditFlg STRING, verSion STRING ) STORED BY 'org.wso2.carbon.hadoop.hive.jdbc.storage.JDBCStorageHandler' TBLPROPERTIES ( 'mapred.jdbc.driver.class' = 'org.h2.Driver' , 'mapred.jdbc.url' = 'jdbc:h2:C:/wso2bam-2.2.0/repository/samples/database/BAM_STATS_DB' , 'mapred.jdbc.username' = 'wso2carbon' , 'mapred.jdbc.password' = 'wso2carbon' , 'hive.jdbc.update.on.duplicate' = 'true' , 'hive.jdbc.primary.key.fields' = 'creditFlg' , 'hive.jdbc.table.create.query' = 'CREATE TABLE CREDITTABLE_newh2(creditFlg VARCHAR(100), version VARCHAR(100))' );

  3. Write a Hive query using which data would be copied from Casandra to H2[RDBMS]

    insert overwrite table CREDITTABLEh2summary select a.payload_creditFlag,a.payload_version from CREDITTABLE a;

On doing this I was able to see the table in the Gadget Generation tool however I also had to chage the referenc to the H2 Database to absolute in the JDBC URL value that I passed.

Observation:

Was wondering if the Gadget generation tool can directly point to the Casandra Stream without having to copy the tables to a RDBMS database.

于 2013-03-24T10:15:36.593 回答