(一)elasticsearch6.1.1安装详细过程

1、配置java环境

检查java环境

满足elasticsearch6.1.1java环境要求;

2、安装ElasticSearch6.1.1

①为es新生成用户、用户组

su root
groupadd esgroup
useradd ela -g esgroup -p 5tgbhu8

[root@localhost fibonacci]# su ela
Attempting to create directory /home/ela/perl5
[ela@localhost fibonacci]$ 

②进入ela用户工作目录,将elasticsearch-6.1.1,kibana-6.1.1,x-pck-6.1.1拷到工作目录待用,注意版本号必须一模一样,否则会出错;

[ela@localhost Work]$ ls
elasticsearch-6.1.1.tar.gz  kibana6.1.1.gz  x-pack-6.1.1.zip

③解压elasticsearch-6.1.1.tar.gz,拷贝到/opt中;

tar -zxvf elasticsearch-6.1.1.tar.gz
[ela@localhost Work]$ ls
elasticsearch-6.1.1  elasticsearch-6.1.1.tar.gz  kibana6.1.1.gz  x-pack-6.1.1.zip
[ela@localhost Work]$ su root
Password: 
[root@localhost Work]# cp  -r elasticsearch-6.1.1 /opt/
cd /opt/
chown -R ela:esgroup elasticsearch-6.1.1/

④试运行elasticsearch;

[ela@localhost opt]$ cd /opt/elasticsearch-6.1.1/
[ela@localhost elasticsearch-6.1.1]$ bin/elasticsearch

运气比较好,这次成功了,如下出现started表示elasticsearch运行成功:

[2019-11-22T10:06:57,893][INFO ][o.e.n.Node               ] [nwkzLZ5] started
[2019-11-22T10:06:57,898][INFO ][o.e.g.GatewayService     ] [nwkzLZ5] recovered [0] indices into cluster_state

使用curl在本机(虚拟机)测试一下成功如下:

[fibonacci@localhost ~]$ curl 127.0.0.1:9200
{
  "name" : "nwkzLZ5",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "EYzfoBkET_q85hsPsVzIDQ",
  "version" : {
    "number" : "6.1.1",
    "build_hash" : "bd92e7f",
    "build_date" : "2017-12-17T20:23:25.338Z",
    "build_snapshot" : false,
    "lucene_version" : "7.1.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

要想在其它计算机上可以访问虚拟机数据库,就要简单设置配置文件:

在/opt/elasticsearch-6.1.1/config中找到elasticsearch.yml,简单设置elasticsearch配置文件,实现局域网其它机器可以访问该elasticsearch;

# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.1.211
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.

配置完这个就出现下面的问题了:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值