question

aravinth_chakravarthyr_173918 avatar image
aravinth_chakravarthyr_173918 asked ben.krug_85176 commented

Migrating data file directory to a new location

Is there any possibility to migrate my data file directory to a new file system if so please provide steps for it .

I have tried it with my dev server by changing only the datafiledirectory parameter in cassandra.yaml . But encountered this error

DEBUG [main] 2019-10-21 03:56:45,715 YamlConfigurationLoader.java:110 - Loading settings from file:/etc/dse/cassandra/cassandra.yaml

INFO [main] 2019-10-21 03:56:45,720 YamlConfigurationLoader.java:89 - Configuration location: file:/etc/dse/cassandra/cassandra.yaml

ERROR [main] 2019-10-21 03:56:45,725 CassandraDaemon.java:829 - Exception encountered during startup

java.lang.RuntimeException: A node with address /165.137.85.65 already exists, cancelling join. Use cassandra.replace_address if you want to replace this node.

at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:562)

at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:901)

at org.apache.cassandra.service.StorageService.initServer(StorageService.java:673)

at org.apache.cassandra.service.StorageService.initServer(StorageService.java:618)

at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:387)

at com.datastax.bdp.server.DseDaemon.setup(DseDaemon.java:499)

at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:678)

at com.datastax.bdp.DseModule.main(DseModule.java:96)


dse
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ben.krug_85176 avatar image
ben.krug_85176 answered

It sounds like you changed the data directory, but didn't move the existing files into it. So it tries to bootstrap and initialize itself, but sees that there's already a node with its IP address (itself). If you move or copy the contents of the old datafiledirectory to the new one, it should start up.

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

aravinth_chakravarthyr_173918 avatar image
aravinth_chakravarthyr_173918 answered

I will give you the detailed steps i have followed up:

1) stopped the DSE

2)Cretaed a new data directory in new filesystem where i need to migrate my datafiledirectory and moved the data file contents from old directory to new directory (This was just a migration within the same server machine).

3) Changed the datafiledirectory location in cassandra.yaml and restarted the dse

Only after this i was getting the error which i have metioned above .


I have cleared this error as i had got a solution from stackoverflow:

i have included this command in cassandra-env.sh

I have given the same ip address and it restarted up it went perfect .

I know this is not the right way to do

Can you just elaborate me the steps to perform this or share me if any datastax document is there


Thanks in advance

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

aravinth_chakravarthyr_173918 avatar image
aravinth_chakravarthyr_173918 answered

this is the command

JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=ip"
Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

aravinth_chakravarthyr_173918 avatar image
aravinth_chakravarthyr_173918 answered ben.krug_85176 commented

@ben.krug_85176I have mentioned in step 2 that i have moved the files /contents of old datafile directory to new one and only after that i had restarted dse

1 comment Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ben.krug_85176 avatar image ben.krug_85176 commented ·

The error indicates that DSE is not finding the data files. Perhaps data_file_directories is not set correctly somehow. The error means that DSE thinks this is a new node without any data, but it has the IP address of a previously existing node.

0 Likes 0 ·