es下载地址:https://www.elastic.co/downloads/past-releases
kibana下载地址:https://www.elastic.co/downloads/past-releases
声明:在此,下载的es和kibana都是6.0.0版本的tar包,本文章测试用的是centos 6.7系统的单台服务器,linux服务器非root用户:hadoop用户。
安装包和所在路径:
解压es和kibana,并修改配置:
[hadoop@es01 soft]$ tar -zxvf elasticsearch-6.0.0.tar.gz -C ../app
[hadoop@es01 soft]$ tar -zxvf kibana-6.0.0-linux-x86_64.tar.gz -C ../app/
app目录和soft目录是同级,app目录是用来装软件的,soft目录是用来放安装包的
在此,我对解压后的目录做了软连接:
[hadoop@es01 app]$ ln -s elasticsearch-6.0.0/ elasticsearch
[hadoop@es01 app]$ ln -s kibana-6.0.0-linux-x86_64/ kibana
进入配置目录:
[hadoop@es01 app]$ cd elasticsearch/config/
[hadoop@es01 config]$ pwd
/home/hadoop/app/elasticsearch/config
修改elasticsearch.yml文件:
在此我只修改了:network.host配置,改成你的ip就好,并放开http:port注释
然后启动es:
[hadoop@es01 elasticsearch]$ bin/elasticsearch
会看到报错信息
[hadoop@es01 elasticsearch]$ bin/elasticsearch
[2018-09-27T15:58:56,695][WARN ][o.e.b.JNANatives ] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:341) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.SystemCallFilter.init(SystemCallFilter.java:616) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.JNANatives.tryInstallSystemCallFilter(JNANatives.java:258) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Natives.tryInstallSystemCallFilter(Natives.java:113) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:109) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:322) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:130) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:121) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:69) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) [elasticsearch-6.0.0.jar:6.0.0]
[2018-09-27T15:58:56,962][INFO ][o.e.n.Node ] [] initializing ...
[2018-09-27T15:58:57,236][INFO ][o.e.e.NodeEnvironment ] [LsiyWR0] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [11.6gb], net total_space [17.1gb], types [rootfs]
[2018-09-27T15:58:57,236][INFO ][o.e.e.NodeEnvironment ] [LsiyWR0] heap size [990.7mb], compressed ordinary object pointers [true]
[2018-09-27T15:58:57,263][INFO ][o.e.n.Node ] node name [LsiyWR0] derived from node ID [LsiyWR0tQWOX8YZTiXyEaA]; set [node.name] to override
[2018-09-27T15:58:57,263][INFO ][o.e.n.Node ] version[6.0.0], pid[4127], build[8f0685b/2017-11-10T18:41:22.859Z], OS[Linux/2.6.32-573.el6.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_73/25.73-b02]
[2018-09-27T15:58:57,264][INFO ][o.e.n.Node ] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/home/hadoop/app/elasticsearch, -Des.path.conf=/home/hadoop/app/elasticsearch/config]
[2018-09-27T15:58:58,493][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [aggs-matrix-stats]
[2018-09-27T15:58:58,493][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [analysis-common]
[2018-09-27T15:58:58,493][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [ingest-common]
[2018-09-27T15:58:58,493][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [lang-expression]
[2018-09-27T15:58:58,493][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [lang-mustache]
[2018-09-27T15:58:58,494][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [lang-painless]
[2018-09-27T15:58:58,494][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [parent-join]
[2018-09-27T15:58:58,494][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [percolator]
[2018-09-27T15:58:58,494][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [reindex]
[2018-09-27T15:58:58,495][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [repository-url]
[2018-09-27T15:58:58,495][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [transport-netty4]
[2018-09-27T15:58:58,495][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [tribe]
[2018-09-27T15:58:58,495][INFO ][o.e.p.PluginsService ] [LsiyWR0] no plugins loaded
[2018-09-27T15:59:02,340][INFO ][o.e.d.DiscoveryModule ] [LsiyWR0] using discovery type [zen]
[2018-09-27T15:59:03,980][INFO ][o.e.n.Node ] initialized
[2018-09-27T15:59:03,980][INFO ][o.e.n.Node ] [LsiyWR0] starting ...
[2018-09-27T15:59:04,278][INFO ][o.e.t.TransportService ] [LsiyWR0] publish_address {192.168.106.235:9300}, bound_addresses {192.168.106.235:9300}
[2018-09-27T15:59:04,298][INFO ][o.e.b.BootstrapChecks ] [LsiyWR0] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2018-09-27T15:59:04,332][INFO ][o.e.n.Node ] [LsiyWR0] stopping ...
[2018-09-27T15:59:04,414][INFO ][o.e.n.Node ] [LsiyWR0] stopped
[2018-09-27T15:59:04,414][INFO ][o.e.n.Node ] [LsiyWR0] closing ...
[2018-09-27T15:59:04,428][INFO ][o.e.n.Node ] [LsiyWR0] closed
[hadoop@es01 elasticsearch]$
去修改elasticsearch.yml文件,加入下面两个配置:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
再启动时会如报下错误信息:
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
max number of threads [1024] for user [elsearch] is too low, increase to at least [4096]
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
那么切换到root用户,去修改/etc/security/limits.conf 文件
[root@es01 config]# vi /etc/security/limits.conf
加入以下配置,其中hadoop是你的用户名
hadoop soft nofile 65536
hadoop hard nofile 131072
hadoop soft nproc 4096
hadoop hard nproc 4096
再修改配置文件/etc/sysctl.conf,添加如下内容
vm.max_map_count=655360
执行:sysctl -p
然后再启es,ok,启来了....
[hadoop@es01 elasticsearch]$ bin/elasticsearch
[2018-09-27T16:09:31,222][INFO ][o.e.n.Node ] [] initializing ...
[2018-09-27T16:09:31,310][INFO ][o.e.e.NodeEnvironment ] [LsiyWR0] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [11.6gb], net total_space [17.1gb], types [rootfs]
[2018-09-27T16:09:31,310][INFO ][o.e.e.NodeEnvironment ] [LsiyWR0] heap size [990.7mb], compressed ordinary object pointers [true]
[2018-09-27T16:09:31,333][INFO ][o.e.n.Node ] node name [LsiyWR0] derived from node ID [LsiyWR0tQWOX8YZTiXyEaA]; set [node.name] to override
[2018-09-27T16:09:31,333][INFO ][o.e.n.Node ] version[6.0.0], pid[4255], build[8f0685b/2017-11-10T18:41:22.859Z], OS[Linux/2.6.32-573.el6.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_73/25.73-b02]
[2018-09-27T16:09:31,334][INFO ][o.e.n.Node ] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/home/hadoop/app/elasticsearch, -Des.path.conf=/home/hadoop/app/elasticsearch/config]
[2018-09-27T16:09:32,283][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [aggs-matrix-stats]
[2018-09-27T16:09:32,284][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [analysis-common]
[2018-09-27T16:09:32,284][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [ingest-common]
[2018-09-27T16:09:32,284][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [lang-expression]
[2018-09-27T16:09:32,284][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [lang-mustache]
[2018-09-27T16:09:32,284][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [lang-painless]
[2018-09-27T16:09:32,284][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [parent-join]
[2018-09-27T16:09:32,284][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [percolator]
[2018-09-27T16:09:32,284][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [reindex]
[2018-09-27T16:09:32,285][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [repository-url]
[2018-09-27T16:09:32,285][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [transport-netty4]
[2018-09-27T16:09:32,285][INFO ][o.e.p.PluginsService ] [LsiyWR0] loaded module [tribe]
[2018-09-27T16:09:32,285][INFO ][o.e.p.PluginsService ] [LsiyWR0] no plugins loaded
[2018-09-27T16:09:33,786][INFO ][o.e.d.DiscoveryModule ] [LsiyWR0] using discovery type [zen]
[2018-09-27T16:09:34,807][INFO ][o.e.n.Node ] initialized
[2018-09-27T16:09:34,808][INFO ][o.e.n.Node ] [LsiyWR0] starting ...
[2018-09-27T16:09:35,290][INFO ][o.e.t.TransportService ] [LsiyWR0] publish_address {192.168.106.235:9300}, bound_addresses {192.168.106.235:9300}
[2018-09-27T16:09:35,310][INFO ][o.e.b.BootstrapChecks ] [LsiyWR0] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2018-09-27T16:09:38,445][INFO ][o.e.c.s.MasterService ] [LsiyWR0] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {LsiyWR0}{LsiyWR0tQWOX8YZTiXyEaA}{FbIZ2CzIQw2bYSqklo5pMw}{192.168.106.235}{192.168.106.235:9300}
[2018-09-27T16:09:38,453][INFO ][o.e.c.s.ClusterApplierService] [LsiyWR0] new_master {LsiyWR0}{LsiyWR0tQWOX8YZTiXyEaA}{FbIZ2CzIQw2bYSqklo5pMw}{192.168.106.235}{192.168.106.235:9300}, reason: apply cluster state (from master [master {LsiyWR0}{LsiyWR0tQWOX8YZTiXyEaA}{FbIZ2CzIQw2bYSqklo5pMw}{192.168.106.235}{192.168.106.235:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2018-09-27T16:09:38,481][INFO ][o.e.h.n.Netty4HttpServerTransport] [LsiyWR0] publish_address {192.168.106.235:9200}, bound_addresses {192.168.106.235:9200}
[2018-09-27T16:09:38,481][INFO ][o.e.n.Node ] [LsiyWR0] started
[2018-09-27T16:09:39,049][INFO ][o.e.g.GatewayService ] [LsiyWR0] recovered [3] indices into cluster_state
[2018-09-27T16:09:39,799][INFO ][o.e.c.r.a.AllocationService] [LsiyWR0] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[school][0]] ...]).
然后去浏览器中输入:ip:9200,出现如下信息,说明启成功!
下一步,我们来安装kibana:
进入kibana目录
修改配置文件,在此我放开并修改如下配置:
启动kibani:
[hadoop@es01 kibana]$ bin/kibana
在 浏览器中输入:ip:5601
这里面的内容是我的测试数据,进入kibana界面后,会提示一个没有设置默认的index的提示,不要慌张,你可以新建一个所引并设置为默认所引。