简体   繁体   English

由于从多个websocket服务加载错误数据,Goaccess在实时HTML报告中显示错误数据

[英]Goaccess show error data on real-time HTML report due to loading wrong data from multiple websocket service

I need to run multiple goaccess processs with --real-time-html option to analyze multiple logs. 我需要使用--real-time-html选项运行多个goaccess进程来分析多个日志。 my commands are: 我的命令是:

/usr/bin/goaccess --real-time-html -o /data/html/log1/index.html -f log/log1.log --port=7890
/usr/bin/goaccess --real-time-html -o /data/html/log2/index.html -f log/log2.log --port=7891
...

when only 1 process is running, everything is ok, and I can see the data frames of websocket on Chrome, every data frame is generally the same length; 当只有一个进程正在运行时,一切正常,我可以在Chrome上看到websocket的数据帧,每个数据帧的长度通常相同;

But when 2 or more processes are running, 2 things happened: 但是,当两个或多个进程运行时,发生了两件事:

  1. On the terminal which goaccess processes are running, "SIGPIPE caught!" 在正在运行goaccess进程的终端上,“ SIGPIPE被捕获!” came out continuously; 不断出现
  2. On the web page, the dashboard are showing wrong data discontinuously, and I notice that the websocket data frames received by the browser are quite different in length(which means the web page are receiving different websocket data frames from other goaccess processes), when the data frame length are similiar to the data length when only 1 goaccess process is running, the data shown on the web page are right, when the data frame length ars different, the data ares wrong. 在网页上,信息中心不连续地显示错误的数据,我注意到浏览器接收到的websocket数据帧的长度有很大不同(这意味着网页从其他goaccess进程接收到不同的websocket数据帧),数据帧长度与仅运行1个goaccess进程时的数据长度类似,网页上显示的数据正确,当数据帧长度ars不同时,数据错误。

It seems like that even I run the goaccess process with "--port" option to specify different port for every WebSocket process, multiple websocket services ares still mixed up. 似乎即使我使用“ --port”选项运行goaccess进程来为每个WebSocket进程指定不同的端口,多个websocket服务也仍然混杂在一起。

To run multiple instances, you need to ensure the following: 要运行多个实例,您需要确保以下几点:

  1. Run each instance on a different port --port . 在不同的端口--port上运行每个实例。
  2. Different pipes (FIFOs) --fifo-in=/path/in.1 --fifo-out=/path/out.1 . 不同的管道(FIFO)-- --fifo-in=/path/in.1 --fifo-out=/path/out.1
  3. (Optionally) IFF you are using the on-disk storage, then you will need different path where the DB files are stored --db-path=/path/instance1/ . (可选)如果您正在使用磁盘存储的IFF ,则需要使用其他路径来存储数据库文件--db-path=/path/instance1/

Examples : 例子

goaccess -f /prod/access.log -o /var/www/html/prod.html --real-time-html --ws-url=192.168.1.2 --port=7890 --fifo-in=/tmp/prod.in --fifo-out=/tmp/prod.out

AND

goaccess -f /dev/access.log -o /var/www/html/dev.html --real-time-html --ws-url=192.168.1.2 --port=7891 --fifo-in=/tmp/dev.in --fifo-out=/tmp/dev.out

Source 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM