tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary

Mounting CFS File System

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2024-12-02 20:11:42

Overview

Tencent Cloud File Storage (CFS) provides a scalable shared file storage service that can be used with various Tencent Cloud services such as CVM, TKE, and batch operations. The standard NFS file system access protocol used by CFS offers shared data sources for multiple computing nodes. It supports elastic capacity and performance scaling. Your existing applications can be mounted for use without modification required. As a highly available and reliable distributed file system, CFS is suitable for various scenarios such as big data analysis, media processing, and content management. CFS is very cost-effective and pay-as-you-go on an hourly basis, so you only need to pay for the actually used storage space. For more information on CFS billing, see Billing Overview.
Tencent Cloud SCF can be seamlessly integrated with CFS. After proper configuration, your functions can easily access files stored in CFS. You can enjoy the following advantages of CFS:
The execution space of functions is unlimited.
Multiple functions can share the same file system to share files.

Directions

Associating authorization policy

Note:
To use the CFS service, SCF needs permission to operate on your CFS resources.
Follow the steps below to grant the permission to your account:
1. Associate the SCF_QcsRole role with the QcloudCFSReadOnlyAccess policy as instructed in Modifying a Role. The result of a successful association is shown below: If you don't perform this operation for your currently used account, problems such as the failure to save functions and the unavailability of CFS features may occur.

2. If the currently used account is a sub-account, request the root account to associate the sub-account with the QcloudCFSReadOnlyAccess policy as instructed in Setting Sub-user Permissions. The result of a successful association is shown below: If you don't perform this operation for your currently used sub-account, problems such as the unavailability of CFS features may occur.


Creating a VPC

Build a VPC as instructed in Building Up an IPv4 VPC.

Creating CFS resources

Create a CFS file system as instructed in Creating File Systems and Mount Targets.
Note:
Currently, SCF allows only CFS file systems whose network type is VPC to be added as mount targets. When creating a CFS file system, select the same VPC as that of the target function to enable communication.

Mounting and using CFS file system

1. Log in to the SCF console and select Function Service on the left sidebar.
2. On the Function Service page, select the name of the function to be configured.
3. On the Function configuration tab of the Function management page, click Edit in the top-right corner.
4. Check Enable for VPC, and select the VPC where your CFS file system resides, as shown below:

5. Check Enable for File System, and enter the following information to mount the file system, as shown below:

User ID and User group ID: IDs of the user and user group in CFS file system. SCF uses "10000" for both the user ID and user group ID by default to manipulate your CFS file system. Set the file owner and corresponding group permission as needed and ensure that your CFS file system has the required permission. A simple example is to run the chown 10000:10000 -R /mnt/folder command. For more information, see Managing Permissions.
Remote directory: The remote directory in the CFS file system to be accessed by the function, which consists of a file system and a remote directory.
Local Directory: Mount target of the local file system. You can use a subdirectory in the /mnt/ directory to mount the CFS file system.
File System ID: Select the file system to be mounted in the drop-down list.
Mount Target ID: Select the ID of the mount target corresponding to the file system in the drop-down list.
6. Click Save at the bottom of the page. You can run the following function code to start using the CFS file system.
'use strict';
var fs = require('fs');
exports.main_handler = async (event, context) => {
await fs.promises.writeFile('/mnt/myfolder/filel.txt', JSON.stringify(event));
return event;
};

Performance test for using the CFS file system on SCF

You can use this Demo to test how well CFS performs on SCF.

Ajuda e Suporte

Esta página foi útil?

comentários