Layer7 API Management

 View Only
  • 1.  Can we configure two jdbc connection urls for a single connection to internal databases?

    Posted May 06, 2016 02:46 PM

    Hi,

     

    Is it possible to configure two gateway servers in a single connection on Manage JDBC connections(like a fault tolerant server)? Currently we use a single connection and it might cause problem with oauth replication(in internal mysql db) when replication breaks but the gateway node is still processing requests.

     

    jdbc:mysql://gateway1:3306/otk_db

    jdbc:mysql://gateway2:3306/otk_db

     

    Thanks,

    Anand



  • 2.  Re: Can we configure two jdbc connection urls for a single connection to internal databases?
    Best Answer

    Broadcom Employee
    Posted May 06, 2016 03:12 PM

    Hi Anand,

     

    You can specify failover in the JDBC connection. For example;

     

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

     

    You will also need to make sure that the necessary MySQL grants are in place to allow all Gateway nodes to access the OTK DB.

     

    Regards,

    Joe



  • 3.  Re: Can we configure two jdbc connection urls for a single connection to internal databases?

    Posted May 09, 2016 11:07 AM

    Hi Joe,

    Thanks for the reply. I was trying to test this and was getting permission denied for the user. I also tried providing grants on the otk db, but I might be missing something. Here is what I tried.

     

    GRANT ALL ON otk_db.* TO 'otk_user'@'host';

     

    Regards,

    Anand



  • 4.  Re: Can we configure two jdbc connection urls for a single connection to internal databases?

    Posted May 10, 2016 02:57 PM

    We were able to get this solution working.

    Thanks,

    Anand



  • 5.  Re: Can we configure two jdbc connection urls for a single connection to internal databases?

    Posted Dec 05, 2018 12:21 PM

    Does this "GRANT ALL ON otk_db.* TO 'otk_user'@'host';" did the magic or you have done something different.  How did you managed to resolve the issue.  I am exactly in your situation and trying resolve the problem.  Any help would be appreciated



  • 6.  Re: Can we configure two jdbc connection urls for a single connection to internal databases?

    Posted Dec 05, 2018 02:12 PM

    I do not remember exactly, but i think this is what i did. Or you could use two separate grants for  otk_user with the specific gateway host names that you are connecting from.

     

    GRANT ALL PRIVILEGES ON `otk_db`.* TO 'otk_user'@'%'