WSO2 API 管理器 - 与 SQL 服务器集群时设置 'CacheId'
WSO2 API Manager - Setting 'CacheId' when clustering with SQL Server
我按照本指南将 WSO2 API 管理器 (v1.10.0) 集群到三个服务器(网关 + Publisher/Store + 密钥库):
https://docs.wso2.com/display/CLUSTER44x/Clustering+API+Manager+1.10.0
我在 'Installing and configuring the databases' 部分的第 11a 步。声明如下:
- 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>
但是,我使用的是 Microsoft SQL 服务器,而不是 MySQL,因此 cacheId
值对我来说不合适。
cacheId
应该如何为 SQL 服务器配置?
我查看了 registry.xml 文件中被注释掉的描述,但无法理解。
这是我的 WSO2REG_DB 配置:
<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.
我按照本指南将 WSO2 API 管理器 (v1.10.0) 集群到三个服务器(网关 + Publisher/Store + 密钥库): https://docs.wso2.com/display/CLUSTER44x/Clustering+API+Manager+1.10.0
我在 'Installing and configuring the databases' 部分的第 11a 步。声明如下:
- 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>
但是,我使用的是 Microsoft SQL 服务器,而不是 MySQL,因此 cacheId
值对我来说不合适。
cacheId
应该如何为 SQL 服务器配置?
我查看了 registry.xml 文件中被注释掉的描述,但无法理解。
这是我的 WSO2REG_DB 配置:
<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.