master-datasources.xml始终在启动时被WSO2_CARBON_DB和WSO2MBStoreDB数据源的默认h2数据库覆盖。
deployment.toml
[server]
hostname = "localhost"
node_ip = "127.0.0.1"
#offset=0
mode = "single" #single or ha
base_path = "${carbon.protocol}://${carbon.host}:${carbon.management.port}"
#discard_empty_caches = false
server_role = "default"
[database.user]
type = "oracle"
url = "jdbc:oracle:thin:@localhost:1521/xe"
username = "apimuser"
password = "wso2"
[database.user.pool_options]
maxActive = 50
maxWait = 60000
testOnBorrow = true
validationInterval = 30000
defaultAutoCommit = true
[super_admin]
username = "admin"
password = "admin"
create_admin_account = true
[user_store]
#type = "database"
type = "database_unique_id"
[[datasource]]
id = "WSO2_CARBON_DB"
type = "oracle"
url = "jdbc:oracle:thin:@localhost:1521/xe"
username = "apimuser"
password = "wso2"
driver = "oracle.jdbc.driver.OracleDriver"
validationQuery = "SELECT 1 FROM DUAL"
pool_options.maxActive = 100
pool_options.maxWait = 10000
pool_options.validationInterval = 10000
[[datasource]]
id = "WSO2_MB_STORE_DB"
type = "oracle"
url = "jdbc:oracle:thin:@localhost:1521/xe"
username = "apimuser"
password = "wso2"
driver = "oracle.jdbc.driver.OracleDriver"
validationQuery = "SELECT 1 FROM DUAL"
pool_options.maxActive = 100
pool_options.maxWait = 10000
pool_options.validationInterval = 10000
[database.store_db]
type = "oracle"
url = "jdbc:oracle:thin:@localhost:1521/xe"
username = "apimuser"
password = "wso2"
driver = "oracle.jdbc.driver.OracleDriver"
validationQuery = "SELECT 1 FROM DUAL"
pool_options.maxActive = 100
pool_options.maxWait = 10000
pool_options.validationInterval = 10000
[database.identity_db]
type = "oracle"
url = "jdbc:oracle:thin:@localhost:1521/xe"
username = "apimuser"
password = "wso2"
driver = "oracle.jdbc.driver.OracleDriver"
maxActive = "80"
maxWait = "60000"
minIdle = "5"
testOnBorrow = true
validationQuery="SELECT 1 FROM DUAL"
validationInterval="30000"
defaultAutoCommit=false
[database.apim_db]
type = "oracle"
url = "jdbc:oracle:thin:@localhost:1521/xe"
username = "apimuser"
password = "wso2"
driver = "oracle.jdbc.driver.OracleDriver"
validationQuery = "SELECT 1 FROM DUAL"
pool_options.maxActive = 100
pool_options.maxWait = 10000
pool_options.validationInterval = 10000
[database.shared_db]
type = "oracle"
url = "jdbc:oracle:thin:@localhost:1521/xe"
username = "apimuser"
password = "wso2"
driver = "oracle.jdbc.driver.OracleDriver"
validationQuery = "SELECT 1 FROM DUAL"
pool_options.maxActive = 100
pool_options.maxWait = 10000
pool_options.validationInterval = 10000
[realm_manager]
data_source = "WSO2USER_DB"
[realm_manager.properties]
MultiTenantRealmConfigBuilder = "org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder"
[user_store.properties]
TenantManager = "org.wso2.carbon.user.core.tenant.JDBCTenantManager"
data_source = "WSO2USER_DB"
ReadGroupsPasswordHashMethod = "SHA"
Disabled = false
MaxUserNameListLength = 100
MaxRoleNameListLength = 100
UserRolesCacheEnabled = true
PasswordDigest = "SHA-256"
ReadGroups = true
ReadOnly = false
IsEmailUserName = false
DomainCalculation = "default"
StoreSaltedPassword = true
WriteGroups = true
UserNameUniqueAcrossTenants = false
以上更改未反映在WSO2_CARBON_DB和WSO2_MB_STORE_DB的数据源中。
master-datasources.xml
<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
<providers>
<provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
</providers>
<datasources>
<datasource>
<name>WSO2_CARBON_DB</name>
<description>The datasource used for registry and user manager</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:h2:./repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;MVCC=TRUE</url>
<username>wso2carbon</username>
<password>wso2carbon</password>
<driverClassName>org.h2.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
<defaultAutoCommit>true</defaultAutoCommit>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2_SHARED_DB</name>
<description>Shared Database for user and registry data</description>
<jndiConfig>
<name>jdbc/SHARED_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:oracle:thin:@localhost:1521/xe</url>
<username>apimuser</username>
<password>wso2</password>
<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
<validationQuery>SELECT 1 FROM DUAL</validationQuery>
<testOnBorrow>true</testOnBorrow>
<maxWait>10000</maxWait>
<defaultAutoCommit>true</defaultAutoCommit>
<validationInterval>10000</validationInterval>
<maxActive>100</maxActive>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2USER_DB</name>
<description>User related database</description>
<jndiConfig>
<name>jdbc/WSO2USER_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:oracle:thin:@localhost:1521/xe</url>
<username>apimuser</username>
<password>wso2</password>
<driverClassName>oracle.jdbc.OracleDriver</driverClassName>
<validationQuery>SELECT 1 FROM DUAL</validationQuery>
<maxActive>50</maxActive>
<defaultAutoCommit>true</defaultAutoCommit>
<maxWait>60000</maxWait>
<validationInterval>30000</validationInterval>
<testOnBorrow>true</testOnBorrow>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2_CARBON_DB</name>
<description>this database is WSO2_CARBON_DB</description>
<jndiConfig>
<name>jdbc/WSO2_CARBON_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:oracle:thin:@localhost:1521/xe</url>
<username>apimuser</username>
<password>wso2</password>
<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
<validationQuery>SELECT 1 FROM DUAL</validationQuery>
<validationInterval>10000</validationInterval>
<maxWait>10000</maxWait>
<maxActive>100</maxActive>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2_MB_STORE_DB</name>
<description>this database is WSO2_MB_STORE_DB</description>
<jndiConfig>
<name>jdbc/WSO2_MB_STORE_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:oracle:thin:@localhost:1521/xe</url>
<username>apimuser</username>
<password>wso2</password>
<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
<validationQuery>SELECT 1 FROM DUAL</validationQuery>
<validationInterval>10000</validationInterval>
<maxWait>10000</maxWait>
<maxActive>100</maxActive>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2AM_DB</name>
<description>The datasource used for API Manager database</description>
<jndiConfig>
<name>jdbc/WSO2AM_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:oracle:thin:@localhost:1521/xe</url>
<username>apimuser</username>
<password>wso2</password>
<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
<validationQuery>SELECT 1 FROM DUAL</validationQuery>
<validationInterval>10000</validationInterval>
<testOnBorrow>true</testOnBorrow>
<defaultAutoCommit>true</defaultAutoCommit>
<maxActive>100</maxActive>
<maxWait>10000</maxWait>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2_MB_STORE_DB</name>
<description>The datasource used for message broker database</description>
<jndiConfig>
<name>WSO2MBStoreDB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:h2:./repository/database/WSO2MB_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000;MVCC=TRUE</url>
<username>wso2carbon</username>
<password>wso2carbon</password>
<driverClassName>org.h2.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
<defaultAutoCommit>false</defaultAutoCommit>
</configuration>
</definition>
</datasource>
</datasources>
</datasources-configuration>
启动服务器后,默认情况下已覆盖数据源。
答案 0 :(得分:0)
在API-M 3.0部署中,基本上我们只需要配置APIM-DB和Shared_DB。
WSO2_CARBON_DB仅用于节点的内部使用。因此,我们不鼓励用户修改此配置,最好保持原样,以免发生任何意外错误。由于这个原因,它尚未添加到配置模型中。