apm-server 为自行管理的队列服务器配置 SSL/TLS , elasticsearch集群中有x-pack 的p12证书 elastic-certificates.p12 elastic-stack-ca.p12
时间: 2024-12-02 08:28:20 浏览: 71
如果你在使用Elasticsearch X-Pack并需要将APM-Server与Elasticsearch集群(包括有P12证书的elasticsearch-certificates.p12和elastic-stack-ca.p12)一起配置SSL/TLS,那么你需要做以下几步:
1. **导入证书**:
- 对于elasticsearch-certificates.p12,解密并导出PEM格式的私钥和公钥:
```sh
openssl pkcs12 -in elastic-certificates.p12 -nocerts -nodes -out es_private_key.pem
openssl pkcs12 -in elastic-certificates.p12 -clcerts -nokeys -out es_certificate.pem
```
- 对于elastic-stack-ca.p12,同样解密并导出根证书:
```sh
openssl pkcs12 -in elastic-stack-ca.p12 -nokeys -out root_ca_cert.pem
```
2. **配置Apm-server**:
- 在APM-Server的配置文件中,将上述导出的证书路径加入到相应部分:
```yaml
http:
...
https:
enabled: true
keystore_file: path/to/apm_server_keystore.jks
keystore_password: your_password
client_auth_enabled: on
truststore_file: path/to/truststore.jks
truststore_password: your_truststore_password
ssl.certificate_authorities: [path/to/root_ca_cert.pem]
ssl.certificate: path/to/es_certificate.pem
ssl.key: path/to/es_private_key.pem
```
注意,这里假设你已经将私钥转换成了JKS(Java KeyStore)格式。
3. **配置Elasticsearch**:
- 确保Elasticsearch配置中也包含了相同的信任store和证书信息,因为Apm-server作为客户端与Elasticsearch交互。
4. **重启服务**:
保存配置后,分别重启APM-Server和Elasticsearch实例以应用新的SSL/TLS配置。
5. **验证连接**:
测试APM-Server是否能够成功地通过SSL/TLS与Elasticsearch集群通信,确保数据安全传递。
阅读全文
相关推荐


















