Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for altHosts #13

Closed
kadishmal opened this issue Jan 12, 2015 · 1 comment
Closed

Add support for altHosts #13

kadishmal opened this issue Jan 12, 2015 · 1 comment
Assignees
Milestone

Comments

@kadishmal
Copy link
Contributor

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.

@kadishmal kadishmal added this to the 2.3.0 milestone Mar 11, 2015
@kadishmal kadishmal modified the milestones: 3.0.0, 2.3.0 Sep 29, 2016
@kadishmal kadishmal self-assigned this Sep 29, 2016
@kadishmal
Copy link
Contributor Author

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();

kadishmal added a commit that referenced this issue Oct 5, 2016
New Features

#49 Implement Protocol v6 of CUBRID.
#13 Add support for alternative hosts to support client side HA.
#12 #11 Provide a configurable logging function.
#18 Added ENUM data type support via the old protocol.
#14 Support promises.
Refactoring

#48 Update README.
#14 Indent using spaces instead of tabs.
#14 Reduce the use of self where this can be used directly.
#14 Extract constants and other useless variables from the connection
object.
kadishmal added a commit that referenced this issue Oct 5, 2016
Closes #49, #11, #12, #13, #14, #48 Implement Protocol v6 of CUBRID.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant