Skip to content

Add support for altHosts #13

Closed
Closed

Description

@kadishmal

To support native HA functionality of CUBRID DB, add support for altHosts connection parameter to specify a list of hosts to use for client side failover.

Activity

  1. added this to the milestone on Mar 11, 2015
  2. modified the milestones: 3.0.0, on Sep 29, 2016
  3. self-assigned this
    on Sep 29, 2016
  4. kadishmal commented on Sep 30, 2016

    @kadishmal
    ContributorAuthor

    When creating a new connection, users now can specify an array of hosts which the driver will use to connect to CUBRID Brokers.

    const client = CUBRID.createConnection(hosts, port, user, password, database, connectionTimeout, maxConnectionRetryCount, logger);
    

    The hosts can be:

    • A string representing a single hostname.

    • An array of strings like ['host1[:port1]', 'host2[:port2]', ...].

      When a custom port is not specified, the driver will use the default port specified by the user when creating a connection. When a user has not specified the default port, it defaults to 33000.

    When multiple hosts are specified, the driver will make an attempt to connect to the first one. If the connection fails due to timeout or an error, the driver will try the next one in the list, and so on, until it tries all the provided hosts.

    When the connection has failed with all the hosts, the driver will retry maxConnectionRetryCount times. You can disable the retry by passing 0 for maxConnectionRetryCount.

    At any given time, you can get the currently active host by calling:

    client.getActiveHost();
    
  5. added 2 commits that reference this issue on Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions