Welcome to DIS Agent
DIS Agent is a client-side program provided by the DIS to collect text logs and upload them securely to the DIS.
To get started using dis agent, you will need those things:
- JRE 1.8 +
Install DIS Agent
- Using Xshell, log in to the Linux server on which the DIS Agent will be installed.
- Upload the DIS Agent package dis-agent-1.2.0.zip to any directory, and use unzip to decompress
unzip dis-agent-1.2.0.zip cd dis-agent-1.2.0
Configuring DIS Agent
- Run the following command to open the DIS Agent configuration file agent.yml. Modify parameters in the file according to actual needs.
- Parameters in the agent.yml file
|region||Region in which the DIS is located. Currently, only the cnnorth-1 region is available for selection.||cn-north-1|
|ak||User's plaintext AK. The My Credential page provides you the option to download your AK/SK file.||-|
|sk||User's plaintext SK. The My Credential page provides you the option to download your AK/SK file.||-|
|projectId||Project ID specific to your region. The My Credential page displays all ProjectIDs.||-|
|endpoint||DIS gateway address in the format of https://IPaddress:port number.||https://dis.cn-north-1.myhuaweicloud.com|
|DISStream||Name of the DIS stream to which files whose names match filePattern will be uploaded.||-|
|filePattern||Name of the files to be uploaded. Currently, files to be uploaded are searched only by file name.||-|
|initialPosition||Monitoring start position. Values:
|maxBufferAgeMillis||The maximum number of milliseconds that must elapse before files can be uploaded to the specified DIS stream. l If the buffer is full with files waiting to be uploaded, files will be immediately uploaded to the specified DIS stream. l If the buffer is not full, files will be uploaded to the specified DIS stream after the specified number of milliseconds elapses||5000|
Agent configuration Example
--- # cloud region id region: cn-north-1 # you ak (get from 'My Credential') ak: LPEGNKTEDROMCE22H97Y # you sk (get from 'My Credential') sk: qJXUUrj8hK0dsK1HWE4KmcImMirQEvypwd8qhUNd # you project id (get from 'My Credential') projectId: 8c5be0a9ef014100880db32c149b610c # the dis endpoint endpoint: https://dis.cn-north-1.myhuaweicloud.com # config each flow to monitor file. flows: ### DIS Stream - DISStream: YOU_DIS_STREAM_1 ## only support specified directory, filename can use * to match some files. eg. * means match all file, test*.log means match test1.log or test-12.log and so on. filePattern: /tmp/*.log ## from where to start: 'START_OF_FILE' or 'END_OF_FILE' initialPosition: START_OF_FILE ## upload max interval(ms) maxBufferAgeMillis: 5000
Starting DIS Agent
Run the following command to start the DIS Agent:
If information similar to the following appears, the DIS Agent has started successfully.
Success to start Agent [xxxxx].
Stopping DIS Agent
Run the following command to stop the DIS Agent:
If information similar to the following appears, the DIS Agent is stopping:
Stopping Agent [xxxxx].....
In the command output, [xxxxx] indicates the process ID. If information similar to the following appears, the DIS Agent has stopped:
Stopping Agent [xxxxx]............. Successfully.