安装和配置日志服务器
- 从 Citrix 下载 下载日志服务器 Docker 容器镜像。
- 将下载的文件放在同一目录中。
- 在该目录中,使用终端 (Linux) 或命令提示符 (Windows) 运行安装程序并按照说明操作:
注意:
- 为了安全部署,强烈建议使用 HTTPS,因为它能确保客户端和服务器之间的加密通信。HTTP 的使用由客户自行决定。
- 确保所选端口尚未被占用。
- 避免使用特权端口 (0–1023),因为它们需要管理员或系统级权限。
- 验证防火墙规则允许所选端口上的流量。
- 使用有效范围 (0–65535) 内的端口号,但要避免使用系统服务常用的端口,以防止冲突。
Linux 系统的安装
chmod +x ./InstallLogServer
# Install with https mode with port 8443 with default path
./InstallLogServer --https --cert </path/your_private_cert_key.pfx> --port 8443
# Install with http mode, with port 8080 with default path
./InstallLogServer --port 8080
# Command to change the config path and data path of your choice with https mode
./InstallLogServer --https --cert </path/your_private_cert_key.pfx> --port 8443 --config /Path/LogServer/Config --database /Path/LogServer/Data
# Command to change the config path and data path of your choice with http mode
./InstallLogServer --port 8080 --config /Path/LogServer/Config --database /Path/LogServer/Data
<!--NeedCopy-->
安装后,会生成一些有用的脚本文件:
# In Linux, sh scripts will be generated
DownloadLogsByTime.sh
DownloadLogsByWords.sh
GetAuthKey.sh
ListMachines.sh
StartLogServer.sh
<!--NeedCopy-->
Use ./StartLogServer.sh to start the server. Check your configpath/weblogs.txt to confirm LogServer started successfully.
如果 LogServer 成功启动,您将在 weblogs 文件中看到以下消息。LogServer 在 Docker 容器内部使用端口 5000,并采用选定的 HTTP 或 HTTPS 协议。
Now listening on: https://[::]:5000
<!--NeedCopy-->
如果日志服务器以 HTTP 模式安装,成功日志应显示以下内容:
Now listening on: http://[::]:5000
<!--NeedCopy-->
注意:
- 在 DDC、Storefront™、VDA 等中配置 LogServer URL 时,应使用安装步骤中配置的端口(8080 或 8443 或任何指定的端口)。
- 通常在 Linux 上启动需要 30 到 60 秒。
Windows Installation
步骤 1:在日志服务器 VM 上安装适用于 Windows 的 Docker Desktop(可能需要订阅)。
步骤 2:运行以下命令以继续安装。
注意:
配置和数据库(数据)文件夹的默认位置在 C:\Users<username>\LogServer 下创建。您可以使用以下命令更改它们:
#Install with https mode with port 8443 with default path
InstallLogServer.exe --https --cert <c:\path\cert.pfx> --port 8443
#Install with http mode, with port 8080 with default path
InstallLogServer.exe --port 8080
#Command to change the config path and data path of your choice with https mode
InstallLogServer.exe --https --cert <c:\path\cert.pfx> --port 8443 --config C:\LogServer\Config --database C:\LogServer\Datacmd
#Install with specific config path and data path
InstallLogServer.exe --port 8080 --config C:\LogServer\Config --database C:\LogServer\Datacmd
<!--NeedCopy-->
安装后,会在您保存安装程序文件的同一目录中生成一些有用的脚本文件。
注意:
您可以将这些文件移动到其他位置。但是,请记住新位置,因为在配置日志服务器时将再次需要它们。
#In Windows, bat scripts will be generated in the same directory where you saved the installer files.
DownloadLogsByTime.bat
DownloadLogsByWords.bat
GetAuthKey.bat
ListMachines.bat
StartLogServer.bat
<!--NeedCopy-->
使用 StartLogServer.bat 启动日志服务器。
Check your configpath\weblogs.txt to confirm LogServer started successfully
当日志显示以下内容时,表示日志服务器已成功启动。
如果 LogServer 成功启动,您将在 weblogs 文件中看到以下消息。LogServer 在 Docker 容器内部使用端口 5000,并选择 http 或 https 协议。
Now listening on: https://[::]:5000
<!--NeedCopy-->
如果日志服务器以 HTTP 模式安装,则成功日志应显示如下内容:
Now listening on: http://[::]:5000
<!--NeedCopy-->
注意:
- 在 DDC、Storefront、VDA 等中配置 LogServer URL 时,应使用安装步骤中配置的端口(8080 或 8443 或任何指定的端口)。
- 通常,在 Windows 中,这需要 1 到 10 分钟,具体取决于硬件。
验证日志服务器
在日志服务器、VDA 或 DDC 上打开浏览器,访问 http://YourLogServerFQDN:8080/Ping 浏览器中将显示响应字符串“Pong UTC:08/19/2025 01:03:29”。
注意:
如果未启用默认端口,请将端口 8080 更改为您的配置端口;如果以 HTTPS 模式安装,请将 http 更改为 https:
如果日志服务器验证失败,请检查以下日志: 运行
docker logs logserver以检查 docker 日志。 对于 Linux- $HOME/LogServer/Config/weblogs.txt(如果未使用默认路径,请将 $HOME/LogServer 更改为您的实际安装路径)对于 Windows -
C:\Users\YourUserName\LogServer\Config\weblogs.txt(将 YourUserName 更改为实际用户名。如果未使用默认路径,请将 C:\Users\YourUserName\LogServer 更改为您的实际安装路径)
日志服务器的高级配置
运行 docker stop logserver 以停止日志服务器
默认情况下,日志服务器配置有以下值。要进行更改,请编辑 StartLogServer.sh 或 StartLogServer.bat(如果安装在 Windows 中)。
-e MAX_RESERVE_DAYS=7 -e MAX_DISK_USAGE_PERCENTAGE=90 -e LOCAL_DOWN_ONLY=true -e OPENSEARCH_JAVA_OPTS=”-Xms2G -Xmx2G”
| 日志服务器配置选项 | 默认设定值 | 值范围 | 描述信息 |
|---|---|---|---|
| 最大保留天数 | 7 | 1~30 | 日志服务器根据 TimeStamp 字段存储日志条目的最大天数。7 天前插入的日志将被删除。每 10 分钟检查一次。 |
| 最大磁盘使用百分比 | 90 | 10~90 | 日志服务器监控数据存储百分比。如果使用百分比超过 90%,日志服务器将逐日删除旧日志,直到使用百分比低于 90%。每 10 分钟检查一次。 |
| 仅本地停机 | 真 | 真/假 | 如果为 true,则只有安装了日志服务器的机器才能访问 /Download/* API。如果为 false,则其他具有 AuthKey 的机器可以访问 /Download/* API。 |
| OPENSEARCH_JAVA_OPTS | “-Xms2G -Xmx2G” | 2G 至 最大内存/2 | Opensearch 内存配置。如果有大量机器向日志服务器发送日志,请提供更多内存。 |
在 Linux 上,使用./StartLogServer.sh启动日志服务器。
在 Windows 上,使用StartLogServer.bat启动日志服务器。
为了检查更改是否已生效