Creating a Parallel File System
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference
You can use ObsClient.createBucket to create a parallel file system.
The following code shows how to create a parallel file system:
String endPoint = "https://your-endpoint";
String ak = "*** Provide your Access Key ***";
String sk = "*** Provide your Secret Key ***";
// Create an instance of ObsClient.
ObsClient obsClient = new ObsClient(ak, sk, endPoint);
// Create a parallel file system.
try{
// The parallel file system is successfully created.
CreateBucketRequest request = new CreateBucketRequest();
request.setBucketName("bucketname");
request.setBucketType(BucketTypeEnum.PFS);
// Specify the region.
request.setLocation("cn-north-1");
HeaderResponse response = obsClient.createBucket(request);
System.out.println(response.getRequestId());
}
catch (ObsException e)
{
// Failed to create a parallel file system.
System.out.println("HTTP Code: " + e.getResponseCode());
System.out.println("Error Code:" + e.getErrorCode());
System.out.println("Error Message: " + e.getErrorMessage());
System.out.println("Request ID:" + e.getErrorRequestId());
System.out.println("Host ID:" + e.getErrorHostId());
}
- The name of a parallel file system is globally unique. Therefore, you must ensure that the name is different from the name of an existing parallel file system or object bucket.
- The naming rules are as follows:
- Contains 3 to 63 characters, including lowercase letters, digits, hyphens (-), and periods (.), and starts with a digit or letter.
- Cannot be an IP address or similar.
- Cannot start or end with a hyphen (-) or period (.).
- Cannot contain two consecutive periods (.), for example, my..pfs.
- Cannot contain periods (.) and hyphens (-) adjacent to each other, for example, my-.pfs or my.-pfs.
- If a user creates parallel file systems with the same name in one region for multiple times, no error is reported. The attributes of the created parallel file system are subject to the first request.
- The parallel file system created in the example is of the default ACL (private), in the OBS Standard storage class, and in the default location where the global domain resides (cn-north-1). If you need to specify another region, look into Regions and Endpoints for reference.
- During parallel file system creation, if the endpoint you use corresponds to the default region CN North-Beijing1 (cn-north-1), specifying a region is not a must. If the endpoint you use corresponds to any other region, except the default region, you must set the region to the one that the used endpoint corresponds to.
- You can create a parallel file system with parameters specified by referring to Creating a Bucket with Parameters Specified. When creating a parallel file system, you can specify its region.
- To create a parallel file system, you must set bucketType in CreateBucketRequest to BucketTypeEnum.PFS.
Last Article: Parallel File System Management
Next Article: Listing Parallel File Systems
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.