您的位置:首页 > 数据库 > MySQL

Elasticsearch配合mysql实现全文搜索(一) 安装Elasticsearch

2018-02-03 09:51 706 查看
需要下载的东西

Elasticsearch:

https://www.elastic.co/products/elasticsearch

我目前用的是6.1.3最新版本

Logstash:

https://www.elastic.co/products/logstash

同样要对应Elasticsearch的6.1.3版本

mysql-connector:
https://dev.mysql.com/downloads/file/?id=474257


前置条件:需要安装jdk,并配置了 JAVA_HOME

开始安装 Elasticsearch

服务器说明 

最低 4G内存, 

如果更低的内存 请自行更改 config/jvm.xx 文件中的配置


注意:因安全性考虑,es不要用root用户安装

增加一个hadoop的用户 可参考这篇文章 http://blog.csdn.net/hsl_1990_08_15/article/details/50449507

1.使用源码安装

cd /opt

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.3.tar.gz
tar zxvf elasticsearch-6.1.3.tar.gz

2.环境变量设置 

vim /etc/profile.d/elasticsearch.sh

export
ES_HOME=/opt/elasticsearch-6.1.3

export
PATH=$ES_HOME/bin:$PATH

3.使之生效

./etc/profile

./etc/bashrc

4.配置

cd /opt/elasticsearch-6.1.3/config

vi elasticsearch.yml

增加配置

network.host:192.168.0.1 如需局域网访问

增加以下参数 这样head插件可以访问es

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

5.启动

cd elasticsearch目录

bin/elasticsearch     #前台运行

bin/elasticsearch -d  #后台运行

6.查看
http://localhost:9200/
或者

curl -X GET http://localhost:9200

7.启动时常见报错可参靠以下文章
http://blog.csdn.net/qq942477618/article/details/53414983 http://blog.csdn.net/weini1111/article/details/60468068
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  elasticsearch Logstash