# 安装 Talend 日志记录模块

Availability-note[已弃用](https://help.talend.com/r/en-US/Cloud/labels-on-talend-help-center/availability-deprecated)

此内容已弃用。

您需要安装 Talend LogServer，其中包括用于收集日志的 Kibana 和 Filebeat。

## 开始之前

Elasticsearch 容器需要将 vm.max\_map\_count 参数设为不小于 262144。在您的计算机上检查该值，并根据需要增大该值。

要检查该值，请运行以下命令：

```
sysctl vm.max_map_count
```

如果您需要增大该值，请运行以下命令：

```
sysctl -w vm.max_map_count=262144
```

要将该值永久写入到 sysctl.conf 文件，请运行以下命令：

```
vm.max_map_count = 262144
```

## 步骤

1. 复制 Talend-LogServer-VA.B.C.zip 压缩包文件并将其提取到您选择的目录中。

   目录名称不得包含空格或非 ASCII 字符。
2. 要启动 Talend LogServer，请运行 start\_logserver.sh 可执行文件。

   不能以 root 用户的身份运行 Elasticsearch。Elasticsearch 是 Talend LogServer 的一部分，因此不能以 root 用户的身份运行可执行文件。
3. 为 Filebeat 配置 LOG\_PATH 和 APP\_NAME 值：
   * 打开位于 Filebeat 目录中的 filebeat.yml 文件，并按以下方式设置 LOG\_PATH 和 APP\_NAME 值：
     ```
       paths:
         - ${LOG_PATH:/home/Talend/8.0.1/tac/apache-tomcat/logs/*}
       fields:
         app_id: ${APP_NAME:TAC}
     ```
   * 或设置 LOG\_PATH 和 APP\_NAME 环境变量：
     ```
     export  LOG_PATH="/home/Talend/8.0.1/tac/apache-tomcat/logs/*"
     export  APP_NAME="TAC"
     ```
4. 启动 Filebeat：
   ```
   filebeat -e -c filebeat.yml
   ```

## 结果

您可以使用以下 URL 访问 Talend LogServer：http://localhost:5601/app/kibana#/dashboard/Default-Dashboard。

排错： 当您启动 Talend LogServer 时或没有看到 logstash-\*、talendesb-\* 和 talendaudit-\* 索引时，请完成以下步骤：

1. 删除 .kibana 索引。
   ```
   curl -XDELETE 'http://localhost:9200/.kibana'
   ```
2. 停止 Talend LogServer。
3. 启动 Talend LogServer。