02/23/2014: Writing a nodejs script file
This is a short post about a simple topic but it's one that I hadn't thought
about so sharing seems good. I like computer languages that run from back-end
processing to front-end web site development. For example, Ruby handles the
both environments, but Java doesn't. Today I realized that nodejs can also
handle both. And it's simple.
A nodejs script looks like this:
1. Create a file called helloWorld with the following contents:
#!/usr/bin/env node
console.log("Hello World.");
2. chmod +x helloWorld
3. ./helloWorld
Of course, you have the full power of javascript and nodejs to play with.
Have fun!
1. Create a file called helloWorld with the following contents:
#!/usr/bin/env node
console.log("Hello World.");
2. chmod +x helloWorld
3. ./helloWorld
Of course, you have the full power of javascript and nodejs to play with.
Have fun!
12/02/2013: Watching Accumulo Recover From a Killed Master Process In a Multi-Master Configuration.
Accumulo can easily run in a multiple-master configuration. This post shows how to watch it recover when a master process is killed.
The steps below show how to convert from a single-master cluster to a two-master cluster. Then you'll kill the active master and watch the monitor page to see Accumulo automatically switch to the backup master.
Restarting the killed master process is easy. Following the steps below:
- Start a cluster with a master and two nodes using https://github.com/medined/Accumulo_1_5_0_By_Vagrant.
- vagrant ssh master
- cd accumulo_home/bin/accumulo
- bin/stop-all.sh
- echo "affy-slave1" >> conf/masters
- bin/start-all.sh
- Visit http://affy-master:50095/master to see which node is the current master. Note that you are connecting to the monitor process not the master process. Don't let the hostnames confuse you.
- Enable auto-refresh.
- SSH to whichever node is listed as the master.
- ps fax | grep app=master | grep -v grep | cut -d' ' -f1 | xargs kill -9
- Visit http://affy-master:50095/master and you should see a 'Master Server Not Running' message. Reload the page if needed.
- Within a few seconds, the alternate master process should be active.
Restarting the killed master process is easy. Following the steps below:
- vagrant ssh master
- cd accumulo_home/bin/accumulo
- bin/start-all.sh