ubuntu安装elasticsearch及head插件

1.安装elasticsearch,参考http://www.cnblogs.com/hanyinglong/p/5409003.html就可以了

简单描述下:

mkdir -p /usr/local/kencery/elasticsearch
groupadd elasticsearch
useradd -d /usr/local/kencery/elasticsearch -g elasticsearch -p elasticsearch elasticsearch

然后将tar包解压到elasticsearch目录下就可以了,我下载的版本是elasticsearch-6.2.4.tar.gz

启动时直接在bin目录下执行:./elasticsearch

有两个问题注意下,一是不要用root用户执行,二是有可能会遇到错误:

[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

参考https://blog.csdn.net/jiankunking/article/details/65448030修改下/etc/sysctl.conf,记得改下elasticsearch.yml中的network.host以及端口配置,重启后就可以访问了:http://192.168.141.13:9200/

name    "4tlNeHN"
cluster_name    "elasticsearch"
cluster_uuid    "BYwLfhswS8O2y-WYXAKUsA"
version
number    "6.2.4"
build_hash    "ccec39f"
build_date    "2018-04-12T20:37:28.497551Z"
build_snapshot    false
lucene_version    "7.2.1"
minimum_wire_compatibility_version    "5.6.0"
minimum_index_compatibility_version    "5.0.0"
tagline    "You Know, for Search"

2.安装elasticsearch-head,这里敲下黑板,真的很麻烦,如果不了解,花费大半天时间也是很正常的,这里就直接说下最后成功的办法

2.1 elasticsearch 5.x之后不支持直接plugin安装head插件,而是将head作为一个独立的服务安装的,首先需要安装依赖的node,npm,grunt,参考https://blog.csdn.net/hard_boy/article/details/79565068,我是以root执行的,稍微有点不同:

apt-get install npm
apt-get install nodejs-legacy
npm install -g grunt
npm install -g grunt-cli

下载elasticsearch-head,我解压到目录/usr/local/kencery/elasticsearch-head,将目录用户改为elasticsearch

2.2 然后修改配置

2.2.1 修改head的连接地址 elasticsearch-head/_site/app.js

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";  

将localhost改为自己的ip

2.2.2 修改服务器的监听地址elasticsearch-head/Gruntfile.js

connect: {
               server: {
                   options: {
                       port: 9100,
                       base: ‘.‘,
                       keepalive: true
                   }
               }
           }  

options中添加 hostname: ‘*‘

2.2.3 修改elasticseach的配置文件elasticsearch.yml, 修改对应的ip以及跨域的设置,添加:

http.cors.enabled: true

http.cors.allow-origin: "*"

2.3 在elasticsearch-head下运行: grunt server

2.3.1 但是会出现错误提示(当时命令敲的npm start,应该是一样的):

[email protected]:/usr/local/kencery/elasticsearch-head# npm start

> elasticsearch-head@0.0.0 start /usr/local/kencery/elasticsearch-head
> grunt server

grunt-cli: The grunt command line interface (v1.2.0)

Fatal error: Unable to find local grunt.

If you‘re seeing this message, grunt hasn‘t been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:

http://gruntjs.com/getting-started

npm ERR! Linux 4.4.0-62-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! elasticsearch-head@0.0.0 start: `grunt server`
npm ERR! Exit status 99
npm ERR!
npm ERR! Failed at the elasticsearch-head@0.0.0 start script ‘grunt server‘.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the elasticsearch-head package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs elasticsearch-head
npm ERR! Or if that isn‘t available, you can get their info via:
npm ERR!     npm owner ls elasticsearch-head
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/kencery/elasticsearch-head/npm-debug.log

看提示大概有提到版本不是最新的问题,所以就抱着试一试的心态去升级npm以及node

参考https://www.cnblogs.com/ae6623/p/6242423.html

npm cache clean -f
npm install -g n
n stable
npm install [email protected] -g

再查看下版本,会看到

[email protected]:~$ node -v
v10.4.0
[email protected]:~$ npm -v
6.1.0

2.3.2 但是运行grunt server依然报错:

grunt hasn‘t been installed locally to your project

参考https://segmentfault.com/q/1010000004172559/a-1020000004193932,执行:

npm install grunt --save-dev

2.3.3 再次运行,依然报错:

[email protected]:/usr/local/kencery/elasticsearch-head$ grunt server
>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Warning: Task "connect:server" not found. Use --force to continue.

然后我干脆把有关grunt的都装了一遍最新的:

npm install [email protected]
npm install grunt-[email protected]
npm install grunt-contrib-[email protected]
npm install grunt-contrib-[email protected]
npm install grunt-contrib-[email protected]
npm install grunt-contrib-[email protected]
npm install grunt-contrib-[email protected]
npm install grunt-contrib-[email protected]
npm install [email protected]

2.3.4 最后grunt server终于可以启动了:

[email protected]:/usr/local/kencery/elasticsearch-head$ grunt server
(node:1527) ExperimentalWarning: The http2 module is an experimental API.
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

可以看到elasticsearch服务的端口是9200,head插件服务的端口是9100,我们访问head然后head再访问的elasticsearch。

可以新建索引试一下:

状态yellow还是有一些问题,并不影响使用,对于ES也只是刚接触,并没多少了解,后续使用过程中遇到问题再作纪录。

参考文章:

1.http://www.cnblogs.com/hanyinglong/p/5409003.html

2.https://blog.csdn.net/jiankunking/article/details/65448030

3.https://blog.csdn.net/hard_boy/article/details/79565068

4.https://www.cnblogs.com/ae6623/p/6242423.html

5.https://segmentfault.com/q/1010000004172559/a-1020000004193932

原文地址:https://www.cnblogs.com/shanhm1991/p/9903866.html

时间: 2024-10-06 00:22:43

ubuntu安装elasticsearch及head插件的相关文章

Ubuntu安装NRPE(Nagios插件)报:Cannot find ssl headers解决方法!

Linux系统:Ubuntu 12.04 Nagios Linux客户端需要安装NRPE进行数据收集,如果在Ubuntu系统下安装过程中遇到下面的错误提示:checking for SSL libraries... configure: error: Cannot find ssl libraries 那么可能是缺少sudo apt-get install opensslsudo apt-get install libssl-dev 如果nrpe-2.15# ./configure   还是一样

ubuntu安装elasticsearch

测试环境: Ubuntu x86_64 3.13.0-35-generic 安装jre: $ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java7-installer 加入 Elasticsearch 官方源并安装 elasticsearch $

ubuntu安装firefox的flash插件

1.下载插件 https://get.adobe.com/cn/flashplayer/ 下载tar.gz文件 2.解压缩 切换到下载目录,如果是默认下载的话,用 cd ~/下载/解压缩下载的文件 tar -zxvf install_flash_player_11_linux.x86_64.tar.gz 3.安装 将对应的文档复制到正确的的位置即可: cp libflashplayer.so /usr/lib/mozilla/plugins/ cp -r ./usr/* /usr/

windows安装elasticsearch和elasticsearch-head插件

1.去官网下载最新软件 选择zip包,https://www.elastic.co/downloads/elasticsearch 2.下载node 必须 > 6.0已上 3.解压elasticsearch压缩包 4.修改config下的elasticsearch.yml 注意:每个":"后都必须有个空格 5.去 https://github.com/mobz/elasticsearch-head  下载head插件 插件放到plugins目录文件下 6 原文地址:https:/

Windows中安装Elasticsearch

链接:https://pan.baidu.com/s/1-EsuGaw0_9ubw5_9AhRS2Q 提取码:1hp4 一,Elasticsearch环境准备 elasticsearch-5.6.8.zip进行解压(安装目录随意) 启动服务: 访问http://127.0.0.1:9200,显示如下: 表明elasticsearch启动成功. 二,安装ES图形化界面插件 安装ElasticSearch的head插件,完成图形化界面的效果,完成索引数据的查看.采用本地安装方式进行head插件的安装

Elasticsearch 中文分词插件 jcseg 安装 (Ubuntu 14.04 下)

搜索可以说是开发中很常见的场景了,同样这次也一样... 之前的组合多数是选择 Mysql + Sphinx ,这次因为工作原因不再使用这种组合,虽然是老牌组合,但是确实限制诸多,而且每次配环境也是个问题,挺烦的...这次就尝试使用 Elasticsearch + Jcseg ,因为在文档检索方面 elasticsearch 做的相当不错,但是对中文环境来说就差一个很好的中文分词器,还好,国内好的中文分词器也有蛮多,但是我个人还是比较推荐 Jcseg . 好了,废话不多扯. 版本说明: elast

ElasticSearch之常用插件安装命令

#head监控安装,推荐 bin/plugin -install mobz/elasticsearch-head #bigdesk集群状态,推荐 bin/plugin -install lukas-vlcek/bigdesk #marvel监控安装 bin/plugin -i elasticsearch/marvel/latest #es-sql安装,网页内有详细说明 https://github.com/NLPchina/elasticsearch-sql #jdbc-river安装(rive

Ubuntu 16.04 下安装Firefox的Flash插件

Ubuntu 16.04 下安装Firefox的Flash插件 在ubuntu系统环境下面打开优酷视频,发现无法播放视频.Adobe Flash Player 是一款轻量级浏览器插件,具有丰富的 Internet 应用运行时间,提供持续的迷人用户体验.绝妙的音频/视频回放效果和刺激的游戏. 虽然flash早晚会被html5代替,但目前还是不少网站在用,正好研究一下怎么安装flash插件,在优酷的提示下,点击进入Adobe Flash Player的下载页面: 选择.tar.gz的包, 下载后解压

Ubuntu 14.04 下手动安装Firefox的Flash插件

有时候我们需要在Ubuntu下采用手动安装一些软件,比如Firefox的Flash插件.Adobe® Flash® Player 是一款轻量级浏览器插件,具有丰富的 Internet 应用运行时间,提供持续的迷人用户体验.绝妙的音频/视频回放效果和刺激的游戏. Flash Player 已在超过 13 亿系统中安装,是提供高度集成且丰富的 Web 内容的标准应用. 相关阅读: Ubuntu 14.04 下载.安装.配置 整理汇总 页面 http://www.linuxidc.com/Linux/