1.1.2 • Published 9 years ago

cassandra-installer v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
9 years ago

Cassandra Installer

Coverage Status Dependencies

This package is a utility that provides the ability to use Cassandra in an embedded way for your node.js applications. The process works as follows:

  • Select the package version of cassandra
  • Download Cassandra (It will fetch from the nearest mirror)
  • Install cassandra
  • Start Cassandra
  • Stop Cassandra
  • Configure your logger instance for the module

Example Usage

'use strict';    
    
const CassandraInstaller = require('cassandra-installer'),
      winston            = require('winston');
    
/* Create the logging levels, if none provided it will revert to the default console logger */

var transports = [
  new (winston.transports.Console)(),
  new (winston.transports.File)({ filename: '/tmp/cassandra-installer.log' })
];

var options = {
  destination : '/tmp',
  version : '3.5',
  dbName : 'test_db',
  transports : transports
};

/* Create a new installer that will download cassandra 3.4 in /tmp */ 
var installer = new CassandraInstaller(options);

    
/* Download cassandra */
installer.download((err, data) => {
  /* Install cassandra */
  installer.install((err, data) => {
  
    /* Start cassandra */
    installer.start();
    
    /* Create the keyspace that was defined in option */
    installer.createKeyspace(err =>{
      
      /* Drop the db */
      installer.dropKeyspace(err => {
      
        /* Stop cassandra */
        installer.stop();
        
        /*Cleanup */
              setTimeout(function() { //allow 10 seconds for cassandra to shutdown gracefully
                installer.uninstall(err => {
                  if(err) console.log(err);
                });
              }, 10000);
      });
    );
  });
});

Note : Make sure you have the Java runtime 1.8.x installed so that Cassandra runs.

This module works on MacOS X and all flavors of *nix

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago