Linux下的安装和部署

ElasticSearch

@(数据库)[搜索, ES]

linux下ES的安装

官网https://www.elastic.co/cn/downloads/elasticsearch 
外部访问端口 9200 
节点间通信端口 9300 
此处安装的是6.3.1版本,不推荐安装最新版6.3.2,最新版在安装head插件时会有bug,导致head无法使用.

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1.tar.gz
# 解压
tar zxvf elasticsearch-6.3.1.tar.gz  
  • 1
  • 2
  • 3
  • 4

elasticsearch.yml配置文件的修改

# 打开配置文件 
vim conf/elasticsearch.yml
# 修改集群名称
cluster.name: my-application
# 修改节点名称
node.name: node-1
# 修改网络请求host,0.0.0.0可以被所有外网访问到
network.host: 0.0.0.0
#配置当前集群的所有节点信息
discovery.zen.ping.unicast.hosts: ["0.0.0.0"]
# 允许跨域,跨端口访问,设置后elasticsearch_head插件才可以访问到
http.cors.enabled: true
http.cors.allow-origin: "*"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

IK分词器的下载与安装

github地址https://github.com/medcl/elasticsearch-analysis-ik/releases 
ik的版本必须与es的版本一一对应

# 直接通过elasticsearch的plugin组件来安装IK插件    
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.3.1/elasticsearch-analysis-ik-6.3.1.zip
  • 1
  • 2
  • 3

es启动失败的问题处理

elaticsearch默认不能用root用户启动,所以会报java.lang.RuntimeException: can not run elasticsearch as root异常 
其它常见问题解决方案 https://blog.csdn.net/u010781176/article/details/79489151

    adduser es  #新建用户
    passwd es   #新建用户密码
    #文件夹归属组
    #chown -R [用户]:[所属组] 目录
    chown -R es:es elasticsearch-6.3.1/ 
    #修改文件夹权限
    chmod 770 elasticsearch-6.3.1/
    #切换到用户目录
    su es
    #重新执行成功
    ./elasticsearch -d
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

插件工具的下载与安装

Kabana安装与汉化

官网下载地址,版本号必须与对应的es版本匹配 https://www.elastic.co/downloads/past-releases 
端口号5601 
守护进程运行 nohup bin/kibana & 
查看当前端口被哪个进程占用 fuser -n tcp 5601

#下载kibana
wget https://artifacts.elastic.co/downloads/kibana/kibana-6.3.1-linux-x86_64.tar.gz
# 解压
tar zxvf kibana-6.3.1-linux-x86_64.tar.gz 
# 修改配置信息
vim conf/kibana.yml
server.host: "0.0.0.0"
elasticsearch.url: "http://localhost:9200"
# 进行中文汉化
git clone https://github.com/anbai-inc/Kibana_Hanization.git
cd Kibana_Hanization
python main.py ../kibana-6.3.1-linux-x86_64
#运行kibana服务
bin/kibana
#以守护进程运行 
nohup bin/kibana & 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

es_head向优秀学习   yxxy1717     2317384986

其它方式不好用了,直接用github上的地址 https://github.com/mobz/elasticsearch-head 
访问端口号9100 
不适用于最新ES版本6.3.2,连接存在bug

cd elasticsearch/plugins #切换到plugins目录下
git clone git://github.com/mobz/elasticsearch-head.git # 下载插件
yum install npm # 安装npm
cd elasticsearch-head
# 安装grunt插件
npm install -g grunt-cli 
# 在head目录下,运行head服务
grunt server
# 以守护进程的形式在后台运行

猜你喜欢

转载自blog.csdn.net/qq_42851004/article/details/82017093