Establishing a Connection
The objects available within our connector are accessible from the "cdata.hdfs" module. To use the module's objects directly:
- Import the module as follows:
import cdata.hdfs as mod
- To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
mod.connect("Host=sandbox-hdp.hortonworks.com;Port=50070;Path=/user/root;")
Connecting to HDFS
In order to connect, set the following connection properties:
- Host: Set this value to the host of your HDFS installation.
- Port: Set this value to the port of your HDFS installation. Default port: 50070
- UseSSL: (Optional) Set this value to 'True', to negotiate TLS/SSL connections to the HDFS server. Default: 'False'.
Authenticating to HDFS
There are two authentication methods available for connecting to the HDFS data source, Anonymous Authentication and Negotiate (Kerberos) Authentication.
Anonymous Authentication
In some situations, HDFS may be connected to without any authentication connection properties. To do so, set the AuthScheme to None (default).
Kerberos
When authentication credentials are required, you can use Kerberos. See Using Kerberos for details on how to authenticate with Kerberos.