Please continue discussion in new thread "Best practices when deploying & upgrading a cassandra cluster".
-Martin On Thu, Aug 11, 2011 at 12:43 PM, Martin Lansler <martin.lans...@gmail.com> wrote: > Hi Eldad / All, > > On Wed, Aug 10, 2011 at 8:32 AM, Eldad Yamin <elda...@gmail.com> wrote: >> Can you please explain how did you upgraded. something like step-by-step. >> Thanks! > > I took the liberty of replying to the group as it would be interesting > to hear how other folks out there are doing it... > > I'm *not* running a prod system, just a test system of three nodes on > my laptop. So it would be nice to hear about real setups. Here is my > test setup: > > apache-cassandra -> apache-cassandra-0.8.3 > apache-cassandra-0.8.2/ > apache-cassandra-0.8.3/ > node1/ > node2/ > node3/ > > All nodeX look like: > bin -> ../apache-cassandra/bin/ > commitlog/ > conf/ > data/ > interface -> ../apache-cassandra/interface/ > lib -> ../apache-cassandra/lib/ > saved_caches/ > > The 'conf' directory is copied into each node from the virgin > cassandra distribution. I then create a local GIT repo and add the > 'conf' directory so I can track any configuration changes on a node. > Then relevant node specific configuration settings are set. The > 'commitlog', 'data' and 'saved_caches' are created by cassandra and > must be configured in 'cassandra.yaml' for each node. > > When I upgrade I do the following: > > 1. > Make a diff of the new conf files from the new version so that get > new parameters etc... I use emacs ediff-mode. > 2. > Remove the old "apache-cassandra" symlink and point it to the new cassandra > dist > 3. > In a rolling fashion stop one node, and then restart it... as the > symlink is changes it will then boot with the upgraded cassandra dist. > (remember to cd out & in of the bin/ dir otherwise you will still be > in the old directory). > (4). > Should something break... just re-create the old symlink and restart > the node (provided cassandra has not performed any non backwards > compatible changes to the db files, should be noted in the README) > > That's pretty much it. > > On a prod setup one would probably use a tool such as puppet > (www.puppetlabs.com/) to ease setting up on many nodes... But there > are many ways to do this, for instance pssh > (http://code.google.com/p/parallel-ssh/). > > Regards, > -Martin > > On Wed, Aug 10, 2011 at 8:32 AM, Eldad Yamin <elda...@gmail.com> wrote: >> Can you please explain how did you upgraded. something like step-by-step. >> Thanks! >> >> On Wed, Aug 10, 2011 at 12:11 AM, Martin Lansler <martin.lans...@gmail.com> >> wrote: >>> >>> Hi, >>> >>> When I upgraded from 0.8.2 to 0.8.3 I encountered a exception during >>> startup: >>> ... >>> Caused by: org.apache.cassandra.config.ConfigurationException: >>> replication_factor is an option for SimpleStrategy, not >>> NetworkTopologyStrategy >>> at >>> org.apache.cassandra.locator.NetworkTopologyStrategy.<init>(NetworkTopologyStrategy.java:70) >>> ... >>> >>> This was caused by the following change: >>> --- >>> cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java >>> 2011/07/18 >>> 13:32:48 1147869 >>> +++ >>> cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java >>> 2011/08/02 >>> 17:07:22 1153200 >>> @@ -67,7 +67,7 @@ >>> { >>> String dc = entry.getKey(); >>> if (dc.equalsIgnoreCase("replication_factor")) >>> - continue; // TODO remove this for 1.0 >>> + throw new >>> ConfigurationException("replication_factor is an option for >>> SimpleStrategy, not NetworkTopologyStrategy"); >>> Integer replicas = Integer.valueOf(entry.getValue()); >>> newDatacenters.put(dc, replicas); >>> } >>> >>> To solve it use the 'cassandra-cli' on one of the other "up" nodes: >>> >>> [default@unknown] describe keyspace TestKeyspace; >>> WARNING: Could not connect to the JMX on 127.0.0.3:7199, information >>> won't be shown. >>> Keyspace: TestKeyspace: >>> Replication Strategy: >>> org.apache.cassandra.locator.NetworkTopologyStrategy >>> Durable Writes: true >>> Options: [replication_factor:2] >>> ... >>> >>> default@unknown] update keyspace TestKeyspace with >>> strategy_options=[{datacenter:2}]; >>> 47035d20-c2ca-11e0-0000-de5e2f7aa3bf >>> Waiting for schema agreement... >>> ... schemas agree across the cluster >>> >>> [default@unknown] describe keyspace TestKeyspace; >>> Keyspace: TestKeyspace: >>> Replication Strategy: >>> org.apache.cassandra.locator.NetworkTopologyStrategy >>> Durable Writes: true >>> Options: [datacenter:2] >>> >>> Then restart the 0.8.3 node and it should be fine. >>> >>> Regards, >>> -Martin >> >> >