[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fe7a22c213e2 logstash:5.6.14 "/usr/local/bin/do..." 3 seconds ago Up 2 seconds logstash
1151a8e3389e docker.io/kibana:5.6.14 "/docker-entrypoin..." 2 days ago Up 38 minutes 0.0.0.0:5601->5601/tcp kb
ea4a4e1869b4 elasticsearch:5.6.3 "/docker-entrypoin..." 2 days ago Up 38 minutes 9200/tcp, 0.0.0.0:9203->9203/tcp, 9300/tcp, 0.0.0.0:9303->9303/tcp es03
b6509178471a elasticsearch:5.6.3 "/docker-entrypoin..." 2 days ago Up 38 minutes 9200/tcp, 0.0.0.0:9202->9202/tcp, 9300/tcp, 0.0.0.0:9302->9302/tcp es02
4a49b0e5bc26 elasticsearch:5.6.3 "/docker-entrypoin..." 2 days ago Up 38 minutes 9200/tcp, 0.0.0.0:9201->9201/tcp, 9300/tcp, 0.0.0.0:9301->9301/tcp es01
554fb17a2947 elasticsearch-head:5 "/bin/sh -c 'grunt..." 2 days ago Up 38 minutes 0.0.0.0:9100->9100/tcp es-head
# 运行该指令nohup bin/logstash -f /usr/share/logstash/pipeline/logstash-simple.conf --path.data /var/log/1 &# 正常日志如下:[2019-01-15T07:46:13,586][INFO ][logstash.outputs.elasticsearch] Installing elasticsearch template to _template/logstash
[2019-01-15T07:46:13,606][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["//192.168.8.100:9201"]}[2019-01-15T07:46:13,607][INFO ][logstash.pipeline ] Starting pipeline {"id"=>"main", "pipeline.workers"=>6, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>750}[2019-01-15T07:46:13,706][INFO ][logstash.pipeline ] Pipeline main started
[2019-01-15T07:46:13,727][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9601}[2019-01-15T07:46:18,598][INFO ][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[http://192.168.8.100:9201/], :added=>[http://172.50.0.101:9201/, http://172.50.0.103:9203/, http://172.50.0.102:9202/]}}[2019-01-15T07:46:18,599][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://172.50.0.101:9201/, :path=>"/"}[2019-01-15T07:46:18,608][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://172.50.0.101:9201/"}[2019-01-15T07:46:18,613][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://172.50.0.103:9203/, :path=>"/"}[2019-01-15T07:46:18,628][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://172.50.0.103:9203/"}[2019-01-15T07:46:18,634][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://172.50.0.102:9202/, :path=>"/"}[2019-01-15T07:46:18,640][WARN ][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://172.50.0.102:9202/"}
#进入 kibana 容器[root@localhost ~]# docker exec -it kb bash
root@1151a8e3389e:/# ls
bin boot dev docker-entrypoint.sh etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
#查询 kibana-plugin 文件
root@1151a8e3389e:/# find / -name kibana-plugin
find: `/proc/acpi': Permission denied
find: `/proc/scsi': Permission denied
find: `/sys/firmware': Permission denied
/usr/share/kibana/bin/kibana-plugin
#进入目录
root@1151a8e3389e:/# cd /usr/share/kibana/
root@1151a8e3389e:/usr/share/kibana# ls
LICENSE.txt NOTICE.txt README.txt bin config node node_modules optimize package.json plugins src ui_framework webpackShims
#安装 x-pack
root@1151a8e3389e:/usr/share/kibana# bin/kibana-plugin install x-pack
Attempting to transfer from x-pack
Attempting to transfer from https://artifacts.elastic.co/downloads/kibana-plugins/x-pack/x-pack-5.6.14.zip
Transferring 119232732 bytes.............
Transfer complete
Retrieving metadata from plugin archive
Error: end of central directory record signature not found
at /usr/share/kibana/node_modules/yauzl/index.js:179:14
at /usr/share/kibana/node_modules/yauzl/index.js:539:5
at /usr/share/kibana/node_modules/fd-slicer/index.js:32:7
at FSReqWrap.wrapper [as oncomplete](fs.js:683:17)
Plugin installation was unsuccessful due to error "Error retrieving metadata from plugin archive"#会出现下载很慢,失败在继续安装
root@1151a8e3389e:/usr/share/kibana# bin/kibana-plugin install x-pack
Attempting to transfer from x-pack
Attempting to transfer from https://artifacts.elastic.co/downloads/kibana-plugins/x-pack/x-pack-5.6.14.zip
Transferring 119232732 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete
Optimizing and caching browser bundles...
Plugin installation complete
#返回宿主机 添加 {xpack.security.enabled: "false"} 网上说#但本人测试是报错的 { Error: EACCES: permission denied, open '/usr/share/kibana/optimize/bundles/graph.entry.js[root@localhost ~]# cat /home/es/kibana/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.url: "http://192.168.8.100:9201"
kibana.index: ".kibana"#xpack.security.enabled: "false"
重启 kibana 容器
[root@localhost ~]# docker restart kb
登录页面
默认分别是 elastic 和 changeme
http://192.168.8.100:5601 --> Monitoring模块查询节点曲线图
es容器 x-pack-5.6.14 下载和安装 (如果是集群,es01,es02都需要以下步骤)
#宿主机追加配置
[root@localhost ~]# cat /home/es/es01/elasticsearch.yml
cluster.name: elasticsearch-cluster
node.name: node-1
network.bind_host: 0.0.0.0
network.publish_host: 172.50.0.101
http.port: 9201
transport.tcp.port: 9301
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["172.50.0.101:9301","172.50.0.102:9302","172.50.0.103:9303"]
discovery.zen.minimum_master_nodes: 2
xpack.security.enabled: "false" # this
http.cors.allow-headers: "Authorization" # this
#进入容器
[root@localhost ~]# docker exec -it es03 bash
#运行安装
root@ea4a4e1869b4:/usr/share/elasticsearch# bin/elasticsearch-plugin install x-pack
-> Downloading x-pack from elastic
[=================================================] 100%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.io.FilePermission \\.\pipe\* read,write
* java.lang.RuntimePermission accessClassInPackage.com.sun.activation.registries
* java.lang.RuntimePermission getClassLoader
* java.lang.RuntimePermission setContextClassLoader
* java.lang.RuntimePermission setFactory
* java.security.SecurityPermission createPolicy.JavaPolicy
* java.security.SecurityPermission getPolicy
* java.security.SecurityPermission putProviderProperty.BC
* java.security.SecurityPermission setPolicy
* java.util.PropertyPermission * read,write
* java.util.PropertyPermission sun.nio.ch.bugLevel write
* javax.net.ssl.SSLPermission setHostnameVerifier
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.
Continue with installation? [y/N]y
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin forks a native controller @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This plugin launches a native controller that is not subject to the Java
security manager nor to system call filters.
Continue with installation? [y/N]y
-> Installed x-pack
重启 kibana 容器
[root@localhost ~]# docker restart es03