Академический Документы
Профессиональный Документы
Культура Документы
Prerequisites:
2. JDK6 http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html
3. Ant http://ant.apache.org/
4. Git http://git-scm.com/download/win
Please set JAVA_HOME, ANT_HOME and CASSANDRA_HOME
I used WINDOWS as an operating system.
Check out Cassandra code:
1. From the command prompt, check-out the latest code using Git.
2. git clone http://git-wip-us.apache.org/repos/asf/cassandra.git cassandra-trunk
3. Build the code.
4. cd cassandra-trunk
5. ant build
6. ant generate-eclipse-files
4. Click "Next"
5. Verify that the Default Output Folder is cassandra-trunk/build/classes/main. Eclipse normally
defaults to bin which we DO NOT want for Cassandra.
6. Click "Finish"
Run Cassandra:
Click "Run" -> "Run Configurations...". Select org.apache.cassandra.thrift.CassandraDaemon as you
Main class, make sure that your cassandra project is selected in the "Project" field. Under the Arguments
tab you can specify VM arguments. Below are VM arguments for running Cassandra 0.7+ in Windows.
-Dcassandra.config=file:C:\Users\Joaquin\workspace\cassandra-3\conf\cassandra.yaml
-Dcassandra-foreground
-ea -Xmx1G
-Dlog4j.configuration=file:C:\Users\Joaquin\workspace\cassandra-3\conf\log4j-server.properties
or
-Dcassandra.config=file:/home/david/programming/java/cassandra/conf/cassandra.yaml
-Dcassandra-foreground
-ea -Xmx1G
-Dlog4j.configuration=file:/home/david/programming/java/cassandra/conf/log4j-server.properties
That should be it. After running the newly created run configuration you should see something like this in
the console view.
INFO 01:22:15,227 Log replay complete, 12 replayed mutations
INFO 01:22:16,025 Cassandra version: Unknown
INFO 01:22:16,025 Thrift API version: 19.36.0
INFO 01:22:16,041 CQL supported versions: 2.0.0,3.0.1 (default: 3.0.1)
INFO 01:22:16,182 Loading persisted ring state
INFO 01:22:16,182 Starting up server gossip
INFO 01:22:16,213 Enqueuing flush of Memtable-local@873551122(253/253 serialized/live bytes, 9 ops)
INFO 01:22:16,213 Writing Memtable-local@873551122(253/253 serialized/live bytes, 9 ops)
INFO 01:22:16,416 Completed flushing data\cassandra\data\system\local\system-local-ic-123-Data.db (246 bytes) for commitlog position
ReplayPosition(segmentId=1362216132917, position=58913)
INFO 01:22:16,698 Starting Messaging Service on port 7000
INFO 01:22:16,870 Using saved token [-6159406281237189176]
INFO 01:22:16,870 Enqueuing flush of Memtable-local@1370440457(84/84 serialized/live bytes, 4 ops)
INFO 01:22:16,886 Writing Memtable-local@1370440457(84/84 serialized/live bytes, 4 ops)
INFO 01:22:17,089 Completed flushing data\cassandra\data\system\local\system-local-ic-124-Data.db (124 bytes) for commitlog position
ReplayPosition(segmentId=1362216132917, position=59188)
INFO 01:22:17,089 Enqueuing flush of Memtable-local@673795938(51/51 serialized/live bytes, 2 ops)
INFO 01:22:17,105 Writing Memtable-local@673795938(51/51 serialized/live bytes, 2 ops)
INFO 01:22:17,386 Completed flushing data\cassandra\data\system\local\system-local-ic-125-Data.db (108 bytes) for commitlog position
ReplayPosition(segmentId=1362216132917, position=59363)
INFO 01:22:17,386 Compacting [SSTableReader(path='data\cassandra\data\system\local\system-local-ic-122-Data.db'),
SSTableReader(path='data\cassandra\data\system\local\system-local-ic-125-Data.db'),
SSTableReader(path='data\cassandra\data\system\local\system-local-ic-123-Data.db'),
SSTableReader(path='data\cassandra\data\system\local\system-local-ic-124-Data.db')]
INFO 01:22:17,433 Node localhost/127.0.0.1 state jump to normal
INFO 01:22:17,449 Startup completed! Now serving reads.
INFO 01:22:17,606 Not starting native transport as requested. Use JMX (StorageService->startNativeTransport()) to start it
INFO 01:22:17,621 Binding thrift service to localhost/127.0.0.1:9160
INFO 01:22:17,621 Compacted 4 sstables to [data\cassandra\data\system\local\system-local-ic-126,]. 1,016 bytes to 558 (~54% of original)
in 220ms = 0.002419MB/s. 4 total rows, 1 unique. Row merge counts were {1:0, 2:0, 3:0, 4:1, }
INFO 01:22:17,699 Using TFramedTransport with a max frame size of 15728640 bytes.
INFO 01:22:17,731 Using synchronous/threadpool thrift server on localhost : 9160
INFO 01:22:17,731 Listening for thrift clients...
===========
Install Cassandra
Steps
Starting Server - Type cassandra and execute. The Cassandra Server should start working
without any Java exceptions and you should see something like "listening to thrift clients
at the end....."
Starting Client - Again open command prompt and go to bin folder and execute
cassandra.cli. This should start the client instance.
Type connect 127.0.0.1/9160 which should give connected to "Test Cluster" message
Start coding.....