linux中安装elasticsearch5.6.8及其组件/插件
2018-03-09 10:17
1731 查看
安装elasticsearch568
安装插件及其他组件
安装head
安装kibana
安装x-pack插件
注:为了节约时间,这篇博客就只写操作,就不做过多解释了;
windows中安装见:
elasticsearch体验——在windows10上安装配置以及插件安装配置
github上elasticsearch的doc链接
elastic上guide链接
1.tar -zxvf elasticsearch-5.6.8.tar.gz elasticsearch-5.6.8
2.修改配置文件elasticsearch.yml
3.执行脚本./bin/elasticsearch
4.很久无反应,然后报错
5.useradd elasticsearch -s /bin/bash
6.passwd elasticsearch
7.chown -R elasticsearch:elasticsearch /usr/local/elasticsearch-5.6.8/data /usr/local/elasticsearch-5.6.8/logs
8.chown -R elasticsearch:elasticsearch ../elasticsearch-5.6.8
9.su elasticsearch
10.重新执行启动脚本,等待,然后报错:
弹性搜索过程的最大文件描述符[4096]太低
用户[elasticsearch]的最大线程数[1024]太低,增加到至少[2048]
最大虚拟内存区域vm.max_map_count [65530]太低,增加到至少[262144]
以下引自官网:https://www.elastic.co/guide/en/elasticsearch/reference/master/max-number-of-threads.html
Elasticsearch uses a number of thread pools for different types of operations. It is important that it is able to create new threads whenever needed. Make sure that the number of threads that the Elasticsearch user can create is at least 4096.
This can be done by setting ulimit -u 4096 as root before starting Elasticsearch, or by setting nproc to 4096 in /etc/security/limits.conf.
所以:
11.切换回root,在文件末尾添加:(永久性修改)
我所做的修改如下:
前两个问题:
elasticsearch - nofile 65536
elasticsearch - nproc 2048
第三个问题:
临时设置:sudo sysctl -w vm.max_map_count=262144
永久设置,在etc/sysctl.conf中添加:
vm.max_map_count=262144
sysctl -p更新
第四个问题:
在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
对参数有不解的,注意limits.conf文件的开头描述
12.切换为elasticsearch用户重新启动
又报错:
13.切换用户,修改指定的文件权限
chown elasticsearch.elasticsearch ./logs/sxdx-elasticStack.log
(后来发觉这种办法不行,以后更新该文件时,还是会更新为root用户)
暂时
14.切换为elasticsearch用户重新启动
ok,并且启动速度还很快
15.web端口检查
16.要将Elasticsearch作为守护程序运行,请在命令行中指定-d,并使用-p选项将进程ID记录到文件中:
执行:./bin/elasticsearch -d
查看:ps aux | grep elasticsearch
杀死进程:kill ‘pid’——比如这里:kill ‘26601’
5.6.x版本的插件doc链接
对于Elasticsearch 5.x:不支持网站head插件。head作为独立服务器运行
对于head,我感觉最方便的是直接在Chrome中安装插件:
https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm/
尝试成功,能访问到:
方法2:
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
open HTTP://本地主机:9100 /
更多方法请点击这里
使用测试:
1.1创建索引:
1.2插入数据:
1.3删除索引:
1.4其他:TODO(待改天单独学习head中curl使用)
注:
事实上5.6版本的插件安装方式应该是使用elasticsearch-plugin脚本。[1]
插件有警报插件X-pack,分析插件,脚本插件等:
kibana在6.0之后,只支持64位系统。
kibana的doc链接:kibana user guide 5.6
2.1 kibana简介
Kibana是一个开源的分析和可视化平台,旨在与Elasticsearch合作。您可以使用Kibana来搜索、查看存储在Elasticsearch索引中的数据并与其进行交互。您可以轻松地执行高级数据分析,并在各种图表、表格中对您的数据可视化。
Kibana简单的、基于浏览器的界面使您能够快速创建和共享动态仪表板,实时显示Elasticsearch查询的变化。
2.2安装
其实还是原汁原味的官网的解释最好了:
https://www.elastic.co/guide/en/kibana/current/targz.html
可通过压缩包安装,也可以使用wget安装。
下载好压缩包之后
2.2.1解压:
tar -xzf kibana-5.6.8-linux-x86_64.tar.gz
mv kibana-5.6.8-linux-x86_64/* ./share/kibana-5.6.8/
2.2.2设置kibana.yml
基本够用的话,设置以下几项就行:
server.port
server.host
server.name
elasticsearch.url
更多:设置详情见这里
2.2.3启动并验证
启动elasticsearch
bin/kibana启动kibana
localhost:5601端口验证
可通过./kibana-5.6.8/bin/kibana -h查看帮助
2.2.3后台运行kibana(或者说作为服务运行)
有人说如果你通过deb / rpm安装kibana,它会自动创建init脚本,这样你就可以用service kibana start/ 来启动/停止service kibana stop。
nohup命令可以将程序以忽略挂起信号的方式运行起来,被运行的程序的输出信息将不会显示到终端。
无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中。如果当前目录的 nohup.out 文件不可写,输出重定向到$HOME/nohup.out文件中。(不大好,这里有人指出)
因为我是tar包安装,所以暂时将就着使用&(感觉很不专业。。。)
来安装该插件(会自动匹配elasticsearch的版本);
还可以通过把压缩包放在plugins文件夹下,然后这样安装:
3.1报错
~TODO~
2018/3/13
项目决定暂时先用外部检索api,自己开发检索api会告一段落。
安装插件及其他组件
安装head
安装kibana
安装x-pack插件
安装elasticsearch5.6.8
windows安装elasticsearch5.6.8及其插件见:注:为了节约时间,这篇博客就只写操作,就不做过多解释了;
windows中安装见:
elasticsearch体验——在windows10上安装配置以及插件安装配置
github上elasticsearch的doc链接
elastic上guide链接
1.tar -zxvf elasticsearch-5.6.8.tar.gz elasticsearch-5.6.8
2.修改配置文件elasticsearch.yml
3.执行脚本./bin/elasticsearch
4.很久无反应,然后报错
[2018-03-08T22:14:14,176][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.8.jar:5.6.8] Caused by: java.lang.RuntimeException: can not run elasticsearch as root at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.8.jar:5.6.8] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.8.jar:5.6.8] ... 6 more
5.useradd elasticsearch -s /bin/bash
6.passwd elasticsearch
7.chown -R elasticsearch:elasticsearch /usr/local/elasticsearch-5.6.8/data /usr/local/elasticsearch-5.6.8/logs
8.chown -R elasticsearch:elasticsearch ../elasticsearch-5.6.8
9.su elasticsearch
10.重新执行启动脚本,等待,然后报错:
ERROR: [4] bootstrap checks failed [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] [2]: max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048] [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] [4]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
弹性搜索过程的最大文件描述符[4096]太低
用户[elasticsearch]的最大线程数[1024]太低,增加到至少[2048]
最大虚拟内存区域vm.max_map_count [65530]太低,增加到至少[262144]
以下引自官网:https://www.elastic.co/guide/en/elasticsearch/reference/master/max-number-of-threads.html
Elasticsearch uses a number of thread pools for different types of operations. It is important that it is able to create new threads whenever needed. Make sure that the number of threads that the Elasticsearch user can create is at least 4096.
This can be done by setting ulimit -u 4096 as root before starting Elasticsearch, or by setting nproc to 4096 in /etc/security/limits.conf.
所以:
11.切换回root,在文件末尾添加:(永久性修改)
我所做的修改如下:
前两个问题:
elasticsearch - nofile 65536
elasticsearch - nproc 2048
第三个问题:
临时设置:sudo sysctl -w vm.max_map_count=262144
永久设置,在etc/sysctl.conf中添加:
vm.max_map_count=262144
sysctl -p更新
第四个问题:
在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
对参数有不解的,注意limits.conf文件的开头描述
12.切换为elasticsearch用户重新启动
又报错:
FileNotFoundException: /usr/local/elasticsearch-5.6.8/logs/sxdx-elasticStack.log (Permission denied)
13.切换用户,修改指定的文件权限
chown elasticsearch.elasticsearch ./logs/sxdx-elasticStack.log
(后来发觉这种办法不行,以后更新该文件时,还是会更新为root用户)
暂时
14.切换为elasticsearch用户重新启动
ok,并且启动速度还很快
15.web端口检查
16.要将Elasticsearch作为守护程序运行,请在命令行中指定-d,并使用-p选项将进程ID记录到文件中:
执行:./bin/elasticsearch -d
查看:ps aux | grep elasticsearch
杀死进程:kill ‘pid’——比如这里:kill ‘26601’
安装插件及其他组件
1.安装head
(注意,其实安装head插件的说法不正确)5.6.x版本的插件doc链接
对于Elasticsearch 5.x:不支持网站head插件。head作为独立服务器运行
对于head,我感觉最方便的是直接在Chrome中安装插件:
https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm/
尝试成功,能访问到:
方法2:
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
open HTTP://本地主机:9100 /
更多方法请点击这里
使用测试:
1.1创建索引:
1.2插入数据:
1.3删除索引:
1.4其他:TODO(待改天单独学习head中curl使用)
注:
事实上5.6版本的插件安装方式应该是使用elasticsearch-plugin脚本。[1]
插件有警报插件X-pack,分析插件,脚本插件等:
2.安装kibana
注意,如果要安装X-Pack,建议先安装kibanakibana在6.0之后,只支持64位系统。
kibana的doc链接:kibana user guide 5.6
2.1 kibana简介
Kibana是一个开源的分析和可视化平台,旨在与Elasticsearch合作。您可以使用Kibana来搜索、查看存储在Elasticsearch索引中的数据并与其进行交互。您可以轻松地执行高级数据分析,并在各种图表、表格中对您的数据可视化。
Kibana简单的、基于浏览器的界面使您能够快速创建和共享动态仪表板,实时显示Elasticsearch查询的变化。
2.2安装
其实还是原汁原味的官网的解释最好了:
https://www.elastic.co/guide/en/kibana/current/targz.html
可通过压缩包安装,也可以使用wget安装。
下载好压缩包之后
2.2.1解压:
tar -xzf kibana-5.6.8-linux-x86_64.tar.gz
mv kibana-5.6.8-linux-x86_64/* ./share/kibana-5.6.8/
2.2.2设置kibana.yml
基本够用的话,设置以下几项就行:
server.port
server.host
server.name
elasticsearch.url
更多:设置详情见这里
2.2.3启动并验证
启动elasticsearch
bin/kibana启动kibana
localhost:5601端口验证
可通过./kibana-5.6.8/bin/kibana -h查看帮助
2.2.3后台运行kibana(或者说作为服务运行)
有人说如果你通过deb / rpm安装kibana,它会自动创建init脚本,这样你就可以用service kibana start/ 来启动/停止service kibana stop。
nohup命令可以将程序以忽略挂起信号的方式运行起来,被运行的程序的输出信息将不会显示到终端。
无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中。如果当前目录的 nohup.out 文件不可写,输出重定向到$HOME/nohup.out文件中。(不大好,这里有人指出)
因为我是tar包安装,所以暂时将就着使用&(感觉很不专业。。。)
3.安装x-pack插件
由上面[1]可知,我们可以使用bin/elasticsearch-plugin install x-pack
来安装该插件(会自动匹配elasticsearch的版本);
还可以通过把压缩包放在plugins文件夹下,然后这样安装:
sudo bin/elasticsearch-plugin install file:///path/to/plugin.zip
3.1报错
Exception in thread "main" java.net.UnknownHostException: artifacts.elastic.co
~TODO~
2018/3/13
项目决定暂时先用外部检索api,自己开发检索api会告一段落。
相关文章推荐
- linux(centos 7)下安装elasticsearch - head插件(端口占用,防火墙关闭)
- ElasticSearch及其插件的安装(二)
- Elasticsearch6.0及其head插件安装
- ElasticSearch之Windows和Linux安装及插件
- Linux下的暴力密码在线破解工具Hydra安装及其组件安装-使用
- windows 下安装elasticsearch 及其插件head,ik,marvel
- elasticsearch插件安装之--linux下安装及head插件
- Linux安装ElasticSearch-2.2.0-分词器插件(Mmseg)
- 【转】Linux VIM编辑器及其插件安装
- 19-linux下ElasticSearch.6.2.1与head、Kibana、X-Pack、SQL、IK、PINYIN插件的配置安装
- 基于Debian的Linux发行版安装深度音乐及其插件,支持ubunut16
- Linux下安装Eclipse及其插件
- Elasticsearch6.0及其head插件安装
- Elasticsearch 2.3.5 部署安装以及插件(Linux)
- 在Linux安装elasticsearch的head插件
- elasticsearch插件安装之--linux下安装及head插件
- linux下pycharm及其插件ideaVim的安装
- 20-linux下ElasticSearch.6.2.2集群安装与head、Kibana、X-Pack..插件的配置安装
- Linux下安装PHP的插件Yaf及其代码生成
- Elasticsearch安装及其插件安装