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

Prerequisites

  • A server is available.

    The server can be an Elastic Compute Service (ECS) instance that belongs to a different Alibaba Cloud account from Log Service, a server from a third-party cloud service provider, or an on-premises server.

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

Background information

If your server is an ECS instance that belongs to a different Alibaba Cloud account from Log Service, a server from a third-party cloud service provider, or an on-premises server, you must specify the ID of your Alibaba Cloud account as a user identifier for your server after Logtail is installed on your server. This way, Logtail is authorized to collect logs from your server. If you do not configure a user identifier for your server, Log Service cannot receive the heartbeat of the server, and Logtail cannot collect logs from the server.

Obtain the ID of an Alibaba Cloud account

  1. Open Cloud Shell.
  2. Run the following command to obtain the ID of your Alibaba Cloud account:
    echo $ALIBABA_CLOUD_ACCOUNT_ID
    Obtain the ID of your Alibaba Cloud account

Configure a user identifier

  1. Log on to the server.
  2. Specify the ID of your Alibaba Cloud account as a user identifier on the server.
    • Linux:
      In the /etc/ilogtail/users directory, create a user identifier file and use the ID of your Alibaba Cloud account as the file name.
      touch /etc/ilogtail/users/1*************
      touch /etc/ilogtail/users/1*************
    • Windows:

      In the C:\LogtailData\users directory, create a user identifier file and use the ID of your Alibaba Cloud account as the file name. For example, you can set the file name to C:\LogtailData\users\1**************.

    Note
    • If the /etc/ilogtail/users directory does not exist, you must create the directory.
    • The IDs of multiple Alibaba Cloud accounts can be configured on the same server.
    • After you configure or delete a user identifier, the change takes effect within 1 minute.
    • We recommend that you delete user identifier files that you no longer need from a server at the earliest opportunity.

Delete a user identifier

  • Linux:
    Run the following command to delete the specified user identifier file. Then, the user identifier is deleted.
    rm /etc/ilogtail/users/1**************
  • Windows:

    Delete the user identifier file from the server. Then, the user identifier is deleted. For example, you can delete the C:\LogtailData\users\1************** file.

What to do next

After you configure the ID of your Alibaba Cloud account as a user identifier for a server, you can create a machine group. For more information, see Create an IP address-based machine group or Create a custom ID-based machine group.