Borrowed from this old post: One Man Clapping
A normal Cassandra installation requires root access as it writes to OS root perm'd directories.
I'm trying to fire up some Cassandra demos in a dev environment. Ideally this setup will give me a standalone dev environment to tinker about in.
As such we don't want to do a full install where it writes to the standard OS system locations. Instead we need to write to the nodes install directory to /install/cassandra-data
I need the ability to run the following nodes:
- Data node type (storage)
- Analytics node type (spark)
Do this:
- Configure a set of localIp aliases:
sudo ifconfig lo0 alias 127.0.0.2 up
sudo ifconfig lo0 alias 127.0.0.3 up
- Edit /etc/hosts to create entries: 127.0.0.1 localhost alteredcarbon alteredcarbon.local127.0.0.2 localhost2 alteredcarbon2 alteredcarbon2.local
- Extract dse4.5.3.tar => node1
- CD into node1
- Change the JMX port of the cassandra env. $ vi resources/cassandra/conf/cassandra-env.sh
- JMX PORT: $ JMX_PORT="17199"
- Configure local output (we don't want to write logs to /etc on the dev machine) (source)
$ mkdir cassandra-data; cd cassandra-data$ mkdir data saved_caches commit log
Then edit $ vi resources/cassandra/conf/cassandra.yaml
cluster_name: 'Dev Cluster' initial_token: 0 data_file_directories: - path_to_install/cassandra-data/data commitlog_directory: path_to_install/cassandra-data/commitlog saved_caches_directory: path_to_install/cassandra-data/saved_caches
You don't need to change the default data ports: 7000, 7001; they are running on the aliased IPs, 127.0.0.1, 127.0.0.2 etc
7. Configure the log output:
$ vi ./resources/cassandra/conf/log4j-server.properties
log4j.appender.R.File= path_to_install/cassandra-data/system.log
log4j.appender.V.File= path_to_install/cassandra- data/solrvalidation.log
8. Now fire up a realtime data node (link)$ ./dse cassandra -f9. Or a data node: or something else (link)10. Fire up OpsCenter and we should see the node:
Command Option Description Example dse -c Enable the Cassandra File System (CFS) but not the integrated DSE jobtrackers and tasktrackers. Use to start nodes for running an external Hadoop system. dse -v Send the DSE version number to standard output. none dse cassandra Start up a real-time Cassandra node in the background. link to example dse cassandra -f Start up a real-time Cassandra node in the foreground. Can be used with -k, -t, or -s options. none dse cassandra -k Start up an analytics node in Spark mode in the background. example dse cassandra -k -t Start up an analytics node in Spark and DSE Hadoop mode. example dse cassandra -s Start up a DSE Search/Solr node in the background. link to example dse cassandra -s -Ddse.solr.data.dir=path Use path to store Solr data. link to example dse cassandra -t Start up an analytics node in the background. link to example dse cassandra -t -j Start up an analytics node as the job tracker. link to example dse cassandra-stop -p pid Stop the DataStax Enterprise process number (pid). If -p and the pid are omitted, the command stops the local node. link to example
alteredcarbon:OPSCENTER neil$ opscenter-5.0.1/bin/opscenterOpsCenter is at : http://localhost:8080
Note: The first time I tried this it didn't work, after a reboot it was successful.
Want to do this without DSE then try: CCM
No comments:
Post a Comment