2

We are running MarkLogic 9.0-11 version 3 node cluster and MarkLogic is installed in "/var/opt/MarkLogic/" directory, we have a soft link created of "/var/opt/MarkLogic/Forests" to "/ML-content" directory like below :-

lrwxrwxrwx. 1 daemon daemon     19 May  2  2019 Forests -> /ML-content/Forests

Whenever we created any forest with default data directory(i.e /var/opt/MarkLogic), we see folder is created to "/ML-content" which is fine but when we had to delete the forest or clear the forest we see below issue:-

2020-05-04 14:49:31.963 Alert: XDMP-FORESTERR: Error in clear of forest D2C-data-hub-FINAL-7: SVC-DIRREN: Directory rename error: rename '/var/opt/MarkLogic/Forests/D2C-data-hub-FINAL-7 to /var/opt/MarkLogic/TmpForests/D2C-data-hub-FINAL-7': Invalid cross-device link

Did anybody faced the same issue ? How can we resolve it ? Any suggestions/help

Thanks in advance

SinghVK
  • 313
  • 2
  • 12
  • Just a general comment: rather than creating soft links, it would be best to set the desired path for your forest data directory with the desired path. – Mads Hansen May 05 '20 at 17:51
  • 1
    Agreed. So, if we change the data directory now in `/etc/sysconfig/MarkLogic`, will it affect existing forest data or just the change where new forests are created with new data dir ? Also, I guess the symbolic link should between `/var/opt/MarkLogic -> /ML-content` not `/var/opt/MarkLogic/Forests -> /ML-content/Forests`. Any suggestions. – SinghVK May 06 '20 at 08:06

2 Answers2

2

I believe that you will get those errors when attempting to rename and the source and destination are on different file systems.

Rather than creating a symlink on the /var/opt/MarkLogic/Forests directory, you could create new forests specifying the desired location for the data directory, and attach it to your database.

If you have existing content in the original forests, then you can retire the original forest and ensure that the rebalancer is enabled to allow the content to drain out of the original forest and into the new one(s).

After the documents have rebalanced, you can detach and delete the original forest.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
  • We had implemented this solution and everything is working fine. Thank you for your help with this. – SinghVK Jun 26 '20 at 09:42
1

MarkLogic supports making the data directory, /var/opt/MarkLogic, a symlink, but does not support symbolic links for the sub-directories inside that folder.

This ensures that MarkLogic is able to manage the contents of the directory without interference.

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34