You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Wei Zhu <wz...@yahoo.com> on 2012/11/29 20:56:28 UTC
Rename cluster
Hi,
I am trying to rename a cluster by following the instruction on Wiki:
Cassandra says "ClusterName mismatch: oldClusterName != newClusterName" and refuses to start
To prevent
operator errors, Cassandra stores the name of the cluster in its system
table. If you need to rename a cluster for some reason, you can:
Perform these steps on each node:
1. Start the cassandra-cli connected locally to this node.
2. Run the following:
1. use system;
2. set LocationInfo[utf8('L')][utf8('ClusterName')]=utf8('<new cluster name>');
3. exit;
3. Run nodetool flush on this node.
4. Update the cassandra.yaml file for the cluster_name as the same as 2b).
5. Restart the node.
Once all nodes have been had this operation performed and restarted, nodetool ring should show all nodes as UP.
Get the following error:
Connected to: "Test Cluster" on 10.200.128.151/9160
Welcome to Cassandra CLI version 1.1.6
Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.
[default@unknown] use system;
Authenticated to keyspace: system
[default@system] set LocationInfo[utf8('L')][utf8('ClusterName')]=utf8('<General Services Cluster>');
system keyspace is not user-modifiable.
InvalidRequestException(why:system keyspace is not user-modifiable.)
at org.apache.cassandra.thrift.Cassandra$insert_result.read(Cassandra.java:15974)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.cassandra.thrift.Cassandra$Client.recv_insert(Cassandra.java:797)
at org.apache.cassandra.thrift.Cassandra$Client.insert(Cassandra.java:781)
at org.apache.cassandra.cli.CliClient.executeSet(CliClient.java:909)
at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:222)
at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:219)
at org.apache.cassandra.cli.CliMain.main(CliMain.java:346)
I have to remove the data directory in order to change the cluster name. Luckily it's my testing box, so no harm. Just wondering what has been changed not to allow the modification through cli? What is the way of changing the cluster name without wiping out all the data now?
Thanks.
-Wei
Re: Rename cluster
Posted by Edward Capriolo <ed...@gmail.com>.
Since the cluster name is only cosmetic people do not often change it. I
would not do this in a production cluster for sure.
On Thu, Nov 29, 2012 at 2:56 PM, Wei Zhu <wz...@yahoo.com> wrote:
> Hi,
> I am trying to rename a cluster by following the instruction on Wiki:
>
> Cassandra says "ClusterName mismatch: oldClusterName != newClusterName"
> and refuses to start
> To prevent operator errors, Cassandra stores the name of the cluster in
> its system table. If you need to rename a cluster for some reason, you can:
> Perform these steps on each node:
>
> 1. Start the cassandra-cli connected locally to this node.
> 2. Run the following:
> 1. use system;
> 2. set LocationInfo <http://wiki.apache.org/cassandra/LocationInfo>
> [utf8('L')][utf8('ClusterName<http://wiki.apache.org/cassandra/ClusterName>')]=utf8('<new
> cluster name>');
> 3. exit;
> 3. Run nodetool flush on this node.
> 4. Update the cassandra.yaml file for the cluster_name as the same as
> 2b).
> 5. Restart the node.
>
> Once all nodes have been had this operation performed and restarted,
> nodetool ring should show all nodes as UP.
>
> Get the following error:
> Connected to: "Test Cluster" on 10.200.128.151/9160
> Welcome to Cassandra CLI version 1.1.6
>
> Type 'help;' or '?' for help.
> Type 'quit;' or 'exit;' to quit.
>
> [default@unknown] use system;
> Authenticated to keyspace: system
> [default@system] set
> LocationInfo[utf8('L')][utf8('ClusterName')]=utf8('<General Services
> Cluster>');
> system keyspace is not user-modifiable.
> InvalidRequestException(why:system keyspace is not user-modifiable.)
> at
> org.apache.cassandra.thrift.Cassandra$insert_result.read(Cassandra.java:15974)
> at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
> at
> org.apache.cassandra.thrift.Cassandra$Client.recv_insert(Cassandra.java:797)
> at org.apache.cassandra.thrift.Cassandra$Client.insert(Cassandra.java:781)
> at org.apache.cassandra.cli.CliClient.executeSet(CliClient.java:909)
> at
> org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:222)
> at
> org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:219)
> at org.apache.cassandra.cli.CliMain.main(CliMain.java:346)
>
> I have to remove the data directory in order to change the cluster name.
> Luckily it's my testing box, so no harm. Just wondering what has been
> changed not to allow the modification through cli? What is the way of
> changing the cluster name without wiping out all the data now?
>
> Thanks.
> -Wei
>
Re: Rename cluster
Posted by Rob Coli <rc...@palominodb.com>.
On Thu, Nov 29, 2012 at 11:56 AM, Wei Zhu <wz...@yahoo.com> wrote:
> I am trying to rename a cluster by following the instruction on Wiki:
> [...]
> I have to remove the data directory in order to change the cluster name.
> Luckily it's my testing box, so no harm. Just wondering what has been
> changed not to allow the modification through cli? What is the way of
> changing the cluster name without wiping out all the data now?
The instructions on the wiki are wrong, because clients are now not
able to not able to update the system keyspace. The below ticket is an
expansion of the previous behavior, which must mean the behavior in
question dates to 0.8 or early 1.0.
https://issues.apache.org/jira/browse/CASSANDRA-3759
You don't need to remove the data directory to change the cluster
name, you only need to remove the contents of the system keyspace's
LocationInfo columnfamily, which is where Cluster Name is stored.
Full, safe, offline process to rename a cluster :
1) put new cluster name in conf files
2) stop cluster (including draining and removing commitlog if you are
in a version below 1.1.6 and cannot rely on drain to prevent log
replay)
3) move LocationInfo files out of system keyspace of all nodes
4) start cluster
I do not believe there is currently any online way to do the above
operation. The check which prevents you from writing to the system
keyspace is a keyspace level check.
=Rob
--
=Robert Coli
AIM>ALK - rcoli@palominodb.com
YAHOO - rcoli.palominob
SKYPE - rcoli_palominodb