Skip to content

CREATE EXTERNAL MOUNT

Create an NFS mount for use with external tables.

CREATE EXTERNAL MOUNT [ IF NOT EXISTS ] 'reference_name' 
AS 'fully_qualified_nfs_path'
[ WITH ( option value [, ...] ) ]
READONLY | WRITEONLY

You must be a superuser to run this command.

The following options are supported in the WITH clause:

  • GID <gid>: Group ID to use when mounting and interacting with the NFS volume
  • UID <uid>: User ID to use when mounting and interacting with the NFS volume

By default, the command runs a verification check that the NFS volume allows both read and write access. If you want to limit this check to verifying read-only access or write-only access, specify READONLY or WRITEONLY at the end of the command (not as a WITH option).

Read-only access to a mount will work for SELECT FROM EXTERNAL (ybload) operations; external table files can be selected from in queries. Write-only access to a mount will work for CREATE EXTERNAL TABLE (ybunload) operations; external table files can be written and listed.

The command will either complete successfully or return an "Insufficient permissions" error.

Note: Make sure that you have an external mount available that allows external table log files to be written to it. If you are using a read-only mount for running external table queries, you still need to be able to write the ybload logs for those queries to a writable mount directory. You can use the logdir option in the CREATE EXTERNAL TABLE command or the SELECT FROM EXTERNAL command to specify a writable mount directory.

Examples

Create a new external mount and verify that it is available for reads and writes:

premdb=# create external mount '/qumulo/ext_db/' as 
'nfs://qumulo:/data/bobrum/ext_db/' 
with (gid 1234, uid 4567);

Drop this mount and re-create it, but this time verify only that the mount is available for writes:

premdb=# drop external mount '/qumulo/ext_db/';
DROP EXTERNAL MOUNT
premdb=# create external mount '/qumulo/ext_db/' as 
'nfs://qumulo:/data/bobrum/ext_db/' 
with (gid 1234, uid 4567)
writeonly;