We have 4 replicas with 03 replica in read only mode with manual failover.
We have some drive issues and we need to rearrange the MDF and LDF files.
On the primary we have 2 drives I
and J
. The I
drive houses the MDF/ndf and LDF files. On the J
drive are the tempdb files.
In all other 03 replicas we have only I drive with all MDF/ndf/ldf and Temmpdb files.
Currently the setup is working without any issues.
In our primary replica the drive space is running low with 10% left. Can we move the ldf file to the J
drive which is 80% free?
Please note that in all 03 read replicas we do not have a J
drive.
Best Answer
In theory, you can use different disks. (Unless you are using direct seeding to seed the databases to the secondaries).
However, I would prefer to have the same disks and disk throughput for transparency and reducing the probability of
I/O
issues when a secondary becomes primary, among other considerations such as adding data files to your database.a quick test:
On primary, create a database on two disks
Restore on secondary on one disk
Add primary to ag (execute on primary)
Add secondary to ag (execute on secondary)
Validate the databases on all replicas
Change the data file on the primary
Add the secondary to the AG again
Validate the databases on all replicas
Changing the secondary to reside on completely different disks
On the primary
On the secondary
On the primary
On the secondary
Extra considerations
If you where to add extra files to the database on a disk that does not exist on the secondary, you will get an error:
This attempts to create an extra database file on all replica's, expecting the disk to exist.