Elasticsearch 7.0 中還引入了一個新的聚合來處理地理地圖圖塊,允許用戶在地圖上放大和縮小,而不會改變結果數據的形狀,實現更加平滑地縮放 Elastic Maps;使用納秒精度存儲時序數據的時間戳,允許具有高頻數據采集需求的用戶可以更加精確地存儲和排序他們的數據
詳情查看發布公告
https://www.elastic.co/cn/blog/elastic-stack-7-0-0-released
一,系統環境查看及軟件版本選擇
系統環境查看

軟件版本選擇
elasticsearch-7.4.0-x86_64.rpm filebeat-7.4.0-x86_64.rpm kibana-7.4.0-x86_64.rpm logstash-7.4.0.rpm metricbeat-7.4.0-x86_64.rpm jdk 1.8.0_171
二,安裝配置
安裝jdk環境不詳述
官方網站下載對應軟件包
安裝elasticsearch
rpm -ivh elasticsearch-7.4.0-x86_64.rpm
修改配置文件
/etc/elasticsearch/elasticsearch.yml
配置如下
cluster.name: myes node.name: node-1 path.data: /var/lib/elasticsearch path.logs: /data/es-data network.host: 0.0.0.0 http.port: 9200 #集群設置,必須設置否則無法啟動elasticsearch cluster.initial_master_nodes: ["node-1"]
創建es數據文件夾並設置權限
mkdir -p /data/es-data chown -R elasticsearch:elasticsearch /data/es-data/
啟動es
systemctl start elasticsearch systemctl enable elasticsearch
測試
# curl http://127.0.0.1:9200
{
"name" : "node-1",
"cluster_name" : "myes",
"cluster_uuid" : "lEHaDsPGQ6CHL71yHX4oig",
"version" : {
"number" : "7.4.0",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "22e1767283e61a198cb4db791ea66e3f11ab9910",
"build_date" : "2019-09-27T08:36:48.569419Z",
"build_snapshot" : false,
"lucene_version" : "8.2.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
安裝kibana
rpm -ivh kibana-7.4.0-x86_64.rpm
修改配置文件
/etc/kibana/kibana.yml
配置如下
server.port: 5601 server.host: "0.0.0.0" server.name: "node-1" elasticsearch.hosts: ["http://192.168.1.5:9200"] kibana.index: ".kibana"
啟動kibana
systemctl start kibana systemctl enable kibana
web頁面查看比老版本多了maps
http://192.168.1.5:5601

為了測試maps功能安裝一個能收集地理數據filebeat進行測試
安裝filebeat
rpm -ivh filebeat-7.4.0-x86_64.rpm
修改配置文件把filebeat輸出至elasticsearch和kibana
/etc/filebeat/filebeat.yml
配置如下
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 1
setup.kibana:
host: "192.168.1.4:5601"
output.elasticsearch:
hosts: ["192.168.1.4:9200"]
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
開啟nginx模塊
filebeat modules enable nginx
查看是否開啟
# filebeat modules list Enabled: nginx Disabled: apache auditd
修改配置文件設置nginx日志文件位置
/etc/filebeat/modules.d/nginx.yml
配置如下分別指定nginx訪問日志和錯誤日志位置即可
- module: nginx
access:
enabled: true
var.paths:
- "/nas/nas/logs/nginx/www_access.log"
error:
enabled: true
var.paths:
- "/nas/nas/logs/nginx/www_error.log"
啟動filebeat
systemctl start filebeat systemctl enable filebeat filebeat setup
三,Elastic Maps
打開kibana新建一個maps
選擇菜單欄maps新建一個maps
默認包含map圖層
添加一個圖層layer


設置該圖層屬性


顯示效果圖

新加一個圖層把中國顯示與其他國家區別




最終效果圖如下

