You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Tim Dunphy <bl...@gmail.com> on 2013/01/09 18:50:37 UTC
change cluster name retaining keypsace
Hello,
I'm attempting to change my cluster name, yet retain my keyspace as it
was. I know from what I've read that this requires changing it within the
cassandra cli (using system), changing it in the cassandra.yaml file, and
deleting the contents of the /var/lib/cassandra/data/system directory. Then
restart cassandra.
This does work. I am able to change my cluster name this way. But of
course, since I deleted my system information I have lost all reference to
my keyspace. My app does not work and a show keyspaces within the
cassandra-cli does not show the keyspace. This does make a certain amount
of sense to me as I realize that the system kesyspace directory does
contain information on the keyspaces within this cassandra node.
So what I did was create a snapshot of my keyspace (joke_fire1) with the
command nodetool -h localhost -p 7199 joke_fire1.
I then re-create the keyspace within the cassandra cli and copy just the
.*db files back to the keyspace directory. But that doesn't work a describe
keyspace does not show my column families and my app doesn't work.
I even tried creating a tar archive of the keyspace directory and then
rsyncing the entire contents of the tar archive to the keyspace directory
after creating the keyspace with the same name in the casssandra-cli. Still
no good.
I was wondering if I could get some advice on how to change my cluster name
and yet either retain or restore from backup properly my keyspace as it was
before the cluster name change.
I tried following the backup and restore advice from both this guide:
http://jonathanhui.com/cassandra-data-maintenance-backup-and-system-recovery
And this guide:
http://www.datastax.com/docs/1.1/operations/backup_restore
I'm running cassandra 1.1.8.
Thanks
Tim
--
GPG me!!
gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
Re: change cluster name retaining keypsace
Posted by aaron morton <aa...@thelastpickle.com>.
That looks technically correct for pre 1.2, in 1.2 the name of the column has changed to cluster_name.
Note that you are diving into internals and that way be danger.
Cheers
-----------------
Aaron Morton
Freelance Cassandra Developer
New Zealand
@aaronmorton
http://www.thelastpickle.com
On 12/01/2013, at 10:26 AM, S C <as...@outlook.com> wrote:
> Aaron,
>
> Can this also be considered?
>
> Connect to node using cassandra-cli
> use system;
> set LocationInfo[utf8('L')][utf8('ClusterName')]=utf8('<new cluster name>');
> exit;
> Run nodetool flush on the node
> Update cassandra.yaml file with new cluster_name
> Restart node.
>
> Thanks,
> SC
>
> From: aaron@thelastpickle.com
> Subject: Re: change cluster name retaining keypsace
> Date: Thu, 10 Jan 2013 13:21:28 +1300
> To: user@cassandra.apache.org
>
> To change the cluster name:
>
> 1) Stop all nodes.
> 2) Delete or move the LocationInfo sstables from /var/log/cassandra/data/system/LocationInfo
> 3) Change the cluster_name in cassandra.yaml
> 4) Restart the nodes.
>
> You cannot do an incremental change of the cluster name. All nodes in the cluster must have the same name.
>
> By only deleting the LocationInfo CF your schema will be preserved. You do not have to move / delete any of the user data.
>
> Hope that helps.
>
> -----------------
> Aaron Morton
> Freelance Cassandra Developer
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 10/01/2013, at 6:50 AM, Tim Dunphy <bl...@gmail.com> wrote:
>
> Hello,
>
> I'm attempting to change my cluster name, yet retain my keyspace as it was. I know from what I've read that this requires changing it within the cassandra cli (using system), changing it in the cassandra.yaml file, and deleting the contents of the /var/lib/cassandra/data/system directory. Then restart cassandra.
>
> This does work. I am able to change my cluster name this way. But of course, since I deleted my system information I have lost all reference to my keyspace. My app does not work and a show keyspaces within the cassandra-cli does not show the keyspace. This does make a certain amount of sense to me as I realize that the system kesyspace directory does contain information on the keyspaces within this cassandra node.
>
> So what I did was create a snapshot of my keyspace (joke_fire1) with the command nodetool -h localhost -p 7199 joke_fire1.
>
> I then re-create the keyspace within the cassandra cli and copy just the .*db files back to the keyspace directory. But that doesn't work a describe keyspace does not show my column families and my app doesn't work.
>
> I even tried creating a tar archive of the keyspace directory and then rsyncing the entire contents of the tar archive to the keyspace directory after creating the keyspace with the same name in the casssandra-cli. Still no good.
>
> I was wondering if I could get some advice on how to change my cluster name and yet either retain or restore from backup properly my keyspace as it was before the cluster name change.
>
> I tried following the backup and restore advice from both this guide:
>
> http://jonathanhui.com/cassandra-data-maintenance-backup-and-system-recovery
>
> And this guide:
>
> http://www.datastax.com/docs/1.1/operations/backup_restore
>
> I'm running cassandra 1.1.8.
>
> Thanks
> Tim
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
RE: change cluster name retaining keypsace
Posted by S C <as...@outlook.com>.
Aaron,
Can this also be considered?
Connect to node using cassandra-cliuse system;set LocationInfo[utf8('L')][utf8('ClusterName')]=utf8('<new cluster name>');exit;Run nodetool flush on the nodeUpdate cassandra.yaml file with new cluster_nameRestart node.
Thanks,SC
From: aaron@thelastpickle.com
Subject: Re: change cluster name retaining keypsace
Date: Thu, 10 Jan 2013 13:21:28 +1300
To: user@cassandra.apache.org
To change the cluster name:
1) Stop all nodes. 2) Delete or move the LocationInfo sstables from /var/log/cassandra/data/system/LocationInfo3) Change the cluster_name in cassandra.yaml4) Restart the nodes.
You cannot do an incremental change of the cluster name. All nodes in the cluster must have the same name.
By only deleting the LocationInfo CF your schema will be preserved. You do not have to move / delete any of the user data.
Hope that helps.
-----------------Aaron MortonFreelance Cassandra DeveloperNew Zealand
@aaronmortonhttp://www.thelastpickle.com
On 10/01/2013, at 6:50 AM, Tim Dunphy <bl...@gmail.com> wrote:Hello,
I'm attempting to change my cluster name, yet retain my keyspace as it was. I know from what I've read that this requires changing it within the cassandra cli (using system), changing it in the cassandra.yaml file, and deleting the contents of the /var/lib/cassandra/data/system directory. Then restart cassandra.
This does work. I am able to change my cluster name this way. But of course, since I deleted my system information I have lost all reference to my keyspace. My app does not work and a show keyspaces within the cassandra-cli does not show the keyspace. This does make a certain amount of sense to me as I realize that the system kesyspace directory does contain information on the keyspaces within this cassandra node.
So what I did was create a snapshot of my keyspace (joke_fire1) with the command nodetool -h localhost -p 7199 joke_fire1.
I then re-create the keyspace within the cassandra cli and copy just the .*db files back to the keyspace directory. But that doesn't work a describe keyspace does not show my column families and my app doesn't work.
I even tried creating a tar archive of the keyspace directory and then rsyncing the entire contents of the tar archive to the keyspace directory after creating the keyspace with the same name in the casssandra-cli. Still no good.
I was wondering if I could get some advice on how to change my cluster name and yet either retain or restore from backup properly my keyspace as it was before the cluster name change.
I tried following the backup and restore advice from both this guide:
http://jonathanhui.com/cassandra-data-maintenance-backup-and-system-recovery
And this guide:
http://www.datastax.com/docs/1.1/operations/backup_restore
I'm running cassandra 1.1.8.
ThanksTim
--
GPG me!!
gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
Re: change cluster name retaining keypsace
Posted by Tim Dunphy <bl...@gmail.com>.
Hey Aaron,
That worked beautifully. Thank you sir!
Tim
On Thu, Jan 10, 2013 at 2:59 PM, Tim Dunphy <bl...@gmail.com> wrote:
> Cool guys.. and thanks. I'll give this a shot. And I do understand it's a
> cosmetic issue. It's just an OCD little detail I want to correct before my
> cluster starts growing more nodes. :)
>
>
>
> On Thu, Jan 10, 2013 at 2:39 PM, aaron morton <aa...@thelastpickle.com>wrote:
>
>> I think Arron meant /var/lib/cassandra (by default)
>>
>> Yup, sorry.
>> A
>>
>> -----------------
>> Aaron Morton
>> Freelance Cassandra Developer
>> New Zealand
>>
>> @aaronmorton
>> http://www.thelastpickle.com
>>
>> On 10/01/2013, at 4:38 PM, Michael Kjellman <mk...@barracuda.com>
>> wrote:
>>
>> I think Arron meant /var/lib/cassandra (by default)
>>
>> Check there (unless you changed you data directories in your
>> cassandra.yaml)
>>
>> On Jan 9, 2013, at 7:36 PM, "Tim Dunphy" <bl...@gmail.com> wrote:
>>
>> Hello,
>>
>> And thanks for your reply! Well so far it's just a single node. So I
>> wouldn't think this should be so complicated. But one day hopefully from
>> this node a cluster will grow, but that we shall have to wait and see.
>>
>> At any rate, at /var/log/cassandra I don't see a directory called system.
>> All I see is a system log (a bunch of them rotated, I won't show the
>> rotated logs:
>>
>> [root@beta:~] #ls -l /var/log/cassandra/system.log
>> -rw-r--r-- 1 root root 12003809 Jan 9 22:29 /var/log/cassandra/system.log
>>
>> On Wed, Jan 9, 2013 at 7:21 PM, aaron morton <aa...@thelastpickle.com>wrote:
>>
>>> /var/log/cassandra/data/system/LocationInfo
>>
>>
>>
>> The only LocationInfo files I see pertaining to cassandra are here:
>>
>> [root@beta:~] #locate LocationInfo | grep -i -v -e backup -e nagios
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Data.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Digest.sha1
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Filter.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Index.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Statistics.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Data.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Digest.sha1
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Filter.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Index.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Statistics.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Data.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Digest.sha1
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Filter.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Index.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Statistics.db
>>
>> Not sure what the effect of removing these files would be, but would
>> doing so allow me to change my cluster name while retaining my keyspace
>> schema?
>>
>> Thanks!
>>
>> Tim
>>
>>
>>
>> --
>> GPG me!!
>>
>> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>>
>>
>> ----------------------------------
>> Join Barracuda Networks in the fight against hunger.
>> To learn how you can help in your community, please visit:
>> http://on.fb.me/UAdL4f
>>
>>
>>
>>
>
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>
>
--
GPG me!!
gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
Re: change cluster name retaining keypsace
Posted by Tim Dunphy <bl...@gmail.com>.
Cool guys.. and thanks. I'll give this a shot. And I do understand it's a
cosmetic issue. It's just an OCD little detail I want to correct before my
cluster starts growing more nodes. :)
On Thu, Jan 10, 2013 at 2:39 PM, aaron morton <aa...@thelastpickle.com>wrote:
> I think Arron meant /var/lib/cassandra (by default)
>
> Yup, sorry.
> A
>
> -----------------
> Aaron Morton
> Freelance Cassandra Developer
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 10/01/2013, at 4:38 PM, Michael Kjellman <mk...@barracuda.com>
> wrote:
>
> I think Arron meant /var/lib/cassandra (by default)
>
> Check there (unless you changed you data directories in your
> cassandra.yaml)
>
> On Jan 9, 2013, at 7:36 PM, "Tim Dunphy" <bl...@gmail.com> wrote:
>
> Hello,
>
> And thanks for your reply! Well so far it's just a single node. So I
> wouldn't think this should be so complicated. But one day hopefully from
> this node a cluster will grow, but that we shall have to wait and see.
>
> At any rate, at /var/log/cassandra I don't see a directory called system.
> All I see is a system log (a bunch of them rotated, I won't show the
> rotated logs:
>
> [root@beta:~] #ls -l /var/log/cassandra/system.log
> -rw-r--r-- 1 root root 12003809 Jan 9 22:29 /var/log/cassandra/system.log
>
> On Wed, Jan 9, 2013 at 7:21 PM, aaron morton <aa...@thelastpickle.com>wrote:
>
>> /var/log/cassandra/data/system/LocationInfo
>
>
>
> The only LocationInfo files I see pertaining to cassandra are here:
>
> [root@beta:~] #locate LocationInfo | grep -i -v -e backup -e nagios
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Data.db
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Digest.sha1
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Filter.db
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Index.db
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Statistics.db
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Data.db
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Digest.sha1
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Filter.db
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Index.db
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Statistics.db
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Data.db
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Digest.sha1
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Filter.db
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Index.db
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Statistics.db
>
> Not sure what the effect of removing these files would be, but would doing
> so allow me to change my cluster name while retaining my keyspace schema?
>
> Thanks!
>
> Tim
>
>
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>
>
> ----------------------------------
> Join Barracuda Networks in the fight against hunger.
> To learn how you can help in your community, please visit:
> http://on.fb.me/UAdL4f
>
>
>
>
--
GPG me!!
gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
Re: change cluster name retaining keypsace
Posted by aaron morton <aa...@thelastpickle.com>.
> I think Arron meant /var/lib/cassandra (by default)
Yup, sorry.
A
-----------------
Aaron Morton
Freelance Cassandra Developer
New Zealand
@aaronmorton
http://www.thelastpickle.com
On 10/01/2013, at 4:38 PM, Michael Kjellman <mk...@barracuda.com> wrote:
> I think Arron meant /var/lib/cassandra (by default)
>
> Check there (unless you changed you data directories in your cassandra.yaml)
>
> On Jan 9, 2013, at 7:36 PM, "Tim Dunphy" <bl...@gmail.com> wrote:
>
>> Hello,
>>
>> And thanks for your reply! Well so far it's just a single node. So I wouldn't think this should be so complicated. But one day hopefully from this node a cluster will grow, but that we shall have to wait and see.
>>
>> At any rate, at /var/log/cassandra I don't see a directory called system. All I see is a system log (a bunch of them rotated, I won't show the rotated logs:
>>
>> [root@beta:~] #ls -l /var/log/cassandra/system.log
>> -rw-r--r-- 1 root root 12003809 Jan 9 22:29 /var/log/cassandra/system.log
>>
>> On Wed, Jan 9, 2013 at 7:21 PM, aaron morton <aa...@thelastpickle.com> wrote:
>> /var/log/cassandra/data/system/LocationInfo
>>
>>
>> The only LocationInfo files I see pertaining to cassandra are here:
>>
>> [root@beta:~] #locate LocationInfo | grep -i -v -e backup -e nagios
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Data.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Digest.sha1
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Filter.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Index.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-249-Statistics.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Data.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Digest.sha1
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Filter.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Index.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-250-Statistics.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Data.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Digest.sha1
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Filter.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Index.db
>> /var/lib/cassandra/data/system/LocationInfo-hd-251-Statistics.db
>>
>> Not sure what the effect of removing these files would be, but would doing so allow me to change my cluster name while retaining my keyspace schema?
>>
>> Thanks!
>>
>> Tim
>>
>>
>>
>> --
>> GPG me!!
>>
>> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>>
>
> ----------------------------------
> Join Barracuda Networks in the fight against hunger.
> To learn how you can help in your community, please visit: http://on.fb.me/UAdL4f
>
Re: change cluster name retaining keypsace
Posted by Alain RODRIGUEZ <ar...@gmail.com>.
By the way, The cluster name is only cosmetic. It may not be worth to
change it since it induce a downtime and considering the mishandling risk.
Alain
2013/1/10 Michael Kjellman <mk...@barracuda.com>
> I think Arron meant /var/lib/cassandra (by default)
>
> Check there (unless you changed you data directories in your
> cassandra.yaml)
>
> On Jan 9, 2013, at 7:36 PM, "Tim Dunphy" <bl...@gmail.com> wrote:
>
> Hello,
>
> And thanks for your reply! Well so far it's just a single node. So I
> wouldn't think this should be so complicated. But one day hopefully from
> this node a cluster will grow, but that we shall have to wait and see.
>
> At any rate, at /var/log/cassandra I don't see a directory called system.
> All I see is a system log (a bunch of them rotated, I won't show the
> rotated logs:
>
> [root@beta:~] #ls -l /var/log/cassandra/system.log
> -rw-r--r-- 1 root root 12003809 Jan 9 22:29 /var/log/cassandra/system.log
>
> On Wed, Jan 9, 2013 at 7:21 PM, aaron morton <aa...@thelastpickle.com>wrote:
>
>> /var/log/cassandra/data/system/LocationInfo
>>
>
>
> The only LocationInfo files I see pertaining to cassandra are here:
>
> [root@beta:~] #locate LocationInfo | grep -i -v -e backup -e nagios
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Data.db
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Digest.sha1
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Filter.db
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Index.db
> /var/lib/cassandra/data/system/LocationInfo-hd-249-Statistics.db
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Data.db
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Digest.sha1
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Filter.db
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Index.db
> /var/lib/cassandra/data/system/LocationInfo-hd-250-Statistics.db
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Data.db
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Digest.sha1
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Filter.db
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Index.db
> /var/lib/cassandra/data/system/LocationInfo-hd-251-Statistics.db
>
> Not sure what the effect of removing these files would be, but would doing
> so allow me to change my cluster name while retaining my keyspace schema?
>
> Thanks!
>
> Tim
>
>
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>
>
> ----------------------------------
> Join Barracuda Networks in the fight against hunger.
> To learn how you can help in your community, please visit:
> http://on.fb.me/UAdL4f
>
>
Re: change cluster name retaining keypsace
Posted by Michael Kjellman <mk...@barracuda.com>.
I think Arron meant /var/lib/cassandra (by default)
Check there (unless you changed you data directories in your cassandra.yaml)
On Jan 9, 2013, at 7:36 PM, "Tim Dunphy" <bl...@gmail.com>> wrote:
Hello,
And thanks for your reply! Well so far it's just a single node. So I wouldn't think this should be so complicated. But one day hopefully from this node a cluster will grow, but that we shall have to wait and see.
At any rate, at /var/log/cassandra I don't see a directory called system. All I see is a system log (a bunch of them rotated, I won't show the rotated logs:
[root@beta:~] #ls -l /var/log/cassandra/system.log
-rw-r--r-- 1 root root 12003809 Jan 9 22:29 /var/log/cassandra/system.log
On Wed, Jan 9, 2013 at 7:21 PM, aaron morton <aa...@thelastpickle.com>> wrote:
/var/log/cassandra/data/system/LocationInfo
The only LocationInfo files I see pertaining to cassandra are here:
[root@beta:~] #locate LocationInfo | grep -i -v -e backup -e nagios
/var/lib/cassandra/data/system/LocationInfo-hd-249-Data.db
/var/lib/cassandra/data/system/LocationInfo-hd-249-Digest.sha1
/var/lib/cassandra/data/system/LocationInfo-hd-249-Filter.db
/var/lib/cassandra/data/system/LocationInfo-hd-249-Index.db
/var/lib/cassandra/data/system/LocationInfo-hd-249-Statistics.db
/var/lib/cassandra/data/system/LocationInfo-hd-250-Data.db
/var/lib/cassandra/data/system/LocationInfo-hd-250-Digest.sha1
/var/lib/cassandra/data/system/LocationInfo-hd-250-Filter.db
/var/lib/cassandra/data/system/LocationInfo-hd-250-Index.db
/var/lib/cassandra/data/system/LocationInfo-hd-250-Statistics.db
/var/lib/cassandra/data/system/LocationInfo-hd-251-Data.db
/var/lib/cassandra/data/system/LocationInfo-hd-251-Digest.sha1
/var/lib/cassandra/data/system/LocationInfo-hd-251-Filter.db
/var/lib/cassandra/data/system/LocationInfo-hd-251-Index.db
/var/lib/cassandra/data/system/LocationInfo-hd-251-Statistics.db
Not sure what the effect of removing these files would be, but would doing so allow me to change my cluster name while retaining my keyspace schema?
Thanks!
Tim
--
GPG me!!
gpg --keyserver pool.sks-keyservers.net<http://pool.sks-keyservers.net> --recv-keys F186197B
Southfield Public School students safely access the tech tools they need on and off campus with the Barracuda Web Filter.
Quick installation and easy to use- try the Barracuda Web Filter free for 30 days: http://on.fb.me/Vj6JBd
Re: change cluster name retaining keypsace
Posted by Tim Dunphy <bl...@gmail.com>.
Hello,
And thanks for your reply! Well so far it's just a single node. So I
wouldn't think this should be so complicated. But one day hopefully from
this node a cluster will grow, but that we shall have to wait and see.
At any rate, at /var/log/cassandra I don't see a directory called system.
All I see is a system log (a bunch of them rotated, I won't show the
rotated logs:
[root@beta:~] #ls -l /var/log/cassandra/system.log
-rw-r--r-- 1 root root 12003809 Jan 9 22:29 /var/log/cassandra/system.log
On Wed, Jan 9, 2013 at 7:21 PM, aaron morton <aa...@thelastpickle.com>wrote:
> /var/log/cassandra/data/system/LocationInfo
>
The only LocationInfo files I see pertaining to cassandra are here:
[root@beta:~] #locate LocationInfo | grep -i -v -e backup -e nagios
/var/lib/cassandra/data/system/LocationInfo-hd-249-Data.db
/var/lib/cassandra/data/system/LocationInfo-hd-249-Digest.sha1
/var/lib/cassandra/data/system/LocationInfo-hd-249-Filter.db
/var/lib/cassandra/data/system/LocationInfo-hd-249-Index.db
/var/lib/cassandra/data/system/LocationInfo-hd-249-Statistics.db
/var/lib/cassandra/data/system/LocationInfo-hd-250-Data.db
/var/lib/cassandra/data/system/LocationInfo-hd-250-Digest.sha1
/var/lib/cassandra/data/system/LocationInfo-hd-250-Filter.db
/var/lib/cassandra/data/system/LocationInfo-hd-250-Index.db
/var/lib/cassandra/data/system/LocationInfo-hd-250-Statistics.db
/var/lib/cassandra/data/system/LocationInfo-hd-251-Data.db
/var/lib/cassandra/data/system/LocationInfo-hd-251-Digest.sha1
/var/lib/cassandra/data/system/LocationInfo-hd-251-Filter.db
/var/lib/cassandra/data/system/LocationInfo-hd-251-Index.db
/var/lib/cassandra/data/system/LocationInfo-hd-251-Statistics.db
Not sure what the effect of removing these files would be, but would doing
so allow me to change my cluster name while retaining my keyspace schema?
Thanks!
Tim
--
GPG me!!
gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
Re: change cluster name retaining keypsace
Posted by aaron morton <aa...@thelastpickle.com>.
To change the cluster name:
1) Stop all nodes.
2) Delete or move the LocationInfo sstables from /var/log/cassandra/data/system/LocationInfo
3) Change the cluster_name in cassandra.yaml
4) Restart the nodes.
You cannot do an incremental change of the cluster name. All nodes in the cluster must have the same name.
By only deleting the LocationInfo CF your schema will be preserved. You do not have to move / delete any of the user data.
Hope that helps.
-----------------
Aaron Morton
Freelance Cassandra Developer
New Zealand
@aaronmorton
http://www.thelastpickle.com
On 10/01/2013, at 6:50 AM, Tim Dunphy <bl...@gmail.com> wrote:
> Hello,
>
> I'm attempting to change my cluster name, yet retain my keyspace as it was. I know from what I've read that this requires changing it within the cassandra cli (using system), changing it in the cassandra.yaml file, and deleting the contents of the /var/lib/cassandra/data/system directory. Then restart cassandra.
>
> This does work. I am able to change my cluster name this way. But of course, since I deleted my system information I have lost all reference to my keyspace. My app does not work and a show keyspaces within the cassandra-cli does not show the keyspace. This does make a certain amount of sense to me as I realize that the system kesyspace directory does contain information on the keyspaces within this cassandra node.
>
> So what I did was create a snapshot of my keyspace (joke_fire1) with the command nodetool -h localhost -p 7199 joke_fire1.
>
> I then re-create the keyspace within the cassandra cli and copy just the .*db files back to the keyspace directory. But that doesn't work a describe keyspace does not show my column families and my app doesn't work.
>
> I even tried creating a tar archive of the keyspace directory and then rsyncing the entire contents of the tar archive to the keyspace directory after creating the keyspace with the same name in the casssandra-cli. Still no good.
>
> I was wondering if I could get some advice on how to change my cluster name and yet either retain or restore from backup properly my keyspace as it was before the cluster name change.
>
> I tried following the backup and restore advice from both this guide:
>
> http://jonathanhui.com/cassandra-data-maintenance-backup-and-system-recovery
>
> And this guide:
>
> http://www.datastax.com/docs/1.1/operations/backup_restore
>
> I'm running cassandra 1.1.8.
>
> Thanks
> Tim
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>