最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Filebeat在CentOS环境的数据传输加密
时间:2026-07-16 07:07:08 编辑:袖梨 来源:一聚教程网
在CentOS上配置Filebeat数据传输加密需使用SSL/TLS,步骤如下:
- 生成证书:用OpenSSL生成自签名证书(含CA证书、客户端证书及私钥),或从CA获取证书。
# 生成CA证书openssl req -x509 -newkey rsa:4096 -keyout ca.key -out ca.crt -days 3650 -nodes# 生成Filebeat证书openssl req -newkey rsa:4096 -keyout filebeat.key -out filebeat.csr -nodesopenssl x509 -req -in filebeat.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out filebeat.crt -days 3650 - 配置Filebeat:修改
/etc/filebeat/filebeat.yml,在output.elasticsearch中启用SSL并指定证书路径。output.elasticsearch:hosts: ["https://elasticsearch_host:9200"]ssl.enabled: truessl.certificate_authorities: ["/etc/filebeat/certs/ca.crt"]ssl.certificate: "/etc/filebeat/certs/filebeat.crt"ssl.key: "/etc/filebeat/certs/filebeat.key" - 配置Elasticsearch:确保Elasticsearch启用SSL并信任Filebeat证书,修改
/etc/elasticsearch/elasticsearch.yml。xpack.security.enabled: truexpack.security.transport.ssl.enabled: truexpack.security.transport.ssl.verification_mode: certificatexpack.security.transport.ssl.keystore.path: elastic-certificates.p12xpack.security.transport.ssl.truststore.path: elastic-certificates.p12 - 重启服务:重启Filebeat和Elasticsearch使配置生效。
sudo systemctl restart filebeatsudo systemctl restart elasticsearch - 验证配置:通过查看日志或使用
curl命令测试加密连接是否正常。
注意:生产环境建议使用CA签发的证书,避免自签名证书的安全风险。
相关文章
- php在centos上的时区如何设置 07-16
- 怎样调整centos php的执行时间 07-16
- centos php配置中的max_execution_time如何调 07-16
- centos php安全配置要点有哪些 07-16
- 如何备份CentOS上的PHP配置文件 07-16
- 如何在centos上设置php-fpm的运行用户 07-16