知识点总结

ES集群

ELK

kibana 安装

json

Restful API

http method

 

 

[[email protected] ~]# /usr/share/elasticsearch/bin/plugin list

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

- bigdesk

- kopf

- head

[[email protected] ~]# systemctl start elasticsearch

[[email protected] ~]# curl -XPUT 'http://192.168.6.13:9200/tedu/' -d \

> '{

> "settings":{

> "index":{

> "number_of_shards": 5,

> "number_of_replicas": 1

> }

> }

> }'

{"acknowledged":true}[[email protected] ~]#

[[email protected] ~]#

[[email protected] ~]#

//增加数据

[[email protected] ~]# 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}[[email protected] ~]#

[[email protected] ~]#

[[email protected] ~]# 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}[[email protected] ~]#

//更改数据

[[email protected] ~]# 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}}[[email protected] ~]#

 

//查询与删除

[[email protected] ~]# 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

}

}

[[email protected] ~]# 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

}

}

删除

[[email protected] ~]# curl -XDELETE "http://192.168.6.11:9200/nsd1803"

{"acknowledged":true}[[email protected] ~]#

 

[[email protected] ~]# curl -XDELETE "http://192.168.6.11:9200/*"

{"acknowledged":true}[[email protected] ~]#

 

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

vim node6.xml

[[email protected] qemu]# virsh define /etc/libvirt/qemu/node6.xml

[[email protected] images]# qemu-img create -b node.qcow2 -f qcow2 node6.img 20G

[[email protected] ~]# scp /etc/yum.repos.d/local.repo 192.168.6.136:/etc/yum.repos.d/

[[email protected] ~]# 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"

[[email protected] ~]# hostnamectl set-hostname kibana

[[email protected] ~]# 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

[[email protected] ~]# systemctl start kibana

[[email protected] ~]# systemctl status kibana

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ELK集群(kibana)

 

 

 

 

 

 

相关文章: