コード例 #1
0
        /// <summary>
        /// Adds a node to the cluster.
        /// </summary>
        /// <param name="uriForNode">The URI for node.</param>
        /// <returns></returns>
        public async Task AddNode(Uri uriForNode)
        {
            var result = await _manager.AddNodeAsync(uriForNode.Host);

            if (result.Success)
            {
                Console.WriteLine("Node {0} added successfully.", uriForNode);
                return;
            }
            if (result.Exception != null)
            {
                Console.WriteLine("Failed to add node {0}: {1}\n{2}",
                                  uriForNode, result.Message, result.Exception);
                throw result.Exception;
            }
        }
コード例 #2
0
 /// <summary>
 /// Provisions a Couchbase server node, adding it to an existing cluster.
 /// </summary>
 /// <param name="hostname">The hostname.</param>
 /// <returns></returns>
 public Task <IResult> ProvisionNodeAsync(string hostname, params CouchbaseService[] services)
 {
     return(_clusterManager.AddNodeAsync(hostname, services));
 }