NodeJS client for Pivotal GemFire
- CentOS 6.5
- Other 64-bit Linux platforms may work.
- Download and install the GemFire 8.1.0.0 Native Client for your platform from Pivotal Network.
- Set the environment variables described by the GemFire Native Client installation instructions for your platform.
Note that for the time being, if you want to be able to use the precompiled binary, you'll need to set NODE_TLS_REJECT_UNAUTHORIZED=0
when running npm install
. Otherwise, npm install
will fallback to compiling from source, which may only work on certain platforms.
$ cd /my/node/vagrant
$ NODE_TLS_REJECT_UNAUTHORIZED=0 npm install --save pivotal/node-gemfire
It is possible to configure the GemFire C++ Native Client compiled into this node module via a file called gfcpp.properties
. Place this file in the current working directory of your node application.
Here is an example file that turns off statistics collection, sets the "warning" log level, and redirects the log output to a file.
statistic-sampling-enabled=false
log-level=warning
log-file=log/gemfire.log
You can see the available options for gfcpp.properties
in the GemFire documentation.
var gemfire = require('gemfire');
gemfire.configure('config/cache.xml');
var cache = gemfire.getCache();
var region = cache.getRegion('myRegion');
region.put('foo', { bar: ['baz', 'qux'] }, function(error) {
region.get('foo', function(error, value) {
console.log(value); // => { bar: ['baz', 'qux'] }
});
});
For more information, please see the full API documentation.
To build the VM:
$ vagrant up
After pulling down updated code, you may need to re-provision your VM to get any new dependencies.
$ vagrant provision
This directory is mounted on the VM as /vagrant
. You can make edits here or on the VM.
$ vagrant ssh
$ cd /vagrant
$ vagrant ssh
$ cd /vagrant
$ grunt
The GemFire server should be automatically started for you as part of the above tasks. If you need to restart it manually, use the following:
$ vagrant ssh
$ grunt server:restart # or server:start or server:stop
Please see CONTRIBUTING.md for information on how to submit a pull request.
BSD, see LICENSE for details
For dependency licenses, see doc/dependencies.md