Kibana Basic for Ubuntu 16.04
- DEV COMMON
- 2018. 11. 1.
반응형
https://www.elastic.co/kr/downloads/kibana
sudo vim /etc/kibana/kibana.yml
server.host: "localhost"
elasticsearch.url: "http://localhost:9200"
sudo service elasticsearch start
sudo /usr/share/kibana/bin/kibana
log [17:29:05.172] [warning][admin][elasticsearch] No living connections
log [17:29:05.174] [warning][admin][elasticsearch] Unable to revive connection: http://localhost:9200/
netstat -a -n | grep tcp | grep 9200
tcp6 0 0 127.0.0.1:9200 :::* LISTEN
tcp6 0 0 ::1:9200 :::* LISTEN
sudo vim /etc/kibana/kibana.yml
#server.host: "localhost"
#elasticsearch.url: "http://localhost:9200"
netstat -a -n | grep tcp | grep 9200
tcp 0 0 127.0.0.1:58146 127.0.0.1:9200 TIME_WAIT
tcp6 0 0 127.0.0.1:9200 :::* LISTEN
tcp6 0 0 ::1:9200 :::* LISTEN
sudo /usr/share/kibana/bin/kibana
sudo iptables -F
sudo service elasticsearch start
netstat -a -n | grep tcp | grep 9200
tcp 0 0 127.0.0.1:58716 127.0.0.1:9200 TIME_WAIT
tcp6 0 0 127.0.0.1:9200 :::* LISTEN
tcp6 0 0 ::1:9200 :::* LISTEN
sudo vim /etc/kibana/kibana.yml
server.host: "localhost"
elasticsearch.url: "http://localhost:9200"
sudo /usr/share/kibana/bin/kibana
localhost:5601
curl -XDELETE localhost:9200/basketball
{"acknowledged":true}
curl -XPUT localhost:9200/basketball
{"acknowledged":true,"shards_acknowledged":true,"index":"basketball"}
touch basketball_mapping.json
{
"record" : {
"properties" : {
"team" : {
"type" : "text",
"fielddata" : true
},
"name" : {
"type" : "text",
"fielddata" : true
},
"points" : {
"type" : "long"
},
"rebounds" : {
"type" : "long"
},
"assists" : {
"type" : "long"
},
"blocks" : {
"type" : "long"
},
"submit_date" : {
"type" : "date",
"format" : "yyyy-MM-dd"
}
}
}
}
curl -XPUT 'localhost:9200/basketball/record/_mapping?pretty' -H 'Content-Type: application/json' -d @basketball_mapping.json
{
"acknowledged" : true
}
touch bulk_basketball.json
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "1" } }
{"team" : "Golden States Warriors","name" : "Stephen Curry", "points" : 30,"rebounds" : 3,"assists" : 4, "blocks" : 5, "submit_date" : "2016-10-11"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "2" } }
{"team" : "Golden States Warriors","name" : "Stephen Curry","points" : 32,"rebound" : 5,"assist" : 8, "blocks" : 5, "submit_date" : "2016-10-13"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "3" } }
{"team" : "Golden States Warriors","name" : "Stephen Curry","points" : 28,"rebound" : 2,"assist" : 3, "blocks" : 1, "submit_date" : "2016-10-17"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "4" } }
{"team" : "Golden States Warriors","name" : "Stephen Curry","points" : 36,"rebound" : 1,"assist" : 2, "blocks" : 1, "submit_date" : "2016-11-20"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "5" } }
{"team" : "Golden States Warriors","name" : "Stephen Curry","points" : 36,"rebound" : 1,"assist" : 2, "blocks" : 1, "submit_date" : "2016-11-25"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "6" } }
{"team" : "Golden States Warriors","name" : "Stephen Curry","points" : 32,"rebound" : 1,"assist" : 4, "blocks" : 1, "submit_date" : "2016-11-28"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "7" } }
{"team" : "Utah Jazz","name" : "Rudy Gobert", "points" : 3,"rebounds" : 11,"assists" : 4, "blocks" : 7, "submit_date" : "2016-10-12"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "8" } }
{"team" : "Utah Jazz","name" : "Rudy Gobert","points" : 4,"rebound" : 13,"assist" : 8, "blocks" : 5, "submit_date" : "2016-10-14"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "9" } }
{"team" : "Utah Jazz","name" : "Rudy Gobert","points" : 8,"rebound" : 10,"assist" : 3, "blocks" : 6, "submit_date" : "2016-10-18"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "10" } }
{"team" : "Utah Jazz","name" : "Rudy Gobert","points" : 12,"rebound" : 9,"assist" : 2, "blocks" : 6, "submit_date" : "2016-11-10"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "11" } }
{"team" : "Utah Jazz","name" : "Rudy Gobert","points" : 12,"rebound" : 14,"assist" : 2, "blocks" : 7, "submit_date" : "2016-11-22"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "12" } }
{"team" : "Utah Jazz","name" : "Rudy Gobert","points" : 8,"rebound" : 10,"assist" : 4, "blocks" : 5, "submit_date" : "2016-11-27"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "13" } }
{"team" : "Washington Wizards","name" : "John Wall","points" : 8,"rebound" : 1,"assist" : 13, "blocks" : 2, "submit_date" : "2016-10-18"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "14" } }
{"team" : "Washington Wizards","name" : "John Wall","points" : 13,"rebound" : 2,"assist" : 12, "blocks" : 3, "submit_date" : "2016-11-10"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "15" } }
{"team" : "Washington Wizards","name" : "John Wall","points" : 15,"rebound" : 3,"assist" : 12, "blocks" : 3, "submit_date" : "2016-11-22"}
{ "index" : { "_index" : "basketball", "_type" : "record", "_id" : "16" } }
{"team" : "Washington Wizards","name" : "John Wall","points" : 22,"rebound" : 4,"assist" : 14, "blocks" : 3, "submit_date" : "2016-11-27"}
curl -XPOST 'localhost:9200/_bulk?pretty' -H 'Content-Type: application/json' --data-binary @bulk_basketball.json
{
"took" : 157,
"errors" : false,
"items" : [
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "1",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "2",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "3",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "4",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "5",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "6",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "7",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "8",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "9",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "10",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 3,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "11",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "12",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 4,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "13",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "14",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "15",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 3,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "basketball",
"_type" : "record",
"_id" : "16",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 3,
"_primary_term" : 1,
"status" : 201
}
}
]
}
localhost:5601 > management > index pattern > basketball > submit_data (time field)
localhost:5601 > discover > time filter (quick, relative, absolute ...) and each documents' table, json click filter...
localhost:5601 > visualize > bar chart, pie charts ....
curl -XPUT 'http://localhost:9200/classes?pretty'
{
"acknowledged" : true,
"shards_acknowledged" : true,
"index" : "classes"
}
curl -XPUT localhost:9200/classes/class/_mapping?pretty -H 'Content-Type: application/json' -d @classesRating_mapping.json
{
"acknowledged" : true
}
curl -XPUT localhost:9200/_bulk?pretty -H 'Content-Type: application/json' --data-binary @classes.json
{
"took" : 113,
"errors" : false,
"items" : [
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "1",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "2",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "3",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "5",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "6",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "7",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "8",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "9",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "10",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 3,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "11",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "12",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 4,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "13",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "14",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "15",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "16",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 3,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "17",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "18",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 4,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "19",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 1,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "20",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 3,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "21",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 5,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "22",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "23",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 3,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "24",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 3,
"_primary_term" : 1,
"status" : 201
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "25",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 4,
"_primary_term" : 1,
"status" : 201
}
}
]
}
localhost:5601 > management > create index pattern > classes > time filter field name > submit_date > maps > coordinate map > classes > geo coordinates > geo hash > field > school_location
dashboard > load saved charts
반응형
'DEV COMMON' 카테고리의 다른 글
IntelliJ 단축키 (0) | 2018.12.23 |
---|---|
ELK and Filebeat, Curator, Backup to S3 (0) | 2018.11.02 |
Logstash Basic for Ubuntu16.04 (0) | 2018.11.02 |
ElasticSearch Basic for Ubuntu 16.04 (0) | 2018.10.30 |
install mariadb with homebrew on mac (0) | 2018.08.02 |