Shell nodes support standard shell syntax but not interactive syntax.

Background information

To allow a Shell node that is run on the default resource group to access a specified IP address or domain name, you must add the IP address or domain name to the whitelist of the Shell node. For more information, see Configure the security settings. If the Shell node fails to access the IP address or domain name after you add the IP address or domain name to the whitelist, use an exclusive resource group for scheduling to run the Shell node. For more information, see Add and use exclusive resource groups for scheduling.

A Shell node that is run on an exclusive resource group for scheduling may need to access a data store that has a whitelist. In this case, you must add the information about the resource group to the whitelist of the data store. For more information, see Add an exclusive resource group for scheduling to the whitelist of the data store to be accessed.

Procedure

  1. Go to the DataStudio page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region where your workspace resides, find the workspace, and then click Data Analytics in the Actions column.
  2. On the Data Development tab, move the pointer over the Create icon icon and choose Universal > Shell.
    Alternatively, you can click a workflow in the Business process section, right-click General, and then choose New > Shell.
  3. In the New node dialog box, set the Node name and Destination folder parameters.
    Note The node name must be 1 to 128 characters in length and can contain letters, digits, underscores (_), and periods (.). It is not case-sensitive.
  4. Click Submit.
  5. Configure the Shell node.
    1. Write the code of the Shell node in the code editor.
      To use the system scheduling parameters in the Shell node, execute the following statement:
      echo "$1 $2 $3"
      Note Separate multiple parameters with spaces. For more information about the system scheduling parameters, see Scheduling parameters.
    1. Click the Save icon icon in the toolbar to save the SQL statement to the server.
    2. Click the Run icon icon in the toolbar to execute the SQL statement you have saved.
      If you need to change the resource group on which you test the Shell node on the DataStudio page, click the Advanced run (run with parameters) icon icon in the toolbar and select your desired exclusive resource group.
  6. On the node configuration tab, click the Scheduling configuration tab in the right-side navigation pane. On the Scheduling configuration tab, set the scheduling properties for the node. For more information, see Basic properties.
  7. Save and commit the node.
    Notice You must set the Rerun attribute and Dependent upstream node parameters on the Scheduling configuration tab before you can commit the node.
    1. Click Save icon in the toolbar to save the node.
    2. Click Submit icon in the toolbar to commit the node.
    3. In the Submit New Version dialog box, enter your comments in the Change description field.
    4. Click OK.
    In a workspace in standard mode, you must click Publish in the upper-right corner after you commit the AnalyticDB for MySQL node. For more information, see Deploy a node.
  8. Test the node. For more information, see Auto triggered nodes.