当前位置: 首页 > news >正文 湖北seo网站推广WordPress 动漫源码 news 2025/10/24 13:12:12 湖北seo网站推广,WordPress 动漫源码,建设电子商务网站的预期收益,个人网站开发流程这篇文章是继文章 “Beats#xff1a;安装及配置 Metricbeat #xff08;一#xff09;- 8.x” 的续篇。你可以先阅读之前的那篇文章再继续阅读这篇文章。我们在这篇文章中继续之前的探讨。 使用 fingerprint 来代替证书 在实际的使用中#xff0c;我们需要从 Elasticsear…这篇文章是继文章 “Beats安装及配置 Metricbeat 一- 8.x” 的续篇。你可以先阅读之前的那篇文章再继续阅读这篇文章。我们在这篇文章中继续之前的探讨。 使用 fingerprint 来代替证书 在实际的使用中我们需要从 Elasticsearch 的安装目录中拷贝证书来配置 metricbeat。这样有时觉得并不是很方便。相反我们可以直接使用 fingerprint 来对 metricbeat 的证书来进行配置。我们可以参考文章 “Beats使用 fingerprint 来连接 Beats/Logstash 和 Elasticsearch”。我们对 metricbeat.yml 进行如下的修改 /etc/metricbeat/metricbeat.yml output.elasticsearch:# Array of hosts to connect to.hosts: [192.168.0.3:9200]# Protocol - either http (default) or https.protocol: https# Authentication credentials - either API key or username/password.#api_key: id:api_keyusername: ${ES_USER}password: ${ES_PASSWORD}# ssl.certificate_authorities: [/etc/metricbeat/http_ca.crt]ssl.ca_trusted_fingerprint: 633bf7f6e4bf264e6a05d488af3c686b858fa63592dc83999a0d77f7e9fe5940 在上面我们使用 ssl.ca_trusted_fingerprint 的配置来代替 ssl.certificate_authorities 的配置。显然这个比较方便因为我们不需要拷贝证书而且配置是不需要含有证书路径。 等修改完上面的配置后我们重新运行如下的命令来测试这个输出是否已经成功 metricbeat test output ootubuntu2004:/etc/metricbeat# metricbeat test output elasticsearch: https://192.168.0.3:9200...parse url... OKconnection...parse host... OKdns lookup... OKaddresses: 192.168.0.3dial up... OKTLS...security: servers certificate chain verification is enabledhandshake... OKTLS version: TLSv1.3dial up... OKtalk to server... OKversion: 8.9.0 从输出的结果中来可能我们的证书配置是成功的。 使用 API key 来代替用户名及密码 在很多的情况下我们并不希望使用 elastic 这个超级用户来对 Beats 进行配置。我们可以使用 API key 来进行配置。使用 API 可以的好处是它可以定义 API key 的使用时效比如1一个月。当然它也可以定义相应的权限。在下面我们来展示如何创建 API key 我们拷贝上面的 API key并在 metricbeat.yml 中进行配置 /etc/metricbeat/metricbeat.yml output.elasticsearch:# Array of hosts to connect to.hosts: [192.168.0.3:9200]# Protocol - either http (default) or https.protocol: https# Authentication credentials - either API key or username/password.#api_key: id:api_key# username: ${ES_USER}# password: ${ES_PASSWORD}api_key: sFizXYoBxPLM4LwrKywe:NMOjRbUvT7ykunWDsVG4uQ# ssl.certificate_authorities: [/etc/metricbeat/http_ca.crt]ssl.ca_trusted_fingerprint: 633bf7f6e4bf264e6a05d488af3c686b858fa63592dc83999a0d77f7e9fe5940 在上面我们使用 api_key 来代替 username/password 的配置。我们使用如下的命令来测试配置是否成功 metricbeat test output rootubuntu2004:/etc/metricbeat# metricbeat test output elasticsearch: https://192.168.0.3:9200...parse url... OKconnection...parse host... OKdns lookup... OKaddresses: 192.168.0.3dial up... OKTLS...security: servers certificate chain verification is enabledhandshake... OKTLS version: TLSv1.3dial up... OKtalk to server... OKversion: 8.9.0 上面显示我们的配置是成功的。 创建新用户并使用新用户信息来进行配置 在上面我们已经说明了使用 elastic 超级用户是非常不好的一个习惯因为一旦 elastic 这个超级用户的信息被泄露那么它可能造成灾难性的后果。在实际的使用中我们尽量避免使用 elastic 这个超级用户。我们可以参考之前的文章 “Beats最佳实践” 来创建一个针对 Beats 数据采集的用户。这个用户有较少的权限。即便泄露也可能不会造成特别大的损失。更多信息可以参阅官方文档 Grant privileges and roles needed for publishing | Filebeat Reference [8.9] | Elastic 我们参考之前的文章 “Elasticsearch用户安全设置” 来创建用户及 roles。 我们接下来创建用户 如上所示我创建了一个叫做 user 的用户而它的密码为 password。 接下来我们使用如下的命令来创建一个属于 mertic 用户的 API key POST _security/api_key/grant {grant_type: password,username: metric,password: password,api_key: {name: mertic} } 我们可以使用如下的方法来对 Metricbeat 进行配置 api_key: id:api_key /etc/metricbeat/metricbeat.yml output.elasticsearch:# Array of hosts to connect to.hosts: [192.168.0.3:9200]# Protocol - either http (default) or https.protocol: https# Authentication credentials - either API key or username/password.api_key: s1jWXYoBxPLM4LwrZSzu:rL-6POdnQDSAjWWHao9Ybw# username: ${ES_USER}# password: ${ES_PASSWORD}# ssl.certificate_authorities: [/etc/metricbeat/http_ca.crt]ssl.ca_trusted_fingerprint: 633bf7f6e4bf264e6a05d488af3c686b858fa63592dc83999a0d77f7e9fe5940 配置完毕后我们再进行如下的测试 metricbeat test output rootubuntu2004:/etc/metricbeat# metricbeat test output elasticsearch: https://192.168.0.3:9200...parse url... OKconnection...parse host... OKdns lookup... OKaddresses: 192.168.0.3dial up... OKTLS...security: servers certificate chain verification is enabledhandshake... OKTLS version: TLSv1.3dial up... OKtalk to server... OKversion: 8.9.0 很显然我们的配置是成功的。我们可以使用和之前文章 “Beats安装及配置 Metricbeat 一- 8.x” 中所述的 keystore 来保存这些信息。 /etc/mertricbeat/metrcibeat.yml # ---------------------------- Elasticsearch Output ---------------------------- output.elasticsearch:# Array of hosts to connect to.hosts: [192.168.0.3:9200]# Protocol - either http (default) or https.protocol: https# Authentication credentials - either API key or username/password.api_key: ${ES_API_KEY}# username: ${ES_USER}# password: ${ES_PASSWORD}# ssl.certificate_authorities: [/etc/metricbeat/http_ca.crt]ssl.ca_trusted_fingerprint: 633bf7f6e4bf264e6a05d488af3c686b858fa63592dc83999a0d77f7e9fe5940metricbeat keystore add ES_API_KEY rootubuntu2004:/etc/metricbeat# metricbeat keystore add ES_API_KEY Enter value for ES_API_KEY: Successfully updated the keystore 在上面我们使用 s1jWXYoBxPLM4LwrZSzu:rL-6POdnQDSAjWWHao9Ybw 作为输入。它就是 id:api_key 的组合。我们再次运行如下的命令来检查配置是否成功 rootubuntu2004:/etc/metricbeat# metricbeat test output elasticsearch: https://192.168.0.3:9200...parse url... OKconnection...parse host... OKdns lookup... OKaddresses: 192.168.0.3dial up... OKTLS...security: servers certificate chain verification is enabledhandshake... OKTLS version: TLSv1.3dial up... OKtalk to server... OKversion: 8.9.0 当然针对有些用户喜欢使用 username 及 password 来配置而不使用 API key你也可以是使用如下的配置 /etc/metricbeat/metricbeat.yml output.elasticsearch:# Array of hosts to connect to.hosts: [192.168.0.3:9200]# Protocol - either http (default) or https.protocol: https# Authentication credentials - either API key or username/password.# api_key: ${ES_API_KEY}username: metricpassword: password# ssl.certificate_authorities: [/etc/metricbeat/http_ca.crt]ssl.ca_trusted_fingerprint: 633bf7f6e4bf264e6a05d488af3c686b858fa63592dc83999a0d77f7e9fe5940 这样我们就完成了这个部分的展示。在接下来的文章中我将介绍如何使用 Alerts 来对 Metricbeat 进行通知。 文章转载自: http://www.morning.plqsc.cn.gov.cn.plqsc.cn http://www.morning.zpqbh.cn.gov.cn.zpqbh.cn http://www.morning.rqjfm.cn.gov.cn.rqjfm.cn http://www.morning.bkxnp.cn.gov.cn.bkxnp.cn http://www.morning.wmqxt.cn.gov.cn.wmqxt.cn http://www.morning.tgyzk.cn.gov.cn.tgyzk.cn http://www.morning.qrwnj.cn.gov.cn.qrwnj.cn http://www.morning.mdwb.cn.gov.cn.mdwb.cn http://www.morning.jrpmf.cn.gov.cn.jrpmf.cn http://www.morning.prjns.cn.gov.cn.prjns.cn http://www.morning.ljwyc.cn.gov.cn.ljwyc.cn http://www.morning.jcwt.cn.gov.cn.jcwt.cn http://www.morning.nbqwr.cn.gov.cn.nbqwr.cn http://www.morning.clpdm.cn.gov.cn.clpdm.cn http://www.morning.nzqmw.cn.gov.cn.nzqmw.cn http://www.morning.lbbyx.cn.gov.cn.lbbyx.cn http://www.morning.wclxm.cn.gov.cn.wclxm.cn http://www.morning.ypxyl.cn.gov.cn.ypxyl.cn http://www.morning.cyjjp.cn.gov.cn.cyjjp.cn http://www.morning.mnwb.cn.gov.cn.mnwb.cn http://www.morning.zczkm.cn.gov.cn.zczkm.cn http://www.morning.lhsdf.cn.gov.cn.lhsdf.cn http://www.morning.hpnhl.cn.gov.cn.hpnhl.cn http://www.morning.lxcwh.cn.gov.cn.lxcwh.cn http://www.morning.hqgxz.cn.gov.cn.hqgxz.cn http://www.morning.mlyq.cn.gov.cn.mlyq.cn http://www.morning.yrdt.cn.gov.cn.yrdt.cn http://www.morning.wtbzt.cn.gov.cn.wtbzt.cn http://www.morning.fewhope.com.gov.cn.fewhope.com http://www.morning.gpkjx.cn.gov.cn.gpkjx.cn http://www.morning.hngmg.cn.gov.cn.hngmg.cn http://www.morning.wjxtq.cn.gov.cn.wjxtq.cn http://www.morning.xhpnp.cn.gov.cn.xhpnp.cn http://www.morning.dqkcn.cn.gov.cn.dqkcn.cn http://www.morning.bhwz.cn.gov.cn.bhwz.cn http://www.morning.snmth.cn.gov.cn.snmth.cn http://www.morning.mnsmb.cn.gov.cn.mnsmb.cn http://www.morning.rytps.cn.gov.cn.rytps.cn http://www.morning.gtkyr.cn.gov.cn.gtkyr.cn http://www.morning.dmtld.cn.gov.cn.dmtld.cn http://www.morning.mrnnb.cn.gov.cn.mrnnb.cn http://www.morning.ynryz.cn.gov.cn.ynryz.cn http://www.morning.nj-ruike.cn.gov.cn.nj-ruike.cn http://www.morning.fjntg.cn.gov.cn.fjntg.cn http://www.morning.nswcw.cn.gov.cn.nswcw.cn http://www.morning.wrlcy.cn.gov.cn.wrlcy.cn http://www.morning.rwyd.cn.gov.cn.rwyd.cn http://www.morning.qlry.cn.gov.cn.qlry.cn http://www.morning.lpppg.cn.gov.cn.lpppg.cn http://www.morning.qcztm.cn.gov.cn.qcztm.cn http://www.morning.hsksm.cn.gov.cn.hsksm.cn http://www.morning.gydth.cn.gov.cn.gydth.cn http://www.morning.ggtgl.cn.gov.cn.ggtgl.cn http://www.morning.xrrjb.cn.gov.cn.xrrjb.cn http://www.morning.yrjfb.cn.gov.cn.yrjfb.cn http://www.morning.jwefry.cn.gov.cn.jwefry.cn http://www.morning.kxxld.cn.gov.cn.kxxld.cn http://www.morning.stpkz.cn.gov.cn.stpkz.cn http://www.morning.bpmnq.cn.gov.cn.bpmnq.cn http://www.morning.hrjrt.cn.gov.cn.hrjrt.cn http://www.morning.xdfkrd.cn.gov.cn.xdfkrd.cn http://www.morning.zzaxr.cn.gov.cn.zzaxr.cn http://www.morning.bmts.cn.gov.cn.bmts.cn http://www.morning.mfqmk.cn.gov.cn.mfqmk.cn http://www.morning.btypn.cn.gov.cn.btypn.cn http://www.morning.wnhsw.cn.gov.cn.wnhsw.cn http://www.morning.tthmg.cn.gov.cn.tthmg.cn http://www.morning.fxqjz.cn.gov.cn.fxqjz.cn http://www.morning.bhdtx.cn.gov.cn.bhdtx.cn http://www.morning.tntqr.cn.gov.cn.tntqr.cn http://www.morning.xmyrn.cn.gov.cn.xmyrn.cn http://www.morning.leyuhh.com.gov.cn.leyuhh.com http://www.morning.dbddm.cn.gov.cn.dbddm.cn http://www.morning.hgcz.cn.gov.cn.hgcz.cn http://www.morning.tnjz.cn.gov.cn.tnjz.cn http://www.morning.fhhry.cn.gov.cn.fhhry.cn http://www.morning.nhzxd.cn.gov.cn.nhzxd.cn http://www.morning.zdnrb.cn.gov.cn.zdnrb.cn http://www.morning.bqmdl.cn.gov.cn.bqmdl.cn http://www.morning.bmts.cn.gov.cn.bmts.cn 查看全文 http://www.tj-hxxt.cn/news/245414.html 相关文章: 电商网站平台有哪些广州短视频运营培训 工作室暴利项目南京网站优化方案 建手机wap网站大概多少钱长沙室内设计学校 vps如何创建网站公众号平台app 自己做免费手机网站吗网站建设服务那一个便宜 做一般的公司门户网站投资额本科毕业设计代做网站 资源下载类网站源码做淘客网站用什么程序 网站服务器提供什么服务网络营销带来的效果 网站建设公司销售招聘电子商务网站与建设课件 大连网站建设设计公司哪家好wordpress配置搜索引擎优化 出版社网站建设方案关键词优化排名软件哪家好 做网站 公司 个体模版型网站 多米诺网站建设中国交通建设网官方网站 龙岗网站建设短视频投放方案 秦皇岛网站制作电话婚纱摄影东莞网站建设技术支持 wordpress建站版本推荐微平台网站开发 网站策划书的要点一朋友做网站网站被抓了 德邦公司网站建设特点网页广告图片 nodejs做网站能保护源代码吗山东建筑公司实力排名 手机网站经典案例微信带颜色的公众号 网站建设基础知识怎么做网站搜索 网页好看的网站设计网站死链处理 中山大学精品课程网站山东省工程建设信息网 做图海报网站网站建设管理ppt php商业网站制作快速网站仿制 怎么对自己做的网站进行加密论坛是做网站还是app好 vue做网站的好处wordpress菜单不现实 网站做弹幕广告网站版式设计说明 松原做招聘的网站有哪些静态网站托管平台 3d网站开发成本建站之星模板怎么设置