From f622d3a3a2b2f8dcd46325e855216fe018de75ab Mon Sep 17 00:00:00 2001 From: AmshikaH <66556626+AmshikaH@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:39:08 +0530 Subject: [PATCH 1/5] Add registry db separation doc --- .../change-datasource-registry-data.md | 257 ++++++++++++++++++ .../7.0.0/docs/deploy/deployment-guide.md | 8 +- .../docs/includes/registry-repositories.md | 7 + en/identity-server/7.0.0/mkdocs.yml | 2 + 4 files changed, 267 insertions(+), 7 deletions(-) create mode 100644 en/identity-server/7.0.0/docs/deploy/configure/databases/carbon-database/change-datasource-registry-data.md create mode 100644 en/identity-server/7.0.0/docs/includes/registry-repositories.md diff --git a/en/identity-server/7.0.0/docs/deploy/configure/databases/carbon-database/change-datasource-registry-data.md b/en/identity-server/7.0.0/docs/deploy/configure/databases/carbon-database/change-datasource-registry-data.md new file mode 100644 index 0000000000..c163b914ad --- /dev/null +++ b/en/identity-server/7.0.0/docs/deploy/configure/databases/carbon-database/change-datasource-registry-data.md @@ -0,0 +1,257 @@ +# Change the Default Datasources for the Registry Data + +{% include "../../../../includes/registry-repositories.md" %} + +These repositories use the default datasources as follows. + +- WSO2_CARBON_DB: Used by the local repository. +- WSO2_SHARED_DB: Used by the configuration and governance repositories. + +## Configure the Datasource + +Following are the sample configuration for each database type. + +??? Example "PostgreSQL" + + 1. Configure the `/repository/conf/deployment.toml` file. + + ``` + [[datasource]] + id="WSO2CONFIG_DB" + url = "jdbc:postgresql://localhost:5432/gregdb" + username = "regadmin" + password = "regadmin" + driver = "org.postgresql.Driver" + jmx_enable=false + ``` + + 2. Execute the database scripts. + + Execute the scripts in the `/dbscripts/postgresql.sql` file against + the created database. + + 3. Download the Postgres JDBC driver for the version you are using and copy it to the `/repository/components/lib` folder. + +??? Example "MySQL" + + 1. Configure the `/repository/conf/deployment.toml` file. + + ``` + [[datasource]] + id="WSO2CONFIG_DB" + url = "jdbc:mysql://localhost:3306/IAMtest?useSSL=false" + username = "root" + password = "root" + driver = "com.mysql.jdbc.Driver" + jmx_enable=false + ``` + + 2. Execute the database scripts. + + Execute the scripts in the `/dbscripts/mysql.sql` file against + the created database. + + 3. Download the MySQL JDBC driver for the version you are using and copy it to the `/repository/components/lib` folder. + +??? Example "DB2" + 1. Configure the `/repository/conf/deployment.toml` file. + ``` + [[datasource]] + id="WSO2CONFIG_DB" + url = "jdbc:db2://192.168.108.31:50000/test" + username = "db2inst1" + password = "db2inst1" + driver = "com.ibm.db2.jcc.DB2Driver" + jmx_enable=false + ``` + + 2. Execute the database scripts. + + Execute the scripts in the `/dbscripts/db2.sql` file against + the created database. + + 3. Download the DB2 JDBC driver for the version, you are using and copy it to the `/repository/components/lib` folder. + +??? Example "MSSQL" + 1. Configure the `/repository/conf/deployment.toml` file. + ``` + [[datasource]] + id="WSO2CONFIG_DB" + url = "jdbc:sqlserver://localhost:1433;databaseName=test;SendStringParametersAsUnicode=false" + username = "sa" + password = "pass#word2" + driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver" + jmx_enable=false + ``` + + 2. Execute the database scripts. + + Execute the scripts in the `/dbscripts/mssql.sql` file against + the created database. + + 3. Download the MS SQL JDBC driver for the version you are using and copy it to the `/repository/components/lib` folder. + +??? Example "Oracle" + 1. Configure the `/repository/conf/deployment.toml` file. + ``` + [[datasource]] + id="WSO2CONFIG_DB" + url = "jdbc:oracle:thin:@localhost:1521/ORCLPDB" + username = "IS590Test" + password = "ora12c" + driver = "oracle.jdbc.OracleDriver" + jmx_enable=false + ``` + + 2. Execute the database scripts. + + Execute the scripts in the `/dbscripts/oracle.sql` file against + the created database. + + 3. Download the Oracle JDBC driver for the version you are using and copy it to the `/repository/components/lib` folder. + +--- + +### Advanced database configurations + +Apart from the above basic configurations, WSO2 Identity Server supports advanced database +configurations. Add the following configurations to the `/repository/conf/ +deployment.toml` file under the corresponding `[[datasource]]` tag. + +=== "PostgreSQL" + ``` json + pool_options.maxActive = "80" + pool_options.maxWait = "60000" + pool_options.minIdle = "5" + pool_options.testOnBorrow = true + pool_options.validationQuery="SELECT 1; COMMIT" + pool_options.validationInterval="30000" + pool_options.defaultAutoCommit=false + ``` + +=== "MySQL" + ``` json + pool_options.maxActive = "80" + pool_options.maxWait = "60000" + pool_options.minIdle = "5" + pool_options.testOnBorrow = true + pool_options.validationQuery="SELECT 1" + pool_options.validationInterval="30000" + pool_options.defaultAutoCommit=false + ``` + +=== "DB2" + ``` json + pool_options.maxActive = "80" + pool_options.maxWait = "360000" + pool_options.minIdle = "5" + pool_options.testOnBorrow = true + pool_options.validationQuery="SELECT 1" + pool_options.validationInterval="30000" + pool_options.defaultAutoCommit=false + ``` + +=== "MSSQL" + ``` json + pool_options.maxActive = "80" + pool_options.maxWait = "60000" + pool_options.minIdle = "5" + pool_options.testOnBorrow = true + pool_options.validationQuery="SELECT 1" + pool_options.validationInterval="30000" + pool_options.defaultAutoCommit=false + ``` + +=== "Oracle" + ``` json + pool_options.maxActive = "80" + pool_options.maxWait = "60000" + pool_options.minIdle = "5" + pool_options.testOnBorrow = true + pool_options.validationQuery="SELECT 1 FROM DUAL" + pool_options.validationInterval="30000" + pool_options.defaultAutoCommit=false + ``` + +{% include "../../../../includes/db-config-table.md" %} + +--- + +## Configure the Registry Databases + +The following configurations can be added under the `[registry]` section in the `/repository/conf/deployment.toml` file. + + + + + + + + + + + + + + +
local_datasourceThis is the jndi config name of the datasource for the local repository. + Here, this would be "jdbc/<id>" where id is the value configured in the + datasource configurations.
gov_datasourceThis is the jndi config name of the datasource configured for the governance repository. + Here, this would be "jdbc/<id>" where id is the value configured in the + datasource configurations.
config_datasourceThis is the jndi config name of the datasource configured for the configuration repository. + Here, this would be "jdbc/<id>" where id is the value configured in the + datasource configurations.
+ +It is only necessary to add the configuration for the datasource which is being changed. +For example, if you wish to change only the governance and configuration datasources, +only the `gov_datasource` and `config_datasource` configurations would be necessary +as shown below. + +``` +[registry] +gov_datasource = "jdbc/WSO2GOV_DB" +config_datasource = "jdbc/WSO2CONFIG_DB" +``` + +!!! note "Sample Config" + If you have correctly configured, the `deployment.toml` file should have an entry + similar to the following config. + + The following sample configuration is for separate **MSSQL** governance and config + databases. + + ``` + [registry] + gov_datasource = "jdbc/WSO2GOV_DB" + config_datasource = "jdbc/WSO2GOV_DB" + + [[datasource]] + id="WSO2GOV_DB" + url = "jdbc:sqlserver://localhost:1433;databaseName=test1;SendStringParametersAsUnicode=false" + username = "sa" + password = "pass#word2" + driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver" + jmx_enable=false + pool_options.maxActive = "80" + pool_options.maxWait = "60000" + pool_options.minIdle = "5" + pool_options.testOnBorrow = true + pool_options.validationQuery="SELECT 1" + pool_options.validationInterval="30000" + pool_options.defaultAutoCommit=false + + [[datasource]] + id="WSO2CONFIG_DB" + url = "jdbc:sqlserver://localhost:1433;databaseName=test2;SendStringParametersAsUnicode=false" + username = "sa" + password = "pass#word2" + driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver" + jmx_enable=false + pool_options.maxActive = "80" + pool_options.maxWait = "60000" + pool_options.minIdle = "5" + pool_options.testOnBorrow = true + pool_options.validationQuery="SELECT 1" + pool_options.validationInterval="30000" + pool_options.defaultAutoCommit=false + ``` diff --git a/en/identity-server/7.0.0/docs/deploy/deployment-guide.md b/en/identity-server/7.0.0/docs/deploy/deployment-guide.md index 337cee0e3b..dd34c77979 100644 --- a/en/identity-server/7.0.0/docs/deploy/deployment-guide.md +++ b/en/identity-server/7.0.0/docs/deploy/deployment-guide.md @@ -118,13 +118,7 @@ The following diagram is a high-level component diagram showing how the system w ## Mount the shared registry -WSO2 Identity Server comprises three different registry repositories. - -1. **Local Repository**: Stores configuration and runtime data that is local to the server. - -2. **Configuration Repository**: Stores product-specific configurations. - -3. **Governance Repository**: This stores configuration and data that are shared across the whole platform. This typically includes services, service descriptions, endpoints, or data sources. +{% include "../includes/registry-repositories.md" %}