ELK集群(kibana)

知识点总结

ES集群

ELK

kibana 安装

json

Restful API

http method

[root@es1 ~]# /usr/share/elasticsearch/bin/plugin list

Installed plugins in /usr/share/elasticsearch/plugins:

- bigdesk

- kopf

- head

[root@es1 ~]# systemctl start elasticsearch

[root@es1 ~]# curl -XPUT 'http://192.168.6.13:9200/tedu/' -d \

> '{

> "settings":{

> "index":{

> "number_of_shards": 5,

> "number_of_replicas": 1

> }

> }

> }'

{"acknowledged":true}[root@es1 ~]#

[root@es1 ~]#

[root@es1 ~]#

//增加数据

[root@es1 ~]# curl -XPUT "http://192.168.6.11:9200/nsd1803/teacher/2" -d \

> '{

> "title": "阶段2",

> "name": {"first":"老逗比", "last":"丁丁"},

> "age":52

> }'

{"_index":"nsd1803","_type":"teacher","_id":"2","_version":1,"_shards":{"total":2,"successful":2,"failed":0},"created":true}[root@es1 ~]#

[root@es1 ~]#

[root@es1 ~]# curl -XPUT "http://192.168.6.11:9200/nsd1803/teacher/3" -d '{

"title": "阶段1",

"name": {"first":"tt", "last":"丁丁"},

"age":52

}'

{"_index":"nsd1803","_type":"teacher","_id":"3","_version":1,"_shards":{"total":2,"successful":2,"failed":0},"created":true}[root@es1 ~]#

//更改数据

[root@es1 ~]# curl -XPOST "http://192.168.6.11:9200/nsd1803/teacher/3/_update" -d \

> '{

> "doc": {"age":1}

> }'

{"_index":"nsd1803","_type":"teacher","_id":"3","_version":2,"_shards":{"total":2,"successful":2,"failed":0}}[root@es1 ~]#

//查询与删除

[root@es1 ~]# curl -XGET "http://192.168.6.11:9200/nsd1803/teacher/3?pretty"

{

"_index" : "nsd1803",

"_type" : "teacher",

"_id" : "3",

"_version" : 2,

"found" : true,

"_source" : {

"title" : "阶段1",

"name" : {

"first" : "tt",

"last" : "丁丁"

},

"age" : 1

}

}

[root@es1 ~]# curl -XDELETE "http://192.168.6.11:9200/nsd1803/teacher/2?pretty"

{

"found" : true,

"_index" : "nsd1803",

"_type" : "teacher",

"_id" : "2",

"_version" : 2,

"_shards" : {

"total" : 2,

"successful" : 2,

"failed" : 0

}

}

删除

[root@es1 ~]# curl -XDELETE "http://192.168.6.11:9200/nsd1803"

{"acknowledged":true}[root@es1 ~]#

[root@es1 ~]# curl -XDELETE "http://192.168.6.11:9200/*"

{"acknowledged":true}[root@es1 ~]#

sed 's/demo/node6/' demo.xml > /etc/libvirt/qemu/node6.xml

vim node6.xml

[root@rootroom9pc01 qemu]# virsh define /etc/libvirt/qemu/node6.xml

[root@rootroom9pc01 images]# qemu-img create -b node.qcow2 -f qcow2 node6.img 20G

[root@es5 ~]# scp /etc/yum.repos.d/local.repo 192.168.6.136:/etc/yum.repos.d/

[root@kibana ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

ONBOOT=yes

IPV6INIT=no

BOOTPROTO=static

TYPE=Ethernet

IPADDR="192.168.6.10"

NETMASK="255.255.255.0"

GATEWAY="192.168.6.254"

[root@kibana ~]# hostnamectl set-hostname kibana

[root@kibana ~]# vim /opt/kibana/config/kibana.yml

server.port: 5601

server.host: "0.0.0.0"

elasticsearch.url: "http://es1:9200"

kibana.index: ".kibana"

kibana.defaultAppId: "discover"

elasticsearch.pingTimeout: 1500

elasticsearch.requestTimeout: 30000

elasticsearch.startupTimeout: 5000

[root@kibana ~]# systemctl start kibana

[root@kibana ~]# systemctl status kibana

grep -pv “^(#|$)” kibana.yml

猜你喜欢

转载自blog.csdn.net/weixin_40018205/article/details/81263680