cassandra-nodetool
v0.1.0
Published
Cassandra Nodetool on Node.js
Downloads
2,359
Readme
Cassandra Nodetool
Cassandra Nodetool on Node.js
Requirements
- Node.js:
>=7.10.1
. (needsasync/await
support) - Package:
node-java
,node-jmx
- OpenJDK:
8
. - node-gyp
- python:
2.7.x
. - make
- g++
- python:
- OpenJDK:
Installation
$ npm install cassandra-nodetool
or
$ yarn add cassandra-nodetool
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));