Prerequisites
Registering with HUAWEI CLOUD
An account registered with HUAWEI CLOUD can access all services provided by HUAWEI CLOUD, including DLI.
- Log in to the HUAWEI CLOUD homepage.
- Click Register at the upper right corner of the page.
- Complete the registration as instructed. For details, see Registering a HUAWEI ID and Enabling HUAWEI CLOUD Services.
After the registration succeeds, the system automatically switches to your personal information page. You can refer to Real-Name Authentication for details.
If you have registered a HUAWEI CLOUD account and completed real-name authentication, skip this step.
Enabling DLI
- Log in to the public cloud and choose Products from the top menu.
- Click Data Lake Insight under Enterprise Intelligence.
- Click Access Console to switch to the DLI management console.
Downloading SDK
- Log in to the DLI management console.
- On the Overview page, click SDK Download under Helpful Links.
- On the displayed DLI SDK DOWNLOAD page, click the target link to obtain the desired SDK installation package.
Currently, DLI provides the SDK installation packages of the Java and Python versions.
- Java SDK
Obtain the dli-sdk-java-x.x.x.zip package and decompress it. The following table shows the directory structure of the package.
Table 1 Directory structure Parameter
Description
jars
SDK and its dependent JAR packages.
maven-install
Script and JAR package that are installed in the local Maven repository.
dli-sdk-java.version
Java SDK version description.
If Maven is used, add the following Maven configuration items on which huaweicloud-dli-sdk-java depends:1 2 3 4 5
<dependency> <groupId>com.huawei.dli</groupId> <artifactId>huaweicloud-dli-sdk-java</artifactId> <version>x.x.x</version> </dependency>
DLI depends on the SDK (for example, OBS SDK). You can download it by configuring the Maven image source repository of HUAWEI CLOUD.- Use the Huawei image source as the main repository:
For details about how to configure the Huawei Maven image source, visit Huawei open source image site, select Huawei SDK, and click HuaweiCloud SDK.
If you build a project with Maven, modify the settings.xml file by adding the following content:
- Add the following content to the profiles node:
<profile> <id>MyProfile</id> <repositories> <repository> <id>HuaweiCloudSDK</id> <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>HuaweiCloudSDK</id> <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> - Add the following information to the mirrors node:
<mirror> <id>huaweicloud</id> <mirrorOf>*,!HuaweiCloudSDK</mirrorOf> <url>https://repo.huaweicloud.com/repository/maven/</url> </mirror> - Add the activeProfiles tag to activate the configurations.
<activeProfiles> <activeProfile>MyProfile</activeProfile> </activeProfiles>
- Add the following content to the profiles node:
- Use a non-Huawei image source as the main repository (for example, a user-defined image source) to use HuaweiCloud SDK:
If you build a project with Maven, modify the settings.xml file as follows:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <servers> <server> <id>demo-releases</id> <username>deployment</username> <password><![CDATA[xxx]]></password> </server> </servers> <mirrors> <mirror> <id>demo-releases</id> <mirrorOf>*,!HuaweiCloudSDK</mirrorOf> <url>http://maven.demo.com:8082/demo/content/groups/public</url> </mirror> </mirrors> <profiles> <profile> <id>demo</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> <repositories> <repository> <id>demo-releases</id> <url>http://demo-releases</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>demo-releases</id> <url>http://demo-releases</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> <profile> <id>huaweicloudrepo</id> <repositories> <repository> <id>HuaweiCloudSDK</id> <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>HuaweiCloudSDK</id> <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>demo</activeProfile> <activeProfile>huaweicloudrepo</activeProfile> </activeProfiles> </settings>
- Use the Huawei image source as the main repository:
- Python SDK
Obtain the dli-sdk-python-x.x.x.zip package and decompress it. The following table shows the directory structure of the package.
Table 2 Directory structure Parameter
Description
dli
DLI Python SDK package.
examples
Example of using the SDK.
pyDLI
Connector for Python to connect to DLI SQL, which is implemented based on pyHive.
setup.py
SDK installation script.
- Java SDK
Last Article: Preparing the Environment
Next Article: Configuring the Java Environment
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.