Network File Systems#
Setting Package Manager to use a network file system (NFS) for storage requires deciding between using a local SQLite
instance or switching to an external PostgreSQL
database. We'll look at how to configure Package Manager in both of these scenarios.
Configuration#
The first step for using an NFS mount is to change the data directory:
The Package Manager service user must have permissions to read, write, and create directories in this directory.
If you do not wish to switch to a PostgreSQL
database, the SQLite
storage location must also be on the local disk. This configuration should look like this:
[Server]
DataDir = /mnt/rstudio-pm
[SQLite]
Dir = /var/lib/rstudio-pm/db
Warning
A SQLite
database moved to an NFS mount will become corrupt. Therefore, we recommend clearing your installation and restarting if this occurs. For more information, see the documentation on using SQLite
as a database.
Amazon EFS#
Amazon Elastic File System (EFS) can be used as a shared file system, subject to the following limitations:
- You may experience performance issues when compared to a file system mounted on Amazon Elastic Block Store (EBS).
- Use the
lookupcache=pos
mount option to prevent long service delays from attribute caching. See the High Availability NFS section for more information. - The locking mechanism in SQLite does not work correctly if the database file is kept on an NFS file system, and this could lead to data corruption. If using SQLite, ensure the
SQLite.Dir
option is set a local volume. - Incorrect configurations can significantly worsen performance, so review the Posit Team integration with EFS guide before starting configuration.
Azure Files#
Azure Files can be used as a shared file system, with the following recommendations and limitations:
- Azure Files file shares must use the NFS protocol. Package Manager does not support file shares using the SMB protocol.
- Use the Azure Premium file shares instead of Standard file shares for higher performance and lower disk latency.
- Use the recommended mount options for NFS Azure file shares and recommended
nconnect
option for NFS Azure file shares, such asnconnect=4
,noresvport
, andactimeo=30
. - Use the
lookupcache=pos
mount option to prevent long service delays from attribute caching. See the High Availability NFS section for more information. - The locking mechanism in SQLite does not work correctly if the database file is kept on an NFS file system, and this could lead to data corruption. If using SQLite, ensure the
SQLite.Dir
option is set a local volume.