This section describes how to use Loader to export data from Spark to an SFTP server.
Setting Basic Job Information
Parameter |
Description |
Example Value |
---|---|---|
Name |
Specifies the name of the SFTP server connection. |
sftpName |
SFTP server IP |
Specifies the IP address of the SFTP server. |
10.16.0.1 |
SFTP server port |
Specifies the port number of the SFTP server. |
22 |
SFTP username |
Specifies the user name for accessing the SFTP server. |
root |
SFTP password |
Specifies the password for accessing the SFTP server. |
xxxx |
SFTP public key |
Specifies public key of the SFTP server. |
OdDt/yn...etM |
When multiple SFTP servers are configured, the data of Spark tables will be divided into multiple parts and saved to the SFTP servers randomly.
Setting Data Source Information
Parameter |
Description |
Example Value |
---|---|---|
Spark instance |
Specifies the Spark service instance that Loader selects from all available Spark service instances in the cluster. If the selected Spark service instance is not added to the cluster, the Spark job cannot be run properly. |
spark |
Quantity |
Specifies the number of maps that are started at the same time in a MapReduce job of a data configuration operation. The value must be less than or equal to 3000. You are advised to set the parameter to the maximum number of connections on the SFTP server. |
20 |
Setting Data Transformation
Input Type |
Export Type |
---|---|
Spark Input |
File output |
Setting Data Storage Information and Executing the Job
Parameter |
Description |
Example Value |
---|---|---|
Output path |
Specifies the path or file name of the exported file on an SFTP server. If multiple SFTP server IP addresses are configured for the connector, you can set this parameter to multiple paths or file names separated with semicolons (;). Ensure that the number of paths or file names is the same as the number of SFTP servers configured for the connector. NOTE:
You can use macros to define path parameters. For details, see Using Macro Definitions in Configuration Items. |
/opt/tempfile |
Operation |
Specifies the action during data import. When all data is to be imported from the input path to the destination path, the data is stored in a temporary directory and then copied from the temporary directory to the destination path. After the data is imported successfully, the data is deleted from the temporary directory. One of the following actions can be taken when duplicate file names exist during data transfer:
|
OVERRIDE |
Encode type |
Specifies the exported file encoding format, for example, UTF-8. This parameter can be set only in text file export. |
UTF-8 |
Compression |
Indicates whether to enable the compressed transmission function when SFTP is used to export data.
|
true |
Checking the Job Execution Result