For convenience, the following environment variables are available in the operation post_configure_source and add_source of the script component:
- SOURCE_NODE: name of the source node in the relationship (e.g.,
- TARGET_NODE: name of the target node in the relationship (e.g.,
- SOURCE_HOST: name of the compute node which hosts the source node (e.g.,
- TARGET_HOST: name of the compute node which hosts the target node (e.g.,
- SOURCE_IP and TARGET_IP: the runtime IP address of the compute nodes, which host the source and target components, respectively.
- All properties of the components are also available. They are prefixed by
TARGET_(e.g., SOURCE_PORT, TARGET_PORT, etc.).
- Set the
- Add an entry in the
envproperty with key
In post_configure_source of
Bash_1, we can access the environment variables of
# Bash_2 is running on Compute_2 on port 27017
echo "$TARGET_NODE is running on $TARGET_HOST on port $TARGET_PORT"
# Bash_2 has environment variable FOO with value: bar
echo "$TARGET_NODE has environment variable FOO with value: $TARGET_FOO"