Reputation: 2309
At the moment, I am using a Cassandra database on a Windows 7 system. We'd like to use Cassandra on Linux now and wonder if it's possible to migrate the data with a simple copy of the data directory from Windows to Linux?
Can someone tell me if that's possible, meaning if the Windows data structure on the file system and Linux file structure are compatible?
If not, what'ts the best way to migrate a keyspace or the whole database from Windows to Linux?
Upvotes: 1
Views: 201
Reputation: 16400
The storage format does not change between windows and linux, in theory copying the sstables over should work but not testing it would be a tragic mistake as I don't know if anyone has ever done it before. Test it out throughly! but it should work as far as I know. (ensure that token ranges match up or you will lose data)
Couple other options:
Just replace windows hosts with linux ones, one at a time (or if wanna be aggressive 1 per replicas). Then let bootstrapping process manage it.
If you want you can add a new DC with linux nodes, increase replication to include it in it (make sure app is using LOCAL_QUORUM not QUORUM and set to your Windows DC as local) then switch app to use other DC after repair, but beware of potential consistency issues during the switch. To avoid issues with consistencies at cost of a bit more complexity, do writes at EACH_QUORUM and dont do switch until youve completed a repair cycle to cover all things written to just the one DC. then switch, then remove the Windows DC and decomission.
Upvotes: 3