【Es+Kibana】es和kibana部署安裝

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的提示,不要慌張,你可以新建一個所引並設置爲默認所引。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章