1.0

Table Of Contents
Example: Connect to a locator with defaults and load-balance property
// Start a SQLFire locator that starts a network server on localhost:1527
$ sqlf locator start -peer-discovery-port=3000
Starting SQLFire Locator using peer discovery on: 0.0.0.0[3000]
Starting network server for SQLFire Locator at address
localhost/127.0.0.1[1527]
...
// Start a couple of SQLFire servers with network servers on different ports
$ sqlf server start -locators=localhost[3000] -client-port=1528 -dir=server1
Starting SQLFire Server using locators for peer discovery: localhost[3000]
Starting network server for SQLFire Server at address
localhost/127.0.0.1[1528]
...
$ sqlf server start -locators=localhost[3000] -client-port=1529 -dir=server2
Starting SQLFire Server using locators for peer discovery: localhost[3000]
Starting network server for SQLFire Server at address
localhost/127.0.0.1[1529]
...
// Open a new connection to the locator having network server on
localhost:1527.
// In default mode the driver will transparently query the locator and
connect
// to one of the servers as per load balancing for the real data connection.
string host = "localhost";
int port = 1527;
string connectionStr = string.Format("server={0}:{1}", host, port);
using (SQLFClientConnection conn = new SQLFClientConnection(connectionStr))
{
conn.Open();
// perform operations
conn.Close();
}
// Open a new connection to a server with load balancing disabled explicitly
int port2 = 1528;
string connectionStr2 = string.Format("server={0}:{1}", host, port2);
using (SQLFClientConnection conn = new SQLFClientConnection(connectionStr2))
{
Dictionary<string, string> props = new Dictionary<string, string>();
props.Add("load-balance", "false");
conn.Open(props);
// perform operations
conn.Close();
}
Example: Connect to a cluster that has BUILTIN authentication enabled
// Start a SQLFire locator with BUILTIN authentication.
// The system users should preferably be specified in sqlfire.properties
rather
// than on command-line as in the example below (see section ). System user
// in example below is gem1 with password gem1
$ sqlf locator start -peer-discovery-port=3000 -auth-provider=BUILTIN
-sqlfire.user.gem1=gem1 -user=gem1 -password=gem1
Starting SQLFire Locator using peer discovery on: 0.0.0.0[3000]
Starting network server for SQLFire Locator at address
localhost/127.0.0.1[1527]
vFabric SQLFire User's Guide634
vFabric SQLFire Reference