Studio Visual Editor
-
Click the Global Elements tab at the base of the canvas, then click Create.
-
In the Choose Global Type wizard, use the filter to locate and select HDFS, then click OK.
-
Configure the parameters according to the table below.
Parameter Description Name
Enter a name for the configuration to reference later.
NameNode URI
Enter the host name or IP address of the master node of the Hadoop cluster.
Username
Enter a Hadoop File System username.
Configuration Resources
If you want to override the configuration resources of the Hadoop instance, select a suitable option from here.
Configuration Entries
If you want to override the configuration entries of the Hadoop instance, select a suitable option from here.
-
Access the Pooling Profile tab to configure any settings relevant to managing multiple connections using a connection pool.
-
Access the Reconnection tab to configure any settings relevant to reconnection strategies that Mule should execute if it loses its connection to HDFS.
-
Click Test Connection to receive a Connection Successful message.
-
Click OK to save the global connector configurations.
-
Return to the Message Flow tab in Studio.
XML Editor
First, ensure that you have included the HDFS namespaces in your configuration file.
<mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:hdfs="http://www.mulesoft.org/schema/mule/hdfs"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.mulesoft.org/schema/mule/core"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/hdfs http://www.mulesoft.org/schema/mule/hdfs/current/mule-hdfs.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd">
Follow these steps to configure a HDFS connector in your application:
-
Create a global HDFS configuration outside and above your flows, using the following global configuration code.
<!-- Simple configuration --> <hdfs:config nameNodeUri="${mule.HDFS.nameNodeUri}" username="${mule.HDFS.username}"/>
Parameter | Description |
---|---|
Name |
Enter a name for the configuration with which it can be referenced later by config-ref. The name in this example is |
nameNode Uri |
Enter the host name or IP address of the master node of the Hadoop cluster. |
username |
Enter the Hadoop FileSystem username. |