cassandra-nodetool

Cassandra Nodetool on Node.js

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
cassandra-nodetool
0.1.05 years ago5 years agoMinified + gzip package size for cassandra-nodetool in KB

Readme

Cassandra Nodetool
License: MIT npm version david-dm CircleCI codecov
Cassandra Nodetool on Node.js

Requirements

- OpenJDK: 8. - node-gyp
- python: `2.7.x`.
- make
- g++

Installation

$ npm install cassandra-nodetool

or
$ yarn add cassandra-nodetool

Dockerfile

CLI Usage examples

CLI is available via jsnodetool.
$ jsnodetool -h

usage: jsnodetool [-h] [-v] [-H HOST] [-P PORT] [-U USERNAME] [-PW PASSWORD]
                  {status} ...

Cassandra Nodetool on Node.js

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -H HOST, --host HOST  Hostname or IP address.
  -P PORT, --port PORT  JMX Port number.
  -U USERNAME, --username USERNAME
                        JMX Username.
  -PW PASSWORD, --password PASSWORD
                        JMX Password.

command:
  {status}

To fetch ring status:
$ jsnodetool status --skipTokens

{ datacenter1:
   { rack1:
      { '127.0.0.1':
         { hostId: '510e4833-317e-4d11-8590-fd1f849bafd8',
           datacenter: 'datacenter1',
           rack: 'rack1',
           status: 'U',
           state: 'N',
           load: '280.45 KiB',
           ownership: 1.0000048875808716 } } } }

Module Usage Examples

const { Nodetool } = require('cassandra-nodetool');

Nodetool({ host: '127.0.0.1', port: 7199, username: 'user', password: 'pass' })
    .status({ resolveIp: true })
    .then( ringStatus => console.log(ringStatus))
    .catch( err => console.error(err));