npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cbcluster

v1.5.1

Published

Small immersive Couchbase Server CLI

Downloads

28

Readme

     |         |              |
,---.|---.,---.|    .   .,---.|--- ,---.,---.
|    |   ||    |    |   |`---.|    |---'|
`---'`---'`---'`---'`---'`---'`---'`---'`

cbcluster is a small immersive command line utility for interacting with Couchbase Server clusters.

Development is ongoing to mirror some of the examples shown in the REST API Reference documentation. The primary focus of this tool is compact commands for quick cluster interaction.

Installation

With NPM:

npm install -g cbcluster

From this repository:

git clone https://github.com/brianshumate/cbcluster.git
cd cbcluster
npm install
npm link

Usage

Start cbcluster:

cbcluster

Get help:

cbcluster> help

  Commands:

    addn [options]   Add node to existing cluster
    bckt [options]   Create bucket
    ejct [options]   Eject node from cluster
    flvr [options]   Fail over node
    info [options]   Get Couchbase Server information
    init [options]   Initialize node
    name [options]   Specify node name
    rebl [options]   Rebalance cluster
    svcs [options]   Specify node services
    user [options]   Specify administrator username and password
    help [command]   Provides help for a given command
    exit [options]   Exits this instance of cbcluster

You can also get help for individual commands with help <command>.

A note about defaults

For the sake of convenience, cbcluster includes some sensible defaults and the defaults (for e.g. bucket creation) which you will find in the Couchbase Server web console user interface:

| Default setting | Value | Notes | | ---------------------- | --------------- | ----------------------------| | Administrator username | Administrator | [string] can be overridden with -u | | Administrator password | couchbase | [string] can be overridden with -p | | Node data path | /opt/couchbase/var/lib/couchbase/data | [string] can be overridden with -d | | Node index path | /opt/couchbase/var/lib/couchbase/index | [string] can be overridden with -i | | Node port | 8091 | [int] can be overridden with -x 18091 | | Bucket type | membase | [string] can be overridden with -t memcached note that membase is the name for a couchbase style bucket; the other option is memcached | | Per Node RAM Quota | 128 | [int] RAM quota per node for bucket (in megabytes) | | Cache metadata | valueOnly | [string] can be overridden with -e fullEviction | | Access control | sasl | [string] can be overridden with -a none | | Bucket port | None | Set a bucket auth port number with -d 11242 | | Replicas | 1 | [int] can be overridden with (2,3) -r 3 | | Index replicas | 0 | [0 or 1] can be overridden with -i | | Auto compaction | 0 | [0 or 1] can be overridden with -c | | Flush | 0 | [0 or 1] can be overridden with -f |

All the above defaults can of course be overridden by command options.

Usage Examples

This example follows the Creating a new cluster documentation and covers most of the current abilities available in cbcluster.

Couchbase Server Version

Determine the Couchbase Server version on a given cluster node:

cbcluster> vers -h cb1.local
SUCCESS: Couchbase Server node cb1.local version: 3.1.1-1807-rel-enterprise

Initialize Node

The first step in building a cluster is to initialize the node:

cbcluster> init -h cb3.local
SUCCESS: Initialized node: cb3.local

Specify Node Name

cbcluster> name -h cb3.local -n cb3.local
SUCCESS: Named node: cb3.local

Specify Node Services

cbcluster> svcs -h cb3.local -s kv,n1ql
SUCCESS: Specified services on node cb3.local: kv,n1ql

Specify Administrator Username and Password

user -h cb3.local -u Administrator -p tacotown
SUCCESS: Set administrator on node cb3.local: Administrator

Create Bucket

cbcluster> bckt -h cb3.local -p tacotown -n tacos -m 128 -s secretsalsa
SUCCESS: Created tacos bucket on node cb3.local

Fail Node Over and Rebalance Out

This example shows how to fail a node over, eject it from the cluster, and then perform a rebalance; this makes the failed over node no longer a cluster member.

cbcluster> flvr -h cb1.local -t cb2.local
SUCCESS: Node cb2.local failed over
cbcluster> ejct -h cb1.local -t cb2.local
SUCCESS: Node cb2.local ejected from cluster
cbcluster> rebl -h cb1.local -k cb1.local,cb3.local
SUCCESS: Cluster rebalancing

Notes

This project works with the following software:

  • Couchbase Server 3.x-4.x
  • Node.js 4.2.2

References

  1. Creating a new cluster
  2. Adding nodes to clusters
  3. Buckets API
  4. Removing nodes from clusters
  5. Failing over nodes
  6. Rebalancing nodes