Setting up C* - OSX vs Windows
This post is a quick overview of my experience of trying to build a platform independent application that uses Cassandra (I say platform independent, but what I mean is that Ubuntu, OSX and Win7/8 are supported).
Issues
- Permission - Unix based systems enforce permissions tightly and prevent usage of the
/var/log
and/var/lib
directories without root access. - System configurations - Windows requires the
CASSANDRA_HOME
environment variable to be configured. - Dependencies - JDK is required for Cassandra so the fact that OSX ships with the developer tools is very handy, however if a specific JDK is required, replacing OSX's default can be problematic.
Epic Workarounds Solutions!
Permissions
Since each Casstor uses has a Cassandra node running on their local account it couldn't be expected that users would have root / administrator access so the data directories were placed on the user's desktop.
System configurations
Because no environment variables are required by UNIX based systems, there wasn't much of a problem, and for windows the CASSANDRA_HOME
variable will be added by a batch file (dos script) using the setx
command in two ways, first an attempt is made to set a system level environment variable, if that fails than a user level environment variable is added:
C:> setx -m CASSANDRA_HOME "C:\Users\%username%\Desktop\cassandra"
C:> setx CASSANDRA_HOME "C:\Users\%username%\Desktop\cassandra
Dependencies
In the windows branch of the application a warning message is displayed that Cassandra will not start if a runtime is unavailable. Also launch4j
was used to allow simple JDK downloading if required.