Re: Reduce num_tokens on single node cluster
On Fri, Jul 30, 2021 at 7:21 PM Bowen Song wrote: > Since you have only one node, sstableloader is unnecessary. Copy/move the > the data directory back to the right place and restart Cassandra or run > 'nodetool > refresh' is sufficient. Do not restore the 'system' keyspace, but do > restore the other system keyspaces, such as 'system_auth' and ' > system_schema'. > > In fact, it comes to my mind that the following is much quicker, simpler > and should do the trick anyway: > > 1. shutdown Cassandra > > 2. backup /var/lib/cassandra (just in case...) > > 3. run 'rm -rf > /var/lib/cassandra/data/system/local-7ad54392bcdd35a684174e047860b377' > > 4. change num_tokens > > 5. start Cassandra > > > Thanks Bowen, I used simple procedure, everything worked well, data is there. Regards, Maxim.
Re: Reduce num_tokens on single node cluster
Since you have only one node, sstableloader is unnecessary. Copy/move the the data directory back to the right place and restart Cassandra or run 'nodetool refresh' is sufficient. Do not restore the 'system' keyspace, but do restore the other system keyspaces, such as 'system_auth' and 'system_schema'. In fact, it comes to my mind that the following is much quicker, simpler and should do the trick anyway: 1. shutdown Cassandra 2. backup /var/lib/cassandra (just in case...) 3. run 'rm -rf /var/lib/cassandra/data/system/local-7ad54392bcdd35a684174e047860b377' 4. change num_tokens 5. start Cassandra On 30/07/2021 17:00, Maxim Parkachov wrote: Thanks for quick answer. Do you ever intend to add nodes to this single node cluster? If not, I don't see the number of tokens matter at all. I understand that, I would like to have all environments with the same settings. However, if you really want to change it and don't mind downtime, you can do this: 1. make a backup of the data 2. completely destroy the node with all data in it 3. create a new node on the same server with the desired num_tokens 4. restore the backup With 'restore the backup' you mean SSTableLoader ? Regards, Maxim.
Re: Reduce num_tokens on single node cluster
Thanks for quick answer. > Do you ever intend to add nodes to this single node cluster? If not, I > don't see the number of tokens matter at all. > I understand that, I would like to have all environments with the same settings. > However, if you really want to change it and don't mind downtime, you can > do this: > > 1. make a backup of the data > > 2. completely destroy the node with all data in it > > 3. create a new node on the same server with the desired num_tokens > > 4. restore the backup > > With 'restore the backup' you mean SSTableLoader ? Regards, Maxim. >
Re: Reduce num_tokens on single node cluster
Do you ever intend to add nodes to this single node cluster? If not, I don't see the number of tokens matter at all. However, if you really want to change it and don't mind downtime, you can do this: 1. make a backup of the data 2. completely destroy the node with all data in it 3. create a new node on the same server with the desired num_tokens 4. restore the backup On 30/07/2021 13:23, Maxim Parkachov wrote: Hi everyone, I have several development servers with 1 node and num_tokens 256. As preparation for testing 4.0 I would like to change num_tokens to 16. Unfortunately I could not add any additional nodes or additional DC, but I'm fine with downtime. The important part, data should be preserved. What options do I have? Thanks in advance, Maxim
Re: Reduce num_tokens on single node cluster
Single node does not make any sense in Cassandra. It should not make any difference with a single node with whatever number of tokens you start with. You can change your tokens on the test server and see what happens. On Fri, Jul 30, 2021 at 5:53 PM Maxim Parkachov wrote: > Hi everyone, > > I have several development servers with 1 node and num_tokens 256. As > preparation for testing 4.0 I would like to change num_tokens to 16. > Unfortunately I could not add any additional nodes or additional DC, but > I'm fine with downtime. The important part, data should be preserved. > > What options do I have? > > Thanks in advance, > Maxim. >
Reduce num_tokens on single node cluster
Hi everyone, I have several development servers with 1 node and num_tokens 256. As preparation for testing 4.0 I would like to change num_tokens to 16. Unfortunately I could not add any additional nodes or additional DC, but I'm fine with downtime. The important part, data should be preserved. What options do I have? Thanks in advance, Maxim.