kabana安装配置

  1. 下载安装包
    下载地址https://www.elastic.co/cn/downloads/past-releases#kibana
    这里选择inux86位版本
  2. 上传到服务器
  3. 创建用户
    因为之前在安装elasticsearch时,已经创建过用户elk,这里就不再创建了,可以参考Elasticsearch安装与配置,同样是不能使用root用户启动kibana
  4. 配置
    修改配置文件/kibana-7.14.0-linux-x86_64/config/kibana.yml
    主要修改本机地址和es地址
server.host: "192.168.42.111"
elasticsearch.hosts: ["http://192.168.42.111:9200"]
i18n.locale: "zh-CN" 

修改权限
chown -R es:es /opt/server/kibana8.3.3

  1. 启动服务
    运行/kibana-7.14.0-linux-x86_64/bin下的kibana
    ./bin/kibana

后台启动

nohup ./bin/kibana &
http://192.168.42.111:5601/app/kibana
查看端口

#-t (tcp)仅显示 tcp 相关选项
#-u (udp)仅显示 udp 相关选项
#-n 拒绝显示别名,能显示数字的全部转化成数字。
#-l 仅列出有在 Listen (监听) 的服務状态
#-p 显示建立相关链接的程序名
netstat -tunlp|grep 5601
因为kibana是使用node.js写的,所以需要grep node
ps -ef|grep node
  1. 创建索引
    使用dev tools
  2. 查看索引
    get /fisher
  3. 添加文档
    put /fisher/_doc/1
    {
    "message":"hello world!"
    }
  4. 查看文档
    get /fisher/_doc/1
    x
    ===================================
    如果不是本机连接需要在
    1、es上设置夸域
http.cors.enabled: true
http.cors.allow-origin: "*"

2、配置kibana 密码


不用设置密码: 注册后自动生成
1】是es的账户密码 1sWR1BpChhKDVmoyM-lW 用户名是 elastic(最高权限)
我们也可以通过 bin/elasticsearch-reset-password 来调整密码

./elasticsearch-reset-password -u 用户名 重置密码
./elasticsearch-reset-password --username 用户名 -i 修改指定用户密码
./elasticsearch-reset-password --username kibana_system 重置kibana密码
./elasticsearch-reset-password --url “https://host:port” --username ‘用户名’ -i
【2】kibana初始化与Es链接SSl的token 有效期30分钟 过期使用
.\elasticsearch-create-enrollment-token -s kibana 再次创建

3、启动kibana

修改yml 不需要你配置链接的es

server.port: 5601
server.host: "127.0.0.1"
启动

./kibana

只有不设置elasticsearch.hosts 才能看到这个界面哦

执行 重新生成token
./elasticsearch-create-enrollment-token -s kibana

curl 登录es

[es@localhost bin]$ curl -k -u elastic:zOc3x2QrDX6fK9gfy_BR  https://192.168.1.54:9200
{
  "name" : "localhost.localdomain",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "e3lMNTERS8qpKMkbp-ZEYw",
  "version" : {
    "number" : "8.3.3",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "801fed82df74dbe537f89b71b098ccaff88d2c56",
    "build_date" : "2022-07-23T19:30:09.227964828Z",
    "build_snapshot" : false,
    "lucene_version" : "9.2.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

k表示不需要认证

posted @ 2022-08-07 10:46  donghongchao  阅读(934)  评论(0编辑  收藏  举报