cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cassandra Wiki] Update of "Operations" by EricEvans
Date Mon, 14 Dec 2009 20:38:32 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.

The "Operations" page has been changed by EricEvans.
The comment on this change is: some words about json export/import.
http://wiki.apache.org/cassandra/Operations?action=diff&rev1=16&rev2=17

--------------------------------------------------

  To revert to a snapshot, shut down the node, clear out the old commitlog and sstables, and
move the sstables from the snapshot location to the live data directory.
  
  === Import / export ===
- Cassandra can also export data as JSON with `bin/sstable2json`, and import it with `bin/json2sstable`.
 Eric to document. :)
+ As an alternative to taking snapshots it's possible to export SSTables to JSON format using
the `bin/sstable2json` command:
+ 
+ {{{
+ Usage: sstable2json [-f outfile] <sstable> [-k key [-k key [...]]]
+ }}}
+ 
+ `bin/sstable2json` accepts as a required argument, the full path to an SSTable data file,
(files ending in -Data.db), and an optional argument for an output file (by default, output
is written to stdout). You can also pass the names of specific keys using the `-k` argument
to limit what is exported.
+ 
+ Note: If you are not running the exporter on in-place SSTables, there are a couple of things
to keep in mind.
+  1. The corresponding configuration must be present (same as it would be to run a node).
+  2. SSTables are expected to be in a directory named for the keyspace (same as they would
be on a production node).
+ 
+ JSON exported SSTables can be "imported" to create new SSTables using `bin/json2sstable`:
+ 
+ {{{
+ Usage: json2sstable -K keyspace -c column_family <json> <sstable>
+ }}}
+ 
+ `bin/json2sstable` takes arguments for keyspace and column family names, and full paths
for the JSON input file and the destination SSTable file name.
  
  == Monitoring ==
  Cassandra exposes internal metrics as JMX data.  This is a common standard in the JVM world;
OpenNMS, Nagios, and Munin at least offer some level of JMX support.

Mime
View raw message