WSO2 API 管理器 - 在使用 SQL Server 进行群集时设置“CacheId"

WSO2 API Manager - Setting #39;CacheId#39; when clustering with SQL Server(WSO2 API 管理器 - 在使用 SQL Server 进行群集时设置“CacheId)
本文介绍了WSO2 API 管理器 - 在使用 SQL Server 进行群集时设置“CacheId"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照本指南在三台服务器(网关 + 发布者/存储 + 密钥存储)上对 WSO2 API Manager (v1.10.0) 进行集群:https://docs.wso2.com/display/CLUSTER44x/Clustering+API+管理器+1.10.0

我正在执行安装和配置数据库"部分的第 11a 步.这说明了以下内容:<块引用>

  1. 要授予 Publisher 和 Store 组件访问注册表数据库的权限,请打开这两个组件中的/repository/conf/registry.xml 文件并进行如下配置:

一个.在 Publisher 组件的 registry.xml 文件中,添加或修改 <dbConfig name="govregistry"> 元素的 dataSource 属性,如下所示:

<dbConfig name="govregistry"><dataSource>jdbc/WSO2REG_DB</dataSource></dbConfig><remoteInstance url="https://publisher.apim-wso2.com"><id>政府</id><cacheId>user@jdbc:mysql://regdb.mysql-wso2.com:3306/regdb</cacheId><dbConfig>govregistry</dbConfig><readOnly>false</readOnly><enableCache>true</enableCache><registryRoot>/</registryRoot></远程实例><mount path="/_system/governance" overwrite="true"><instanceId>gov</instanceId><targetPath>/_system/governance</targetPath></mount><mount path="/_system/config" overwrite="true"><instanceId>gov</instanceId><targetPath>/_system/config</targetPath></mount>

但是,我使用的是 Microsoft SQL Server,而不是 MySQL,所以 cacheId 值对我来说并不合适.

请问SQL Server的cacheId应该如何配置?

我查看了 registry.xml 文件中被注释掉的描述,但无法弄清楚.

这是我的 WSO2REG_DB 配置:

<name>WSO2REG_DB</name><description>注册表使用的数据源</description><jndiConfig><name>jdbc/WSO2REG_DB</name></jndiConfig><定义类型="RDBMS"><配置><url>jdbc:sqlserver://***SERVER***:1433;databaseName=***DATABASE_NAME***</url><用户名>WS02RegUser</用户名><密码>***已删除***</密码><defaultAutoCommit>false</defaultAutoCommit><driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName><maxActive>50</maxActive><maxWait>60000</maxWait><testOnBorrow>true</testOnBorrow><validationQuery>SELECT 1</validationQuery><validationInterval>30000</validationInterval></配置></定义></数据源>

解决方案

cacheId - 这是远程实例的缓存 ID.这里是缓存id 格式应为 $database_username@$database_url,其中$database_username 是远程实例数据库的用户名,并且$database_url 是远程实例数据库 URL.

参考:https://docs.wso2.com/display/Governance460/Remote+Instance+and+Mount+Configuration+Details#RemoteInstanceandMountConfigurationDetails-JDBC-basedRemoteInstanceConfiguration

I'm clustering WSO2 API Manager (v1.10.0) across three servers (Gateway + Publisher/Store + Key Store) by following this guide: https://docs.wso2.com/display/CLUSTER44x/Clustering+API+Manager+1.10.0

I am on Step 11a of the 'Installing and configuring the databases' section. This states the following:

  1. To give the Publisher and Store components access to the registry database, open the /repository/conf/registry.xml file in each of these two components and configure them as follows:

a. In the Publisher component's registry.xml file, add or modify the dataSource attribute of the <dbConfig name="govregistry"> element as follows:

<dbConfig name="govregistry">
  <dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>
<remoteInstance url="https://publisher.apim-wso2.com"> 
   <id>gov</id>
   <cacheId>user@jdbc:mysql://regdb.mysql-wso2.com:3306/regdb</cacheId>
   <dbConfig>govregistry</dbConfig>
   <readOnly>false</readOnly>
   <enableCache>true</enableCache>
   <registryRoot>/</registryRoot>
</remoteInstance>
<mount path="/_system/governance" overwrite="true">
   <instanceId>gov</instanceId>
   <targetPath>/_system/governance</targetPath>
</mount>
<mount path="/_system/config" overwrite="true">
   <instanceId>gov</instanceId>
   <targetPath>/_system/config</targetPath>
</mount>

However, I'm using Microsoft SQL Server, rather than MySQL, so the cacheId value doesn't look right to me.

How should the cacheId be configured for SQL Server please?

I have taken a look through the commented-out descriptions in the registry.xml file, but cannot figure this out.

Here is my WSO2REG_DB configuration:

<datasource>
    <name>WSO2REG_DB</name>
    <description>The datasource used by the registry</description>
    <jndiConfig>
        <name>jdbc/WSO2REG_DB</name>
    </jndiConfig>
    <definition type="RDBMS">
        <configuration>
            <url>jdbc:sqlserver://***SERVER***:1433;databaseName=***DATABASE_NAME***</url>
            <username>WS02RegUser</username>
            <password>***REMOVED***</password>
            <defaultAutoCommit>false</defaultAutoCommit>
        <driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
            <maxActive>50</maxActive>
            <maxWait>60000</maxWait>
            <testOnBorrow>true</testOnBorrow>
            <validationQuery>SELECT 1</validationQuery>
            <validationInterval>30000</validationInterval>
        </configuration>
    </definition>
</datasource>

解决方案

cacheId - This is the cache id of the remote instance. Here the cache id should be in the format of $database_username@$database_url, where $database_username is the username of the remote instance database and $database_url is the remote instance database URL.

Reference: https://docs.wso2.com/display/Governance460/Remote+Instance+and+Mount+Configuration+Details#RemoteInstanceandMountConfigurationDetails-JDBC-basedRemoteInstanceConfiguration

这篇关于WSO2 API 管理器 - 在使用 SQL Server 进行群集时设置“CacheId"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)