10. Using Alternate Locations : Create an Alternate HDFS Location
 
Share this page                  
Create an Alternate HDFS Location
When you create a database, the default locations are assumed unless you specify alternate locations.
To create an alternate location for a new database
1. Create the area (directory structure) where the files will be stored by using HDFS system commands.
$ hdfs dfs ‑mkdir /Actian/new_area
$ hdfs dfs ‑chown /Actian/new_area
The area "/Actian/new_area" is created on the HDFS file system, which you can specify as the Area when defining a new location using the CREATE LOCATION statement.
2. Map the area created in Step 1 to a location by using the CREATE LOCATION statement.
For example: Connect to the database and type this statement to create a location "myloc1" in the area "\hdfs://mynamenode:9000/Actian/new_area" for database file usage.
CREATE LOCATION myloc1 WITH AREA = 'hdfs://mynamenode:9000/Actian/new_area', USAGE = (DATABASE);