WSO2 APIM Analytics SQL Server安装

时间:2019-04-09 20:40:11

标签: wso2 wso2-am

我正在尝试运行APIM Analytics,但希望脱离默认的H2数据库,而是使用SQL Server。 这是SQL Server中数据库的映射:

${sys:carbon.home}/wso2/dashboard/database/metrics ---> WSO2_APIM_ANALYTICS_METRICS
${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/WSO2_CARBON_DB --> WSO2_APIM_ANALYTICS_CARBON
${sys:carbon.home}/wso2/dashboard/database/MESSAGE_TRACING_DB --> WSO2_APIM_ANALYTICS_MESSAGE_TRACING
${sys:carbon.home}/wso2/worker/database/GEO_LOCATION_DATA --> WSO2_APIM_ANALYTICS_GEO_LOCATION_DATA
${sys:carbon.home}/wso2/worker/database/WSO2AM_MGW_ANALYTICS_DB --> WSO2_APIM_ANALYTICS_MICROGATEWAY_ANALYTICS
${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/SP_MGT_DB --> WSO2_APIM_ANALYTICS_SP_MGT_DB
${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/DASHBOARD_DB --> WSO2_APIM_ANALYTICS_DASHBOARD
${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/SAMPLE_DB --> WSO2_APIM_ANALYTICS_SAMPLE
${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/wso2_status_dashboard --> WSO2_APIM_ANALYTICS_STATUS_DASHBOARD
${sys:carbon.home}/wso2/worker/database/WSO2AM_STATS_DB --> WSO2_METRICS
${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/BUSINESS_RULES_DB --> WSO2_APIM_ANALYTICS_BUSINESS_RULES
${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/PERMISSION_DB --> WSO2_APIM_ANALYTICS_PERMISSIONS
${sys:carbon.home}/wso2/worker/database/WSO2AM_MGW_ANALYTICS_DB --> WSO2_APIM_ANALYTICS_MICROGATEWAY_ANALYTICS
${sys:carbon.home}/wso2/worker/database/GEO_LOCATION_DATA --> WSO2_APIM_ANALYTICS_GEO_LOCATION_DATA

我为所有三个工作程序,管理器和仪表板功能更新了deploy.yaml,以指向新的数据源。

当我尝试运行worker.bat时,收到有关sidhi的以下错误消息。看来其他数据库的架构和数据并未像h2那样被填充。 如何获取h2使用的所有数据库的架构并填充到SQL Server中?

我也打开了h2数据库,但是在公共模式下h2数据库中什么都看不到。我想念什么吗?

这是我启动工作程序节点时看到的错误:

{org.wso2.transport.http.netty.listener.ServerConnectorBootstrap$HTTPServerConnector} - HTTP(S) Interface starting on host 0.0.0.0 and port 9444
    [2019-04-09 14:22:59,446] ERROR {org.wso2.carbon.stream.processor.core.internal.StreamProcessorDeployer} - org.wso2.siddhi.core.exception.SiddhiAppCreationException: Error on 'apim_abnormal_backend_time_alert_0' @ Line: 34. Position: 111, near '@store(type = 'rdbms', datasource = 'APIM_ANALYTICS_DB')
    define table ApimAllAlert (type string, tenantDomain string, message string, severity int, alertTimestamp long)'. No extension exist for store:rdbms org.wso2.carbon.stream.processor.core.internal.exception.SiddhiAppDeploymentException: org.wso2.siddhi.core.exception.SiddhiAppCreationException: Error on 'apim_abnormal_backend_time_alert_0' @ Line: 34. Position: 111, near '@store(type = 'rdbms', datasource = 'APIM_ANALYTICS_DB')
    define table ApimAllAlert (type string, tenantDomain string, message string, severity int, alertTimestamp long)'. No extension exist for store:rdbms
            at org.wso2.carbon.stream.processor.core.internal.StreamProcessorDeployer.deploySiddhiQLFile(StreamProcessorDeployer.java:105)
            at org.wso2.carbon.stream.processor.core.internal.StreamProcessorDeployer.deploy(StreamProcessorDeployer.java:306)
            at org.wso2.carbon.deployment.engine.internal.DeploymentEngine.lambda$deployArtifacts$0(DeploymentEngine.java:291)
            at java.util.ArrayList.forEach(ArrayList.java:1257)
            at org.wso2.carbon.deployment.engine.internal.DeploymentEngine.deployArtifacts(DeploymentEngine.java:282)
            at org.wso2.carbon.deployment.engine.internal.RepositoryScanner.sweep(RepositoryScanner.java:112)
            at org.wso2.carbon.deployment.engine.internal.RepositoryScanner.scan(RepositoryScanner.java:68)
            at org.wso2.carbon.deployment.engine.internal.DeploymentEngine.start(DeploymentEngine.java:121)
            at org.wso2.carbon.deployment.engine.internal.DeploymentEngineListenerComponent.onAllRequiredCapabilitiesAvailable(DeploymentEngineListenerComponent.java:216)
            at org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager.lambda$notifySatisfiableComponents$7(StartupComponentManager.java:266)
            at java.util.ArrayList.forEach(ArrayList.java:1257)
            at org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager.notifySatisfiableComponents(StartupComponentManager.java:252)
            at org.wso2.carbon.kernel.internal.startupresolver.StartupOrderResolver$1.run(StartupOrderResolver.java:204)
            at java.util.TimerThread.mainLoop(Timer.java:555)
            at java.util.TimerThread.run(Timer.java:505)
    Caused by: org.wso2.siddhi.core.exception.SiddhiAppCreationException: Error on 'apim_abnormal_backend_time_alert_0' @ Line: 34. Position: 111, near '@store(type = 'rdbms', datasource = 'APIM_ANALYTICS_DB')
    define table ApimAllAlert (type string, tenantDomain string, message string, severity int, alertTimestamp long)'. No extension exist for store:rdbms
            at org.wso2.siddhi.core.util.SiddhiClassLoader.loadExtensionImplementation(SiddhiClassLoader.java:45)
            at org.wso2.siddhi.core.util.parser.helper.DefinitionParserHelper.addTable(DefinitionParserHelper.java:203)
            at org.wso2.siddhi.core.util.SiddhiAppRuntimeBuilder.defineTable(SiddhiAppRuntimeBuilder.java:125)
            at org.wso2.siddhi.core.util.parser.SiddhiAppParser.defineTableDefinitions(SiddhiAppParser.java:320)
            at org.wso2.siddhi.core.util.parser.SiddhiAppParser.parse(SiddhiAppParser.java:224)
            at org.wso2.siddhi.core.SiddhiManager.createSiddhiAppRuntime(SiddhiManager.java:65)
            at org.wso2.siddhi.core.SiddhiManager.createSiddhiAppRuntime(SiddhiManager.java:74)
            at org.wso2.carbon.stream.processor.core.internal.StreamProcessorService.deploySiddhiApp(StreamProcessorService.java:100)
            at org.wso2.carbon.stream.processor.core.internal.StreamProcessorDeployer.deploySiddhiQLFile(StreamProcessorDeployer.java:93)
            ... 14 more

对于每种警报类型,还有更多类似的内容。 在这方面的任何帮助都将受到赞赏。

谢谢

2 个答案:

答案 0 :(得分:0)

在大多数情况下,都会创建所需的表,数据源之后是例外,只有在使用特定功能时才需要创建这些表, 1.指标数据库 2. Microgateway Analytics数据库

但是,您似乎面临的问题是服务器无法识别/ lib文件夹中包含的siddhi-store-rdbms.jar。请检查是否可用。默认情况下打包。

答案 1 :(得分:0)

Niveathika, 我们目前未使用微网关功能,所以我真的不知道是否需要使用架构填充该数据库,但是发现我必须填充两个数据库架构WSO2_APIM_ANALYTICS_GEO_LOCATION_DATA和WSO2_APIM_ANALYTICS_DASHBOARD我在WSO2_APIM_ANALYTICS_ASH服务器中找到了WSO2_APIM_ANALYTICS_D的架构 这是像我这样努力迁移到MSSQL的人的这两种模式

WSO2_APIM_ANALYTICS_DASHBOARD

IF OBJECT_ID('[dbo].[DASHBOARD_RESOURCE]', 'U') IS NOT NULL
DROP TABLE [dbo].[DASHBOARD_RESOURCE]
GO

CREATE TABLE [dbo].[DASHBOARD_RESOURCE](
  [ID] [int] IDENTITY(1,1) NOT NULL,
  [URL] [varchar](100) NOT NULL,
  [OWNER] [varchar](100) NOT NULL,
  [NAME] [varchar](256) NOT NULL,
  [DESCRIPTION] [varchar](1000) NULL,
  [PARENT_ID] [int] NOT NULL,
  [LANDING_PAGE] [varchar](100) NOT NULL,
  [CONTENT] [varbinary](max) NULL,
 CONSTRAINT [PK_DASHBOARD_RESOURCE] PRIMARY KEY CLUSTERED
(
  [URL] ASC,
  [OWNER] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

IF OBJECT_ID('[dbo].[WIDGET_RESOURCE]', 'U') IS NOT NULL
DROP TABLE [dbo].[WIDGET_RESOURCE]
GO

CREATE TABLE [dbo].[WIDGET_RESOURCE](
  [WIDGET_ID] [varchar](255) NOT NULL,
  [WIDGET_NAME] [varchar](255) NOT NULL,
  [WIDGET_CONFIGS] [varbinary](8000) NULL,
 CONSTRAINT [PK_WIDGET_RESOURCE] PRIMARY KEY CLUSTERED
(
  [WIDGET_ID] ASC,
  [WIDGET_NAME] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

WSO2_APIM_ANALYTICS_GEO_LOCATION_DATA

CREATE TABLE BLOCKS (
    network_cidr varchar(45) DEFAULT NULL,
    network BIGINT DEFAULT NULL,
      broadcast BIGINT DEFAULT NULL,
     geoname_id BIGINT DEFAULT NULL,
      registered_country_geoname_id BIGINT DEFAULT NULL,
      represented_country_geoname_id BIGINT DEFAULT NULL,
      is_anonymous_proxy SMALLINT DEFAULT '0',
      is_satellite_provider SMALLINT DEFAULT '0',
      postal_code VARCHAR(45) DEFAULT NULL,
      latitude DECIMAL(10,4) DEFAULT NULL,
      longitude DECIMAL(10,4) DEFAULT NULL,
    network_blocks varchar(45) DEFAULT NULL);

CREATE INDEX idx_blocks_network ON BLOCKS (network);
CREATE INDEX idx_blocks_broadcast ON BLOCKS (broadcast);
CREATE INDEX idx_blocks_network_blocks ON BLOCKS (network_blocks);

CREATE TABLE LOCATION (
      geoname_id BIGINT NOT NULL,
      locale_code VARCHAR(10) DEFAULT NULL,
      continent_code VARCHAR(10) DEFAULT NULL,
      continent_name VARCHAR(20) DEFAULT NULL,
      country_iso_code VARCHAR(10) DEFAULT NULL,
      country_name VARCHAR(45) DEFAULT NULL,
      subdivision_1_iso_code VARCHAR(10) DEFAULT NULL,
      subdivision_1_name VARCHAR(1000) DEFAULT NULL,
      subdivision_2_iso_code VARCHAR(10) DEFAULT NULL,
      subdivision_2_name VARCHAR(1000) DEFAULT NULL,
      city_name VARCHAR(1000) DEFAULT NULL,
      metro_code BIGINT DEFAULT NULL,
      time_zone VARCHAR(30) DEFAULT NULL,
      PRIMARY KEY (geoname_id));

CREATE TABLE IP_LOCATION (
      ip VARCHAR(100) NOT NULL,
      country_name VARCHAR(200) DEFAULT NULL,
      city_name VARCHAR(200) DEFAULT NULL,
      PRIMARY KEY (ip)
);

谢谢