材料准备
https://github.com/NLPchina/elasticsearch-sql/releases/download/5.1.2.0/elasticsearch-sql-5.1.2.0.zip
https://github.com/mobz/elasticsearch-head/tree/master
https://github.com/mobz/elasticsearch-head/archive/master.zip
[[email protected] ~]# cd /opt
[[email protected] opt]# ls -l
total 13116
drwxr-xr-x 9 root root 4096 Jan 29 2016 collectd
drwxr-xr-x 8 hadoop hadoop 4096 Apr 9 2016 elasticsearch-2.0.0-rc1
drwxr-xr-x 9 hadoop hadoop 4096 Apr 15 2016 elasticsearch-2.1.1
drwxr-xr-x 7 root root 4096 Nov 24 2015 flume1.6
drwxr-xr-x 7 root root 4096 Nov 23 2015 grafana-2.5.0
drwxr-xr-x 16 root root 4096 Dec 8 2015 hadoop
drwxr-xr-x 4 root root 4096 Dec 8 2015 hadoop_data
drwxr-xr-x 12 hadoop hadoop 4096 Jan 19 2016 httpd-2.2.23
drwxr-xr-x 3 influxdb influxdb 4096 Jan 29 2016 influxdb
drwxr-xr-x 7 root root 4096 Apr 27 2016 kafka_2.10-0.9.0.1
drwxrwxr-x 16 nagios nagios 4096 Dec 25 2015 nagios
drwxrwxrwx 16 10002 10002 4096 Dec 25 2015 nagios-plugins-1.4.13
drwxr-xr-x 22 root root 4096 Apr 9 2016 openssl-1.0.0e
drwxr-xr-x 3 root root 4096 Jan 25 2016 ORCLfmap
drwxr-xr-x 3 root root 4096 Apr 15 2016 path
drwxr-xr-x 17 nagios games 4096 Dec 25 2015 php-5.4.10
drwxrwxr-x 18 1000 1000 4096 Apr 9 2016 Python-2.6.6
-rw-r--r-- 1 root root 13318547 Apr 8 2016 Python-2.6.6.tgz
drwxr-xr-x 2 root root 4096 Apr 27 2016 soft
drwxr-xr-x 11 root root 4096 Apr 10 2016 storm096
-rw-r--r-- 1 root root 4628 Apr 10 2016 stormTest.jar
drwxr-xr-x 11 root root 4096 Apr 10 2016 zookeepe346
[[email protected] opt]# mkdir es5.0
[[email protected] opt]# ls
collectd es5.0 hadoop influxdb nagios-plugins-1.4.13 path Python-2.6.6.tgz
stormTest.jar elasticsearch-2.0.0-rc1 flume1.6 hadoop_data kafka_2.10-0.9.0.1 openssl-1.0.0e php-5.4.10 soft zookeepe346 elasticsearch-2.1.1 grafana-2.5.0 httpd-2.2.23 nagios ORCLfmap Python-2.6.6 storm096
[[email protected] opt]# cd es5.0/
[[email protected] es5.0]# ls
[[email protected] es5.0]# ls
elasticsearch-5.1.2.zip elasticsearch-head-master.zip elasticsearch-sql-5.1.2.0.zip
jdk-8u111-linux-x64.tar.gz
[[email protected] es5.0]# tar -zxvf jdk-8u111-linux-x64.tar.gz
[[email protected] es5.0]# ls
elasticsearch-5.1.2.zip elasticsearch-head-master.zip elasticsearch-sql-5.1.2.0.zip jdk1.8.0_111 jdk-8u111-linux-x64.tar.gz
[[email protected] es5.0]# unzip elasticsearch-5.1.2.zip
[[email protected] es5.0]# chmod -R hadoop:hadoop /opt/es5.0/*
chmod: invalid mode: `hadoop:hadoop'
Try `chmod --help' for more information.
[[email protected] es5.0]# chown -R hadoop:hadoop /opt/es5.0/*
[[email protected] es5.0]# ls -l
total 217032
drwxr-xr-x 7 hadoop hadoop 4096 Jan 11 20:21 elasticsearch-5.1.2
-rw-r--r-- 1 hadoop hadoop 33317437 Feb 24 03:52 elasticsearch-5.1.2.zip
-rw-r--r-- 1 hadoop hadoop 919566 Feb 24 03:47 elasticsearch-head-master.zip
-rw-r--r-- 1 hadoop hadoop 6304850 Feb 24 03:47 elasticsearch-sql-5.1.2.0.zip
drwxr-xr-x 8 hadoop hadoop 4096 Sep 22 16:27 jdk1.8.0_111
-rw-r--r-- 1 hadoop hadoop 181442359 Nov 3 08:46 jdk-8u111-linux-x64.tar.gz
[[email protected] es5.0]#
[[email protected] es5.0]# su - hadoop
[[email protected] ~]$ cd /opt/es5.0/elasticsearch-5.1.2/bin/
[[email protected] bin]$ ./elasticsearch
[[email protected] bin]$ ./elasticsearch
The system is going down for reboot NOW!
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported
major.minor version 52.0 -->JDK版本问题
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
命令格式: ln [参数][源文件或目录][目标文件或目录]
[[email protected] ~]# ln -s /opt/es5.0/jdk1.8.0_111/bin/java /usr/bin/java
[[email protected] ~]# whereis java
java: /usr/bin/java
[[email protected] ~]# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 32 Feb 24 13:36 /usr/bin/java -> /opt/es5.0/jdk1.8.0_111/bin/java
[[email protected] ~]#
[[email protected] ~]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
[[email protected] ~]#
[[email protected] ~]# su - hadoop
[[email protected] ~]$ mkdir -p /opt/es5.0/s/data
mkdir: cannot create directory `/opt/es5.0/s': Permission denied
[[email protected] ~]$ exit
logout
[[email protected] ~]# /opt/es5.0/s/data
-bash: /opt/es5.0/s/data: No such file or directory
[[email protected] ~]# mkdir -p /opt/es5.0/s/data
[[email protected] ~]# mkdir -p /opt/es5.0/s/log
[[email protected] ~]# chown -R hadoop:hadoop /opt/es5.0/*
[[email protected] ~]#
[[email protected] bin]$ ./elasticsearch
[2017-02-24T13:47:04,415][WARN ][o.e.b.JNANatives ] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
at org.elasticsearch.bootstrap.Seccomp.linuxImpl(Seccomp.java:349) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Seccomp.init(Seccomp.java:630) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.JNANatives.trySeccomp(JNANatives.java:215) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Natives.trySeccomp(Natives.java:99) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:176) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.Command.main(Command.java:88) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) [elasticsearch-5.1.2.jar:5.1.2]
[2017-02-24T13:47:09,012][INFO ][o.e.n.Node ] [node-1] initializing ...
[2017-02-24T13:47:09,512][INFO ][o.e.e.NodeEnvironment ] [node-1] using [1] data paths, mounts [[/ (/dev/hdc2)]], net usable_space [7gb], net total_space [17.1gb], spins? [possibly], types [ext3]
[2017-02-24T13:47:09,513][INFO ][o.e.e.NodeEnvironment ] [node-1] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-02-24T13:47:09,516][INFO ][o.e.n.Node ] [node-1] node name [node-1], node ID [EdHbn3S_Sxm4Cwz0pMxwRQ]
[2017-02-24T13:47:09,547][INFO ][o.e.n.Node ] [node-1] version[5.1.2], pid[6353], build[c8c4c16/2017-01-11T20:18:39.146Z], OS[Linux/2.6.18-128.el5/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_111/25.111-b14]
[2017-02-24T13:47:18,120][INFO ][o.e.p.PluginsService ] [node-1] loaded module [aggs-matrix-stats]
[2017-02-24T13:47:18,121][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-common]
[2017-02-24T13:47:18,122][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-expression]
[2017-02-24T13:47:18,123][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-groovy]
[2017-02-24T13:47:18,123][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-mustache]
[2017-02-24T13:47:18,123][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-painless]
[2017-02-24T13:47:18,124][INFO ][o.e.p.PluginsService ] [node-1] loaded module [percolator]
[2017-02-24T13:47:18,124][INFO ][o.e.p.PluginsService ] [node-1] loaded module [reindex]
[2017-02-24T13:47:18,124][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty3]
[2017-02-24T13:47:18,124][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty4]
[2017-02-24T13:47:18,126][INFO ][o.e.p.PluginsService ] [node-1] no plugins loaded
[2017-02-24T13:47:35,099][INFO ][o.e.n.Node ] [node-1] initialized
[2017-02-24T13:47:35,100][INFO ][o.e.n.Node ] [node-1] starting ...
[2017-02-24T13:47:35,940][INFO ][o.e.t.TransportService ] [node-1] publish_address {192.168.1.104:9300}, bound_addresses {192.168.1.104:9300}
[2017-02-24T13:47:35,948][INFO ][o.e.b.BootstrapCheck ] [node-1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
max file descriptors [1024] for elasticsearch process is too low, increase to at least [65536]
max virtual memory areas vm.max_map_count [65536] is too low, increase to at least [262144]
[2017-02-24T13:47:36,453][INFO ][o.e.n.Node ] [node-1] stopping ...
[2017-02-24T13:47:37,699][INFO ][o.e.n.Node ] [node-1] stopped
[2017-02-24T13:47:37,699][INFO ][o.e.n.Node ] [node-1] closing ...
[2017-02-24T13:47:38,127][INFO ][o.e.n.Node ] [node-1] closed
问题一:警告提示
[2016-11-06T16:27:21,712][WARN ][o.e.b.JNANatives ] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
at org.elasticsearch.bootstrap.Seccomp.linuxImpl(Seccomp.java:349) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Seccomp.init(Seccomp.java:630) ~[elasticsearch-5.0.0.jar:5.0.0]
报了一大串错误,其实只是一个警告。
解决:使用新linux版本kernel 3.5+,就不会出现此类问题了。
问题二:
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
解决:切换到root用户修改配置sysctl.conf
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p