Layer7 API Management

  • 1.  CA Oauth database replication

    Posted Oct 22, 2018 06:53 AM

    Dear community,

     

    I configured a cluster of 4 API Gateway: 2 of them are in ssg database replica and the others 2 are just processing nodes. Now I'd like to install the OTK (Oauth) Mysql database locally on the Master API Gateway and configure the replica and the failover of this database with the Slave API Gateway.

     

    Is it possible to do that?

     

    Thank you.

     

    Regards,

    Riccardo



  • 2.  Re: CA Oauth database replication
    Best Answer

    Broadcom Employee
    Posted Oct 22, 2018 08:39 AM

    Hi Riccardo,

     

    As such this is possible, you would need to create the OTK_db on the master database and then use the create_slave.sh ( /opt/SecureSpan/Appliance/bin directory) to copy the databases to the slave

     

    BUT assuming this is a production environment: The otk db should be off box as the gateway db and otk db will fight for resources in order to function properly.  This could cause slowness or responsiveness to actual requests going through the gateway. See also Create or Upgrade the OTK Database - CA API Management OAuth Toolkit - 4.3 - CA Technologies Documentation 



  • 3.  Re: CA Oauth database replication

    Posted Oct 22, 2018 08:53 AM

    Hi Conny,

     

    I know that the OTK_db should be off the API Gateway, but the customer I'm working for decided to have it inside the Gateway.

     

    For what concern the create_slave.sh script, I have already ran it to replicate the ssg policy db. You are telling me that I have to use the same script to replicate the OTK_db, but in which way can I specify the pointings to the OTK_db. The script requires me to enter the following info:

     

    - IP or hostname for the Master

    - replication user

    - replication password

    - MySQL root user

    - MySQL root password

    - Do you want to clone a database from <master_ip_address> (yes or no)?

     

    How the script know that it has to replicate the OTK_db?

     

    Thank you.



  • 4.  Re: CA Oauth database replication

    Broadcom Employee
    Posted Oct 22, 2018 08:40 AM

    Hi Riccardo ,

     

    The default replication will replicate all databases as there are no filters defined in the my.cnf

    The caveat could be the time the otk database was created before or after you setup the original replication.

    So verify if the otk database exist on bot MySQL nodes.

    You can run "show databases;" on both nodes.

     

    If te otk database does not exist you can run the create_slave.sh script to setup the initial database

    /opt//SecureSpan/Appliance/bin/create_slave.sh

     

    It will ask which database to replicate specify the otk database.

     

    Secondly you have specify the failover on the OTK jdbc connection .

     

    Change the url to look like

     

    jdbc:mysql://MYSQLNODE1,MYSQLNODE2:3306/otk_db?failOverReadOnly=false&autoReconnect=true&connectTimeout=1

     

     

    Regards

    Dirk



  • 5.  Re: CA Oauth database replication

    Posted Oct 22, 2018 09:26 AM

    Hi Dirk,

     

    When does the script ask me to specify the database to replicate? I have just ran it for ssg database, but I do not remember that at that time I had to specify any db.



  • 6.  Re: CA Oauth database replication

    Posted Oct 23, 2018 10:33 AM

    Hi Dirk,

     

    in the JDBC URL you reported above:

     

    jdbc:mysql://MYSQLNODE1,MYSQLNODE2:3306/otk_db?failOverReadOnly=false&autoReconnect=true&connectTimeout=1

     

    What do you mean by saying MYSQLNODE1 and MYSQLNODE2? Do I have to fill in with the FQDNs of the two nodes?

     

    Thank you.

     

    Regards,

    Riccardo



  • 7.  Re: CA Oauth database replication

    Broadcom Employee
    Posted Oct 22, 2018 09:07 AM

    Hi Riccardo,

     

    On the question Do you want to clone a database? enter yes and then enter the name of the database to clone (for example otk_db). Be sure the slave is not currently running on the MASTER.

    This script then clones the database and starts the SLAVE.



  • 8.  Re: CA Oauth database replication

    Broadcom Employee
    Posted Nov 01, 2018 04:40 AM

    Hi Riccardo

     

    Did the answers from Dirk and myself answered your question? If it did please mark it as the right answer. When your question is not answered or you still have additional questions please let us know.

     

    With Kind Regards

    Conny Postma