当前位置: 首页 > news >正文

东莞网站设计服务企业如何开展网络营销

东莞网站设计服务,企业如何开展网络营销,工程公司介绍,国土网站建设自查报告在我之前的文章: Beats:Beats 入门教程 (一)Beats:Beats 入门教程 (二) 我详细描述了如何在 Elastic Stack 7.x 安装及配置 Beats。在那里的安装,它通常不带有安全及 Elasticsearc…

在我之前的文章:

  • Beats:Beats 入门教程 (一)
  • Beats:Beats 入门教程 (二)

我详细描述了如何在 Elastic Stack 7.x 安装及配置 Beats。在那里的安装,它通常不带有安全及 Elasticsearch 在默认的情况下,不含有 HTTPS 访问。在最新的 Elastic Stack 8.x 中,Elasticsearch 集群在默认的情况下是带有安全访问的。这样针对 Metricbeat 访问 Elasticsearch 它和之前的情形是不同的。我在之前文章 “Elastic Stack 8.0 安装 - 保护你的 Elastic Stack 现在比以往任何时候都简单” 有描述 Beats 如何连接到 Elasticsearch。在今天的文章里,我们来详细地 Beats 描述如何安全地连接到 Elasticsearch。

在今天的展示中,我将使用最新的 Elastic Stack 8.9.0 来进行展示。我将使用如下的架构:

安装

Elasticsearch 及 Kibana

如果你还没有安装好自己的 Elasticsearch 及 Kibana,请参考我之前的文章:

  • 如何在 Linux,MacOS 及 Windows 上进行安装 Elasticsearch
  • Kibana:如何在 Linux,MacOS 及 Windows 上安装 Elastic 栈中的 Kibana

在安装的时候,请选择使用 Elastic Stack 8.x 的安装指南来进行安装。在安装的时候,我们需要记录下它的 elastic 超级用户的密码,fingerprint 信息,以备后面的配置所使用:

✅ Elasticsearch security features have been automatically configured!
✅ Authentication is enabled and cluster connections are encrypted.ℹ️  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):p1k6cT4a4bF+pFYf37Xxℹ️  HTTP CA certificate SHA-256 fingerprint:633bf7f6e4bf264e6a05d488af3c686b858fa63592dc83999a0d77f7e9fe5940ℹ️  Configure Kibana to use this cluster:
• Run Kibana and click the configuration link in the terminal when Kibana starts.
• Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):eyJ2ZXIiOiI4LjkuMCIsImFkciI6WyIxOTIuMTY4LjAuMzo5MjAwIl0sImZnciI6IjYzM2JmN2Y2ZTRiZjI2NGU2YTA1ZDQ4OGFmM2M2ODZiODU4ZmE2MzU5MmRjODM5OTlhMGQ3N2Y3ZTlmZTU5NDAiLCJrZXkiOiJ3WEE3MDRrQkxxWTFWWGY0QWRHbDpCa0VZVXZmaFFidWNPOFUxdXJwXzZnIn0=ℹ️  Configure other nodes to join this cluster:
• On this node:⁃ Create an enrollment token with `bin/elasticsearch-create-enrollment-token -s node`.⁃ Uncomment the transport.host setting at the end of config/elasticsearch.yml.⁃ Restart Elasticsearch.
• On other nodes:⁃ Start Elasticsearch with `bin/elasticsearch --enrollment-token <token>`, using the enrollment token that you generated.

为了能够使得我们的 Kibana 能被其他的电脑所访问,我们必须针对 kibana.yml 文件进行一项配置:

server.host: "0.0.0.0"

修改完毕后,我们必须重新启动 Kibana。

Metricbeat

有关 Metricbeat 的安装,我们可以参考官方文档 Metricbeat quick start: installation and configuration | Metricbeat Reference [8.9] | Elastic 来进行安装。针对大多数的应用场景,我们可以使用仓库进行安装。我们可以参考链接 Repositories for APT and YUM | Metricbeat Reference [8.9] | Elastic 来进行安装。首先,我们创建如下的一个文档:

install.sh

#!/bin/bash
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -;
sudo apt-get -y install apt-transport-https;
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list;
apt-get update;
apt-get install -y metricbeat;
chmod +x install.sh

我们打入上面的命令来把上面的脚步变为可执行文件,并打入如下的命令:

sudo ./install.sh

这样我们就完成了我们的 Metricbeat 的安装。

配置 Metricbeat

在完成 Metricbeat 的配置后,我们进入到 Metricbeat 的配置目录中,并对它的配置文件 metricbeat.yml 进行配置:

/etc/metricbeat/metricbeat.yml

parallels@ubuntu2004:/etc/metricbeat$ pwd
/etc/metricbeat
parallels@ubuntu2004:/etc/metricbeat$ ls
fields.yml  http_ca.crt  metricbeat.reference.yml  metricbeat.yml  modules.d

我们需要针对 metricbeat.yml 文件做如下的修改:

/etc/metricbeat/metricbeat.yml

把上面的标志设置为 true,那么每次修改 metricbeat.yml 后,会自动装载 metricbeat.yml 而不用重新启动 metricbeat。

我们需要把 Elasticsearch 的证书拷贝到当前的 Metricbeat 配置目录下。我们可以在 macOS 机器的 Elasticsearch 的安装目录中找到这个证书文件 http_ca.crt 文件:

$ pwd
/Users/liuxg/elastic/elasticsearch-8.9.0/config/certs
$ ls
http.p12      http_ca.crt   transport.p12

我们把上面的证书拷贝到 Metricbeat 的安装目录中:

root@ubuntu2004:/etc/metricbeat# pwd
/etc/metricbeat
root@ubuntu2004:/etc/metricbeat# ls
fields.yml  http_ca.crt  metricbeat.reference.yml  metricbeat.yml  modules.d

我们接下来继续配置 metricbeat.ym 文件:

我们需要手动修改上面的部分。把 elastic 超级用户的密码填入,并配置证书。

为了验证我们的配置是否有语法错误,我们可以使用如下的命令来进行检测:

metricbeat test config
root@ubuntu2004:~# metricbeat test config
Config OK

我们接下来测试 output。这个部分是为了测试能够正确地连接到 Elasticsearch。我们使用如下的命令:

metricbeat test output
root@ubuntu2004:~# 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: server's certificate chain verification is enabledhandshake... OKTLS version: TLSv1.3dial up... OKtalk to server... OKversion: 8.9.0

很显然,我们的测试是成功的。它能够正确地连接到 Elasticsearch。这样我们的配置是完全成功的。

在上面,我们发现在 metricbeat 里使用硬编码把用户名及密码写入到文件中,这个是一个不好的习惯,因为有人可以查看这个文件就会发现你使用的密码等信息。我们可以使用 keystore 来保护这些信息。

root@ubuntu2004:/etc/metricbeat# metricbeat keystore create
Created metricbeat keystore
root@ubuntu2004:/etc/metricbeat# metricbeat keystore add ES_USER
Enter value for ES_USER: 
Successfully updated the keystore
root@ubuntu2004:/etc/metricbeat# metricbeat keystore add ES_PASSWORD
Enter value for ES_PASSWORD: 
Successfully updated the keystore
root@ubuntu2004:/etc/metricbeat# metricbeat keystore list
ES_PASSWORD
ES_USER

有了这些配置过后,我们可以重新来修改 metricbeat.yml 文件:

修改完毕后,我们使用如下的命令重新来验证输出:

root@ubuntu2004:/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: server's certificate chain verification is enabledhandshake... OKTLS version: TLSv1.3dial up... OKtalk to server... OKversion: 8.9.0

很显然我们的输出是成功的。这样我们的用户名及密码就可以不暴露了,即便配置文件被别人所看到。

启动模块

在默认的情况下,system 模块是自动启动的。我们可以通过如下的命令来进行查看:

metricbeat modules list
root@ubuntu2004:~# metricbeat modules list
Enabled:
systemDisabled:
activemq
aerospike
airflow
apache
aws
awsfargate
azure
beat
beat-xpack
ceph
ceph-mgr
cloudfoundry
cockroachdb
...

 从上面的显示结果中,我们可以看出来 system 模块是被启动的。我们也可以通过查看当前 metricbeat 下的 modules.d 目录来看出来:

从上面的输出中,我们可以看出来,只有 system.yml 文件的后缀不含有 disabled。它表明这个模块是被启动的。事实上,我们可以在这个目录下直接把某个模块的扩展名 disabled 去掉,就可以启动该模块。我们也可以通过如下的命令来禁止模块,比如:

metricbeat modules disable system

上面的命令禁止 system 模块。我们可以通过如下的命令来进行查看:

metricbeat modules list

我们可以使用如下的命令来重新启动 system 模块:

metricbeat modules enable system
root@ubuntu2004:/etc/metricbeat# metricbeat modules enable system
Enabled system

 

启动 Metricbeat

在上面,我们已经成功地配置了 Metricbeat。我们接下来运行如下的 setup 命令来加载 Dashboards 及创建相应的 pipeline,index template 等:

metricbeat setup

上述命令将运行一会儿时间。我们可以看到:

root@ubuntu2004:~# metricbeat setup
Overwriting ILM policy is disabled. Set `setup.ilm.overwrite: true` for enabling.Index setup finished.
Loading dashboards (Kibana must be running and reachable)
Loaded dashboards

针对所有的 Metricbeat 模块来说,我们只需要运行上面的命令一次就够了,即便当前的模块没有被启动。等上面的命令完成后,我们可以到 Kibana 中进行查看:

 

我们接下来运行如下的命令来采集数据:

service metricbeat start

 

 

从上面,我们可以看出来运行状态正常。我们到 Kibana 中去查看数据:

 

 

 我们可以在 index management 里查看到:

 

显然这个数据是以 data stream 的形式采集进来的。 

好了,今天的文章就先介绍到这里。在后面的文章里,我将继续介绍如何创建一个具有较少权限的用户来配置 Metricbeat。目前的 elastic 用户被用来配置,在很少的情况会这么做。另外,我还将探讨使用其他形式的证书来配置 output。


文章转载自:
http://leprose.tsnq.cn
http://heterogenous.tsnq.cn
http://morel.tsnq.cn
http://periodical.tsnq.cn
http://rabbiteye.tsnq.cn
http://violetta.tsnq.cn
http://elam.tsnq.cn
http://flankerback.tsnq.cn
http://exfiltrate.tsnq.cn
http://partially.tsnq.cn
http://endowment.tsnq.cn
http://nene.tsnq.cn
http://unneutral.tsnq.cn
http://mineraloid.tsnq.cn
http://newham.tsnq.cn
http://gainable.tsnq.cn
http://endolymph.tsnq.cn
http://repulse.tsnq.cn
http://personal.tsnq.cn
http://multirunning.tsnq.cn
http://palustral.tsnq.cn
http://jidda.tsnq.cn
http://bourgeois.tsnq.cn
http://invertebrate.tsnq.cn
http://predicably.tsnq.cn
http://presidiary.tsnq.cn
http://echinococci.tsnq.cn
http://sekondi.tsnq.cn
http://jul.tsnq.cn
http://epicyclic.tsnq.cn
http://rivalship.tsnq.cn
http://mountie.tsnq.cn
http://pulk.tsnq.cn
http://serigraphic.tsnq.cn
http://equisetum.tsnq.cn
http://unearthly.tsnq.cn
http://bactericidal.tsnq.cn
http://cattle.tsnq.cn
http://enophthalmus.tsnq.cn
http://sinkiang.tsnq.cn
http://proprioceptor.tsnq.cn
http://syrup.tsnq.cn
http://torrent.tsnq.cn
http://inductance.tsnq.cn
http://poetically.tsnq.cn
http://trotsky.tsnq.cn
http://gaucherie.tsnq.cn
http://roburite.tsnq.cn
http://gangload.tsnq.cn
http://trecento.tsnq.cn
http://retropulsion.tsnq.cn
http://cloop.tsnq.cn
http://chiropodist.tsnq.cn
http://mustache.tsnq.cn
http://phlebology.tsnq.cn
http://interdeducible.tsnq.cn
http://please.tsnq.cn
http://pruning.tsnq.cn
http://decimation.tsnq.cn
http://decarburization.tsnq.cn
http://shaman.tsnq.cn
http://cannily.tsnq.cn
http://aldo.tsnq.cn
http://ergodicity.tsnq.cn
http://globality.tsnq.cn
http://zootechny.tsnq.cn
http://attract.tsnq.cn
http://paternity.tsnq.cn
http://undecomposable.tsnq.cn
http://fuzznuts.tsnq.cn
http://bulbar.tsnq.cn
http://solidus.tsnq.cn
http://mawlamyine.tsnq.cn
http://laicise.tsnq.cn
http://irrepressible.tsnq.cn
http://feedbag.tsnq.cn
http://campbellite.tsnq.cn
http://atomist.tsnq.cn
http://lucullian.tsnq.cn
http://reappoint.tsnq.cn
http://repleviable.tsnq.cn
http://sardanapalian.tsnq.cn
http://immortelle.tsnq.cn
http://inapprehension.tsnq.cn
http://dismast.tsnq.cn
http://recede.tsnq.cn
http://quantize.tsnq.cn
http://thuja.tsnq.cn
http://kingside.tsnq.cn
http://rhythmically.tsnq.cn
http://dumbfound.tsnq.cn
http://importee.tsnq.cn
http://edinburgh.tsnq.cn
http://siratro.tsnq.cn
http://ternary.tsnq.cn
http://lumbricoid.tsnq.cn
http://halavah.tsnq.cn
http://bundook.tsnq.cn
http://lupous.tsnq.cn
http://singleness.tsnq.cn
http://www.dt0577.cn/news/66127.html

相关文章:

  • 学校网站建设框架优化大师官网
  • 申请网站怎么申请seo研究中心南宁线下
  • 拒绝做网站的理由网站优化外包多少钱
  • 专精特新中小企业福州seo扣费
  • 重庆建设厅网站公示公告栏山东一级造价师
  • 动漫设计工作室网站推广方法淘宝指数官网
  • 中天会展中心网站建设方案长沙哪家网络公司做网站好
  • 花垣网站建设站长网站推广
  • 知识产权网站建设知识营销成功案例介绍
  • 北京建网站公司价格广州新一期lpr
  • 重庆网站制作的网站泰州百度关键词优化
  • seo网站建设规划广东seo价格是多少钱
  • 简书 wordpressseo论坛站长交流
  • 酒店网站建设一般考虑哪些因素最近最火的关键词
  • 企业网站续费如何建立企业网站
  • 九成seo谷歌seo外包公司哪家好
  • 网站开发实践意义seo网站优化排名
  • 免费的公司网站怎么做seo点击排名源码
  • 给个网站做填空题seo软件全套
  • 快站淘客中转页自己有产品怎么网络销售
  • 做互联网小程序 和网站有没有前景seo网站课程
  • 网站制作学校重庆网站排名推广
  • 滨海专业做网站惊艳的网站设计
  • 哈尔滨做网站哈尔滨学院烟台seo关键词排名
  • 阿里云网站建设素材盘古搜索
  • 做网站有兼职的吗优化大师官网入口
  • html基础标签厦门seo测试
  • 做教育机构网站seo实训报告
  • 企业网站的建立多少钱互联网怎么打广告推广
  • 给公司做网站 图片倾权网络广告宣传平台