The odpscmd client allows you to access MaxCompute projects and features. This topic describes how to install, configure, and run the client.

Prerequisites

  • The odpscmd client is developed based on the Java language. Before installing the odpscmd client, make sure that you have installed Java 8 or later on your machine.
  • Before configuring the odpscmd client, make sure that you have created a project. For more information, see Create a project.

Procedure

Install the odpscmd client
  1. Download the installation package of the odpscmd client of the target version on Github.
  2. Decompress the installation package to obtain the bin, conf, lib, and plugins folders.
Configure the client configuration file
  1. Edit the odps_config.ini file in the conf folder to configure the client. Take the following configuration as an example.
    # Specify the name of the project you want to access.
    project_name=my_project
    # Specify the AccessKey ID and AccessKey secret of your Alibaba Cloud account. To obtain the AccessKey ID and AccessKey secret, log on to the Alibaba Cloud console and go to the AccessKey page. Remove the angle brackets (< >) when entering the AccessKey ID and AccessKey secret.
    access_id=*******************
    access_key=********************* 
    # Specify the endpoint of MaxCompute.
    end_point=https://service.odps.aliyun.com/api 
    # Specify the Logview address that the client returns after a job is run. After accessing the address, you can view detailed operational logs of the job.
    log_view_host=http://logview.odps.aliyun.com 
    # Specify whether to enable HTTPS access.
    https_check=true 
    
    # Specify the maximum size of input data, in GB.
    data_size_confirm=100.0
    # Specify the URL for upgrading of the odpscmd client.
    update_url=http://repo.aliyun.com/odpscmd
    # Specify whether to download SQL running results by instance tunnel.
    use_instance_tunnel=true
    # Specify the maximum number of records in the SQL running results downloaded by instance tunnel.
    instance_tunnel_max_record=10000
    # Specify the endpoint of the tunnel service.  
    tunnel_endpoint=https://dt.odps.aliyun.com # MaxCompute
    • We recommend that you configure end_point and tunnel_endpoint based on the region selected when you create the project. Otherwise, errors such as access failure may be thrown. For more information, see Configure endpoints.
    • If your MaxCompute project is created in the DataWorks console in the standard mode, pay attention to the name difference between the projects in the production environment and the development environment when specifying project_name. The name of a project in the development environment ends with the _dev suffix. For more information, see Simple mode and standard mode.
    • A number sign (#) is used to comment out a line in the odps_config.ini file. Two consecutive minus signs (--) are used to comment out a command line on the odpscmd client.
    • MaxCompute provides you with three types of endpoints: public network endpoint, classic network endpoint, and VPC endpoint. Your download costs are subject to your endpoint. If you have not configured any tunnel endpoint, the tunnel may be automatically routed to the Internet, resulting in download costs.
Run the odpscmd client
  1. Run ./bin/odpscmd in Linux or ./bin/odpscmd.bat in Windows. The odpscmd client runs successfully if the following interface is displayed.

What to do next

For more information about how to use the odpscmd client, see Client.
Note
  • We recommend that you use MaxCompute Studio to process big data. MaxCompute Studio integrates with Java and allows you to develop and run MaxCompute SQL scripts, manage data, analyze logs in a visualized manner, and develop Java code, such as UDFs and MapRedure programs. Currently, the odpscmd client has also been integrated into MaxCompute Studio.
  • You can also access MaxCompute through DataWorks. After creating a workspace in the DataWorks console, click Data Analytics in the Actions column of the workspace on the Workspaces page.
  • For more information about how to add users and grant permissions by using DataWorks, see Add users and roles.