This topic describes how to configure the ID of an Alibaba Cloud account (account ID) as a user identifier for a server.

Prerequisites

  • Available server already exists.

    The server from which Logtail collects logs can be an ECS instance that is purchased by another Alibaba Cloud account, or be provided by third-party cloud service vendors. The server can also be a local IDC.

  • Logtail is installed on the server. For more information, see Install Logtail in Linux and Install Logtail in Windows.

Background information

If Logtail is installed on an ECS instance that is purchased by another Alibaba Cloud account, you must use the account ID as a user identifier. If Logtail is installed on the server that is provided by third-party cloud service vendor, or is a local IDC, you must also perform the preceding operation. If you do not configure an account ID for a server, Logtail cannot collect logs from the server, and no heartbeat packet is received from the server.

Obtain the account ID

  1. Log on to the Log Service console.
  2. In the upper-right corner of the page, click the icon to enter the CloudShell window.
  3. Run the following command to obtain the account ID:
    echo $ALIBABA_CLOUD_ACCOUNT_ID
    Obtain the account ID

Configure an account ID for a server

  1. Log on to the server.
  2. Configure an account ID for a server.
    • Linux:
      In the /etc/ilogtail/users directory, create a file and use the account ID as the filename.
      touch /etc/ilogtail/users/1*************
      touch /etc/ilogtail/users/1*************
    • Windows:

      In the C:\LogtailData\users directory, create a file and use the account ID as the filename. For example, you can set the filename to C:\LogtailData\users\1**************.

    Note
    • If the /etc/ilogtail/users directory does not exist, you can manually create one.
    • You can configure multiple account IDs for the same server.
    • After you configure or delete an account ID, the operation takes effect within 1 minute.
    • If you no longer need to collect logs from the server, delete the account ID file from the server.

Delete an account ID

  • Linux:
    Run the following command to delete the specific account ID file and associated account ID:
    rm /etc/ilogtail/users/1**************
  • Windows:

    After an account ID file is deleted, the corresponding account ID of the server is deleted. For example, you can delete the C:\LogtailData\users\1************** file.

What to do next

After you configure an account ID for a server as user identifier, you can create a machine group.