打算上全文检索,就找到了找个产品,开始研究下……

1、官网地址:

https://www.elastic.co/guide/en/elasticsearch/reference/5.2/install-elasticsearch.html#install-elasticsearch

打算部署到Centos7 上,开始捣腾~

根据官方文档,注意两点

1、Centos5以前的不能RPM,可以选择zip 或者tar.gz的方式安装

2、这货需要java8 或者更高版本,这里推荐试用OpenJDK

首先查看目前系统中是否安装有,一般默认是有滴,我的centos7使用的最小安装,神马都木有的说,

查看java版本命令:

java -version

看到类似以上内容,说明已经装好了,PS:俺本地的虚拟机,

服务器输出:

[root@bogon ~]# java -version
-bash: java: command not found

表明这货是在裸奔中,好吧,打开OpenJDK官网:

http://openjdk.java.net/install/

找到如下内容:

执行下面命令:(我是root用户)

yum install java-1.8.0-openjdk

下载并安装 public signing key:

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

在/etc/yum.repos.d/ 目录下新建 文件 elasticsearch.repo,

cd /etc/yum.repos.d/

vi elasticsearch.repo
输入以下内容并保存:
[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
执行安装命令:
yum install elasticsearch


选择以systemd 方式运行:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service 可以使用下面命令启动和停止elasticsearch:

Elasticsearch can be started and stopped as follows:


sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service
 
如上图,查看日志的路径和安装插件的路径
安装head 插件
官网:http://mobz.github.io/elasticsearch-head/

根据官网命令试了几次,发现命令是错误的,最后在github上华丽丽的给提交了一下,不知道会不会被采纳,

官网地址:https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/installation.html

下面是截图:

 命令应该修改为:(在bin上层目录中执行下面命令,定位到默认路径:/usr/share/elasticsearch/ 执行下面命令即可)
./bin/elasticsearch-plugin install analysis-icu
我是直接在bin 目录里执行的,如下图:

安装elasticsearch-head 插件,官网恨坑爹,没有说5.X版本后不支持插件形式,在github 上有说明:

https://github.com/mobz/elasticsearch-head

好吧,我们只能独立安装了~ 下图是官网上独立安装的步骤,不过对于裸机来说,首先需要安装git

1、安装git

yum -y install git

2、安装 grunt

npm install -g grunt-cli

然后执行上面的命令进行安装,npm 没有安装的童鞋可以参考我以前的文章,安装nodejs

安装完以后并没有连接到es上,需要进行配置,看官网截图:

修改elasticsearch.yml 文件:

vi /etc/elasticsearch/elasticsearch.yml

在文件最后加入以下内容:

http.cors.enabled: true
http.cors.allow-origin: "*"

修改elasticsearch-head 配置:

vi Gruntfile.js

里面内容比较多,增加:hostname: '*',

这点内容参考:http://www.cnblogs.com/xing901022/p/6030296.html

最近在搭建centos7.3 + elasticsearch5.5 的时候,使用root用户,发现一些问题,不能启动,查找了网上一些资料,大多是新建用户来解决的,配置很麻烦,如果想使用root用户,请按以下方式修改配置文件:

vi /etc/sysconfig/elasticsearch

  

重点就在这里,官网文档写的很清楚,默认用户是 elasticsearch

增加新用户来启动ES5,请参考这篇文章,作者有图有真相,确实会提示缺少config 文件的,官网也有说明

http://www.cnblogs.com/yswenli/p/6397351.html

安装IK中文分词插件:

https://github.com/medcl/elasticsearch-analysis-ik

定位到es目录:

cd /usr/share/elasticsearch/

运行安装命令:

./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.5.1/elasticsearch-analysis-ik-5.5.1.zip

 重启ES5

说明:IK 分词插件的版本要和ES版本完全一致,否则会报错。

centos7.2 安装 Elasticsearch5.2的更多相关文章

  1. 在Centos7中安装elasticsearch5.5

    在Centos7中安装elasticsearch5.5 第一步:必须要有jre支持 elasticsearch是用Java实现的,跑elasticsearch必须要有jre支持,所以必须先安装jre ...

  2. centos7虚拟机安装elasticsearch5.0.x-安装篇

    https://blog.csdn.net/u012371450/article/details/51776505 请预先安装jdk 创建新用户(非root用户)elasticsearch只能用非ro ...

  3. centos7.2环境elasticsearch-5.0.1+kibana-5.0.1+zookeeper3.4.6+kafka_2.9.2-0.8.2.1部署详解

    centos7.2环境elasticsearch-5.0.1+kibana-5.0.1+zookeeper3.4.6+kafka_2.9.2-0.8.2.1部署详解 环境准备: 操作系统:centos ...

  4. 在centos7上安装Jenkins

    在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...

  5. CentOS7 Jenkins安装

    CentOS7 Jenkins安装 CentOS7 Jenkins安装 Download 从Jenkins下载apache-tomcat-8.0.18.tar.gz Install 安装 上传RPM文 ...

  6. 在 CentOS7 上安装 zookeeper-3.4.9 服务

    在 CentOS7 上安装 zookeeper-3.4.9 服务 1.创建 /usr/local/services/zookeeper 文件夹: mkdir -p /usr/local/service ...

  7. 在 CentOS7 上安装 MongoDB

    在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...

  8. 在 CentOS7 上安装 MySQL5.7

    在 CentOS7 上安装 MySQL5.7 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建 ...

  9. 在 CentOS7 上安装 Tomcat9

    在 CentOS7 上安装 Tomcat9 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目 ...

随机推荐

  1. Hive不等值连接

    select * from ( select t1.instalment_id as r_id , t2.instalment_id as p_id from (select instalment_i ...

  2. 【云计算】Docker build解决父镜像层级关系过多问题:Cannot create container with more than 127 parents

    docker export 8a6e92c71a77 > malakas.tzr.gz cat malakas.tzr.gz|docker import - /nscloud/malakas:1 ...

  3. Hadoop端口一览表

    Hadoop端口一览表 @(Hadoop) 端口名 用途 50070 Hadoop Namenode UI端口 50075 Hadoop Datanode UI端口 50090 Hadoop Seco ...

  4. 【java】Could not find or load main class

    https://stackoverflow.com/questions/18093928/what-does-could-not-find-or-load-main-class-mean A comm ...

  5. 转: Android中的签名机制

    转载请注明出处:http://www.blogjava.net/zh-weir/archive/2011/07/19/354663.html Android APK 签名比对 发布过Android应用 ...

  6. Lina Group

    var query = from ll in proListRequestList group ll by new {ll.pro_id} into g select new ProListReque ...

  7. vue - check-versions.js for child_process

    webpack之类的配置文件. webpack.base.conf.js

  8. vfork & fork

    转载 http://coolshell.cn/articles/12103.html 在知乎上,有个人问了这样的一个问题——为什么vfork的子进程里用return,整个程序会挂掉,而且exit()不 ...

  9. hibernate 关系映射之 单向外键关联一对一

    这里的关系指的是对象与对象之间的关系 注解方式单向关联一对一: //这个类描述的husband是一个对应一个wife的 import javax.persistence.Entity; import ...

  10. ZOJ - 3725 Painting Storages

    Description There is a straight highway with N storages alongside it labeled by 1,2,3,...,N. Bob ask ...