手把手教你搭建kibana

这篇文章主要介绍了如何在Linux环境下搭建kibana(7.6.2),是基于上一篇手把手教你搭建Elasticsearch(7.6.2)集群
的基础上进行的,亲测有效,需要的朋友可以参考一下。

1、环境准备

Linux系统:CentOS 7
一台虚拟机:
192.168.194.128(master)

2、安装包的下载

提供elasticsearch官网目前最新稳定版本的链接如下:
kibana-7.6.2-linux-x86_64.tar.gz

3、kibana搭建

  1. 解压安装包命令:tar -zxvf kibana-7.6.2-linux-x86_64.tar.gz
  2. 授权kibana-7.6.2-linux-x86_64目录属主为elk命令: chown -R elk:elk /data/webapps/kibana-7.6.2-linux-x86_64
  3. 进入配置目录config命令:cd /data/webapps/kibana-7.6.2-linux-x86_64/config
  4. kibana.yml文件配置如下:vim kibana.yml
# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "192.168.194.128"

# Enables you to specify a path to mount Kibana at if you are running behind a proxy.
# Use the `server.rewriteBasePath` setting to tell Kibana if it should remove the basePath
# from requests it receives, and to prevent a deprecation warning at startup.
# This setting cannot end in a slash.
#server.basePath: ""

# Specifies whether Kibana should rewrite requests that are prefixed with
# `server.basePath` or require that they are rewritten by your reverse proxy.
# This setting was effectively always `false` before Kibana 6.3 and will
# default to `true` starting in Kibana 7.0.
#server.rewriteBasePath: false

# The maximum payload size in bytes for incoming server requests.
#server.maxPayloadBytes: 1048576

# The Kibana server's name.  This is used for display purposes.
#server.name: "your-hostname"

# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["http://192.168.194.128:9200","http://192.168.194.130:9200"]

# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host
# that connects to this Kibana instance.
#elasticsearch.preserveHost: true

# Kibana uses an index in Elasticsearch to store saved searches, visualizations and
# dashboards. Kibana creates a new index if the index doesn't already exist.
#kibana.index: ".kibana"

# The default application to load.
#kibana.defaultAppId: "home"

# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
#elasticsearch.username: "kibana"
#elasticsearch.password: "pass"

# Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively.
# These settings enable SSL for outgoing requests from the Kibana server to the browser.
#server.ssl.enabled: false
#server.ssl.certificate: /path/to/your/server.crt
#server.ssl.key: /path/to/your/server.key

# Optional settings that provide the paths to the PEM-format SSL certificate and key files.
# These files are used to verify the identity of Kibana to Elasticsearch and are required when
# xpack.security.http.ssl.client_authentication in Elasticsearch is set to required.
#elasticsearch.ssl.certificate: /path/to/your/client.crt
#elasticsearch.ssl.key: /path/to/your/client.key

# Optional setting that enables you to specify a path to the PEM file for the certificate
# authority for your Elasticsearch instance.
#elasticsearch.ssl.certificateAuthorities: [ "/path/to/your/CA.pem" ]

# To disregard the validity of SSL certificates, change this setting's value to 'none'.
#elasticsearch.ssl.verificationMode: full

# Time in milliseconds to wait for Elasticsearch to respond to pings. Defaults to the value of
# the elasticsearch.requestTimeout setting.
#elasticsearch.pingTimeout: 1500

# Time in milliseconds to wait for responses from the back end or Elasticsearch. This value
# must be a positive integer.
#elasticsearch.requestTimeout: 30000

# List of Kibana client-side headers to send to Elasticsearch. To send *no* client-side
# headers, set this value to [] (an empty list).
#elasticsearch.requestHeadersWhitelist: [ authorization ]

# Header names and values that are sent to Elasticsearch. Any custom headers cannot be overwritten
# by client-side headers, regardless of the elasticsearch.requestHeadersWhitelist configuration.
#elasticsearch.customHeaders: {}

# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
#elasticsearch.shardTimeout: 30000

# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying.
#elasticsearch.startupTimeout: 5000

# Logs queries sent to Elasticsearch. Requires logging.verbose set to true.
#elasticsearch.logQueries: false

# Specifies the path where Kibana creates the process ID file.
#pid.file: /var/run/kibana.pid

# Enables you specify a file where Kibana stores log output.
#logging.dest: stdout

# Set the value of this setting to true to suppress all logging output.
#logging.silent: false

# Set the value of this setting to true to suppress all logging output other than error messages.
#logging.quiet: false

# Set the value of this setting to true to log all events, including system usage information
# and all requests.
#logging.verbose: false

# Set the interval in milliseconds to sample system and process performance
# metrics. Minimum is 100ms. Defaults to 5000.
#ops.interval: 5000

# Specifies locale to be used for all localizable strings, dates and number formats.
# Supported languages are the following: English - en , by default , Chinese - zh-CN .
#i18n.locale: "en"
  1. 启动命令:su elk ./kibana &
  2. 启动输出日志如下:
 log   [10:28:07.274] [info][plugins-service] Plugin "case" is disabled.
 log   [10:28:10.783] [info][plugins-system] Setting up [37] plugins: [taskManager,siem,licensing,infra,encryptedSavedObjects,code,usageCollection,metrics,canvas,timelion,features,security,apm_oss,translations,reporting,uiActions,data,navigation,status_page,share,newsfeed,kibana_legacy,management,dev_tools,inspector,expressions,visualizations,embeddable,advancedUiActions,dashboard_embeddable_container,home,spaces,apm,cloud,graph,eui_utils,bfetch]
 log   [10:28:10.784] [info][plugins][taskManager] Setting up plugin
 log   [10:28:10.794] [info][plugins][siem] Setting up plugin
 log   [10:28:10.795] [info][licensing][plugins] Setting up plugin
 log   [10:28:10.798] [info][infra][plugins] Setting up plugin
 log   [10:28:10.799] [info][encryptedSavedObjects][plugins] Setting up plugin
 log   [10:28:10.799] [warning][config][encryptedSavedObjects][plugins] Generating a random key for xpack.encryptedSavedObjects.encryptionKey. To be able to decrypt encrypted saved objects attributes after restart, please set xpack.encryptedSavedObjects.encryptionKey in kibana.yml
 log   [10:28:10.803] [info][code][plugins] Setting up plugin
 log   [10:28:10.803] [info][plugins][usageCollection] Setting up plugin
 log   [10:28:10.805] [info][metrics][plugins] Setting up plugin
 log   [10:28:10.805] [info][canvas][plugins] Setting up plugin
 log   [10:28:10.809] [info][plugins][timelion] Setting up plugin
 log   [10:28:10.810] [info][features][plugins] Setting up plugin
 log   [10:28:10.811] [info][plugins][security] Setting up plugin
 log   [10:28:10.811] [warning][config][plugins][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
 log   [10:28:10.812] [warning][config][plugins][security] Session cookies will be transmitted over insecure connections. This is not recommended.
 log   [10:28:10.852] [info][apm_oss][plugins] Setting up plugin
 log   [10:28:10.852] [info][plugins][translations] Setting up plugin
 log   [10:28:10.853] [info][data][plugins] Setting up plugin
 log   [10:28:10.857] [info][plugins][share] Setting up plugin
 log   [10:28:10.858] [info][home][plugins] Setting up plugin
 log   [10:28:10.862] [info][plugins][spaces] Setting up plugin
 log   [10:28:10.866] [info][apm][plugins] Setting up plugin
 log   [10:28:10.872] [info][cloud][plugins] Setting up plugin
 log   [10:28:10.873] [info][graph][plugins] Setting up plugin
 log   [10:28:10.875] [info][bfetch][plugins] Setting up plugin
 log   [10:28:10.880] [info][savedobjects-service] Waiting until all Elasticsearch nodes are compatible with Kibana before starting saved objects migrations...
 log   [10:28:10.911] [info][savedobjects-service] Starting saved objects migrations
 log   [10:28:10.942] [info][plugins-system] Starting [22] plugins: [taskManager,siem,licensing,infra,encryptedSavedObjects,code,usageCollection,metrics,canvas,timelion,features,security,apm_oss,translations,data,share,home,spaces,apm,cloud,graph,bfetch]
 log   [10:28:12.271] [info][status][plugin:kibana@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.275] [info][status][plugin:elasticsearch@7.6.2] Status changed from uninitialized to yellow - Waiting for Elasticsearch
 log   [10:28:12.276] [info][status][plugin:elasticsearch@7.6.2] Status changed from yellow to green - Ready
 log   [10:28:12.277] [info][status][plugin:xpack_main@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.283] [info][status][plugin:graph@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.294] [info][kibana-monitoring][monitoring] Starting monitoring stats collection
 log   [10:28:12.295] [info][status][plugin:monitoring@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.301] [info][status][plugin:spaces@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.309] [info][status][plugin:security@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.313] [info][status][plugin:searchprofiler@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.315] [info][status][plugin:ml@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.381] [info][status][plugin:tilemap@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.383] [info][status][plugin:watcher@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.389] [info][status][plugin:grokdebugger@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.413] [info][status][plugin:dashboard_mode@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.417] [info][status][plugin:logstash@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.429] [info][status][plugin:beats_management@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.449] [info][status][plugin:apm_oss@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.464] [info][status][plugin:apm@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.477] [info][status][plugin:maps@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.482] [info][status][plugin:interpreter@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.489] [info][status][plugin:canvas@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.492] [info][status][plugin:license_management@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.494] [info][status][plugin:index_management@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.506] [info][status][plugin:console@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.508] [info][status][plugin:console_extensions@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.510] [info][status][plugin:index_lifecycle_management@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.519] [info][status][plugin:kuery_autocomplete@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.530] [info][status][plugin:metrics@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.559] [info][status][plugin:infra@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.564] [info][plugins][taskManager][taskManager] TaskManager is identified by the Kibana UUID: 58db61e1-cac5-44d9-80dd-e7979c319f17
 log   [10:28:12.565] [info][status][plugin:task_manager@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.567] [info][status][plugin:rollup@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.587] [info][status][plugin:transform@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.589] [info][status][plugin:encryptedSavedObjects@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.598] [info][status][plugin:actions@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.610] [info][status][plugin:alerting@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.656] [info][status][plugin:siem@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.659] [info][status][plugin:remote_clusters@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.661] [info][status][plugin:cross_cluster_replication@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.675] [info][status][plugin:upgrade_assistant@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.688] [info][status][plugin:uptime@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.691] [info][status][plugin:oss_telemetry@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.693] [info][status][plugin:file_upload@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.694] [info][status][plugin:data@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.697] [info][status][plugin:lens@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.715] [info][status][plugin:snapshot_restore@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.720] [info][status][plugin:input_control_vis@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.722] [info][status][plugin:kibana_react@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.723] [info][status][plugin:management@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.725] [info][status][plugin:navigation@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.728] [info][status][plugin:region_map@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.734] [info][status][plugin:telemetry@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.787] [info][status][plugin:timelion@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.790] [info][status][plugin:ui_metric@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.791] [info][status][plugin:markdown_vis@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.793] [info][status][plugin:metric_vis@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.794] [info][status][plugin:table_vis@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.795] [info][status][plugin:tagcloud@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.797] [info][status][plugin:vega@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:12.799] [warning][browser-driver][reporting] Enabling the Chromium sandbox provides an additional layer of protection.
 log   [10:28:13.279] [warning][reporting] Generating a random key for xpack.reporting.encryptionKey. To prevent pending reports from failing on restart, please set xpack.reporting.encryptionKey in kibana.yml
 log   [10:28:13.284] [info][status][plugin:reporting@7.6.2] Status changed from uninitialized to green - Ready
 log   [10:28:13.323] [info][listening] Server running at http://192.168.194.128:5601
 log   [10:28:13.465] [info][server][Kibana][http] http server running at http://192.168.194.128:5601
  1. 在谷歌浏览器输入链接url:http://192.168.194.128:5601/,可以看到web界面如下,至此我们已经把kibana搭建好了,可以在界面操作elasticsearch了。
    kibana

如果您觉得有帮助,欢迎收藏点赞哦 ~ ~ 多谢~

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当然可以!以下是手把手搭建 YOLOv5 的步骤: 1. 准备工作: - 确保你的电脑已经安装了 Python 3.8 或更高版本。 - 安装 PyTorch:可以根据你的操作系统和 CUDA 版本选择合适的安装命令,例如: ```shell pip install torch torchvision torchaudio ``` - 安装其他依赖库: ```shell pip install opencv-python matplotlib numpy ``` 2. 下载 YOLOv5 源代码: - 在终端中运行以下命令来克隆 YOLOv5 仓库: ```shell git clone https://github.com/ultralytics/yolov5.git ``` 3. 安装依赖库: - 进入 yolov5 目录: ```shell cd yolov5 ``` - 安装依赖库: ```shell pip install -r requirements.txt ``` 4. 准备数据集: - 准备好你的训练数据集,并将图像和对应的标签文件放入一个文件夹中。 5. 配置模型和数据: - 编辑 `yolov5/models/yolov5s.yaml` 文件,根据你的需求进行配置,例如设置 `nc` 参数为你的类别数量。 - 编辑 `data.yaml` 文件,设置 `train` 和 `val` 的路径,并配置类别数量和类别名称。 6. 训练模型: - 在终端中运行以下命令来开始训练模型: ```shell python train.py --img 640 --batch 16 --epochs 100 --data data.yaml --cfg models/yolov5s.yaml --weights '' ``` - 这个命令将使用默认参数来训练 YOLOv5 模型,你可以根据需要进行调整。 7. 测试模型: - 在终端中运行以下命令来测试模型效果: ```shell python detect.py --source your_image.jpg --weights runs/train/exp/weights/best.pt --conf 0.4 ``` - 这个命令将使用训练好的模型对指定图像进行目标检测,你可以调整 `--conf` 参数来控制检测结果的置信度阈值。 以上就是搭建 YOLOv5 的基本步骤,希望对你有帮助!如果有任何问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值