In DataWorks, you can create an SSH data source and configure host access information to remotely access a host. An SSH node can then use this data source to remotely access the host and run scripts. For example, you can use this method to remotely access an Elastic Compute Service (ECS) instance from DataWorks and periodically run scripts on the instance. This topic describes how to create an SSH data source.
Limitations
-
You can create an SSH data source only in connection string mode.
-
You can use only an exclusive resource group for scheduling to run SSH tasks. You must submit a ticket to contact technical support for an upgrade. Otherwise, tasks may fail to run.
Usage notes
If you use a standard mode workspace, you must create data sources for the development environment and production environment separately. The data sources for both environments must use the same authentication mode.
-
For more information about workspace modes, see Workspace mode differences.
-
For more information about data source authentication modes, see Authentication modes.
Prerequisites
-
You have obtained the host address and port of the server.
-
You have purchased and configured an exclusive resource group for scheduling.
After you create an SSH data source, you can use only an exclusive resource group for scheduling to develop and schedule computing tasks. You must prepare a resource group in advance and ensure network connectivity between the data source and the resource group. For more information, see Use an exclusive resource group for scheduling and Network connectivity solutions.
Permissions
To create a data source as a RAM user or by using a RAM role, the user or role must have one of the following permissions:
-
The RAM user or RAM role has the Project Owner, Workspace Administrator, or O&M role. For more information about how to grant roles, see Add workspace members and manage their roles.
-
The RAM user or RAM role has the AliyunDataWorksFullAccess or AdministratorAccess policy attached. For more information, see Grant permissions to a RAM user and Grant permissions to a RAM role.
Access the Data Source page
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Management Center.
On the Workspace Management page, click Data Sources in the left-side navigation pane to open the data source page.
-
Click Add Data Source and then select SSH.
Create a data source
On the Create SSH Data Source page, configure the basic information for the data source and test the network connectivity.
-
Configure basic information.
NoteIf you use a standard mode workspace, you must create data sources for the development environment and production environment separately. The data sources for both environments must use the same authentication mode.
-
For more information about workspace modes, see Workspace mode differences.
-
For more information about data source authentication modes, see Authentication modes.
Key parameters:
-
Configuration Mode: You can create an SSH data source only in User-created Data Store with Public IP Addresses.
-
Authentication Mode:
Host password authentication
Parameter
Description
Host Address
The host address of the SSH server.
Host Port
The port number of the SSH server.
Username
The username used to log on to the SSH server.
Password
The password for the specified username.
Host SSH key authentication
Parameter
Description
Host Address
The host address of the SSH server.
Host Port
The port number of the SSH server.
Username
The username used to log on to the SSH server.
Private key
The private key used to log on to the SSH server. You must upload the key as a required authentication file. For details about how to manage authentication files, see Manage third-party authentication files.
Private Key Passphrase
If the private key file is encrypted, enter its passphrase.
(Recommended) DataWorks SSH public key
DataWorks generates a key pair based on the SSH data source and provides you with the public key. Adding this key to your server establishes a connection between DataWorks and the SSH server. This authentication method is more secure.
Parameter
Description
Host Address
The host address of the SSH server.
Host Port
The port number of the SSH server.
Username
The username used to log on to the SSH server.
Public Key
Click Generate Key Pair. The platform generates a public key. Before you test the connection, add the public key to the
.ssh/authorized_keysfile on the host.Note-
The generated key pair takes effect after the data source is created. Add the public key to your host promptly.
-
When you edit the data source, a new public key is generated each time you click Generate Key Pair. After you save the configuration, the original public key becomes invalid. This action may cause running tasks to fail. Perform this action with caution.
-
-
Test the resource group connectivity.
In the Connection Configuration section, test the connection from the exclusive resource group for scheduling to the data source. If the resource group cannot connect to the data source, tasks that use this data source cannot run. Ensure that the resource group can access your host. For more information about network connectivity solutions, see Network connectivity solutions.
Note-
You can use only an exclusive resource group for scheduling to run SSH tasks. You must submit a ticket to contact technical support for an upgrade. Otherwise, tasks may fail to run.
-
If the connection fails, add the IP address of the resource group to the inbound rules of the security group for the server instance and try again.
-
Next steps
After you create the data source, you can perform the following operations:
-
Develop and schedule computing tasks:
DataStudio and Operation Center in DataWorks allow you to develop and schedule SSH tasks. You can specify an SSH data source in an SSH node to remotely connect to the host configured for the data source. You can then publish the SSH node to the production environment to periodically run the node's code. These development and publishing operations are performed in DataStudio.
-
Manage the data source: Go to the Data Source page in SettingCenter to edit or delete the data source.
Related documents
To learn about implementing load balancing and high availability for SSH nodes, see Implement load balancing and high availability for SSH nodes.