注意,这里的URL, 使用端口8220,不是443
curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.15.1-linux-x86_64.tar.gz
tar xzvf elastic-agent-8.15.1-linux-x86_64.tar.gz
cd elastic-agent-8.15.1-linux-x86_64
可以将如下这一段存为一个sh文件,方便操作
sudo ./elastic-agent install \
--fleet-server-es=https://192.168.1.100:9200 \
--fleet-server-service-token=xxxxxxxxxxxxxxxxx \
--fleet-server-policy=fleet-server-policy \
--fleet-server-es-ca-trusted-fingerprint=xxxxxxxxxxx \
--fleet-server-port=8220
完成后即可看到Fleet Server
接着尝试安装Agent,注意Agent不要跟Fleet server同一部机器,不然会搞乱配置,这里我使用一部windows机器来安装Agent
在Windows中,使用powershell执行如下命令
$ProgressPreference = 'SilentlyContinue' (这个会报错,忽略即可)
Invoke-WebRequest -Uri https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.15.1-windows-x86_64.zip -OutFile elastic-agent-8.15.1-windows-x86_64.zip
Expand-Archive .\elastic-agent-8.15.1-windows-x86_64.zip -DestinationPath .
cd elastic-agent-8.15.1-windows-x86_64
.\elastic-agent.exe install --url=https://192.168.1.100:8220 --enrollment-token=xxxxxxxx
注意,上面这条命令,需要添加 --insecure 参数,不然会报错:certificate signed by unknown authority,如下图
正确命令:.\elastic-agent.exe install --url=https://192.168.1.100:8220 --insecure --enrollment-token=xxxxxxX
回到Fleet页面,即可看到Agent
标签:ELK,elastic,--,agent,Server,64,Agent,8.15,server From: https://blog.51cto.com/helpdesk/11991716