elasticsearch-5安装配置维护

2台5.X版本的作ES集群用于Skywalking服务调用链路跟踪管理
 
系统环境:centos7.5
es版本:elasticsearch-5
jdk:1.8
主机ip
192.168.2.129
192.168.2.130

1、软件下载
cd /usr/local/
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.3.tar.gz

2、jdk安装
wget ftp://10.249.100.249/pub/jdk/jdk8/*

3、安装es
tar -zxvf elasticsearch-5.6.3.tar.gz
mv elasticsearch-5.6.3/ elasticsearch

4、建立data目录和log目录
mkdir -p /data/elasticsearch/data
mkdir -p /data/elasticsearch/logs

5、建立用户(es不能用root运行)
useradd es
chown -R es:es /usr/local/elasticsearch
chown -R es:es /data


6、系统参数优化
vim /usr/local/elasticsearch/config/jvm.options
-Xms4g
-Xmx4g

vi /etc/sysctl.conf
    vm.max_map_count=655360
    fs.file-max=655360


vi /etc/security/limits.conf
    es         soft   memlock      unlimited
    es        hard   memlock      unlimited
    
7、编辑配置文件
[root@ip-192-168-2-129 ~]# grep '^[a-z]' /usr/local/elasticsearch/config/elasticsearch.yml
cluster.name: es5.6.3
node.name: node-129
node.master: true
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.2.129", "192.168.2.130"]
gateway.recover_after_nodes: 1
http.cors.enabled: true
http.cors.allow-origin: "*"

[root@ip-192-168-2-130 ~]# grep '^[a-z]' /usr/local/elasticsearch/config/elasticsearch.yml
cluster.name: es5.6.3
node.name: node-130
node.master: true
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.2.129", "192.168.2.130"]
gateway.recover_after_nodes: 1
http.cors.enabled: true
http.cors.allow-origin: "*"

8、启动
分别启动两台服务
su - es -c "/usr/local/elasticsearch/bin/elasticsearch &"

9、head插件安装
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
unzip elasticsearch-5.6.3.tar.gz
cd elasticsearch-head-master

10、安装node
curl -sL -o /etc/yum.repos.d/khara-nodejs.repo https://copr.fedoraproject.org/coprs/khara/nodejs/repo/epel-7/khara-nodejs-epel-7.repo
yum install -y nodejs nodejs-npm


11、安装grunt
cd /usr/lib/node_modules/npm/
npm install grunt-cli
npm install grunt

12、修改配置
修改vim Gruntfile.js文件:增加hostname属性,设置为*

connect: {
    server: {
        options: {
            port: 9100,
            hostname: '*',
            base: '.',
            keepalive: true
        }
    }
}

修改 vim _site/app.js 文件:修改head的连接地址
this.base_uri = this.config.base_uri || this.prefs.get(“app-base_uri”) || “http://localhost:9200“;
修改成ElasticSearch的机器地址
this.base_uri = this.config.base_uri || this.prefs.get(“app-base_uri”) || “http://192.168.2.130:9200“;

12、启动head
cd /usr/local/elasticsearch-head-master/node_modules/.bin
cd /usr/local/elasticsearch-head-master/node_modules/.bin/
./grunt server & 

13、网页访问
http://192.168.2.129:9100
http://192.168.2.130:9100
如果出现集群连不上的状态:https://www.cnblogs.com/wendu/p/6549806.html

14、设置开机启动
su - es -c "/usr/local/elasticsearch/bin/elasticsearch -d"
cd /usr/local/elasticsearch-head-master/node_modules/.bin/
./grunt server &

==========================================
参考手册http://www.mamicode.com/info-detail-873117.html
https://blog.csdn.net/xshy3412/article/details/51841270
这个是两个节点http://www.bubuko.com/infodetail-1847606.html
https://blog.csdn.net/chenxun_2010/article/details/78437852

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Elasticsearch是一个开源的分布式搜索和分析引擎,它被广泛应用于全文搜索、日志分析、数据可视化等领域。下面是Elasticsearch各版本的主要特性介绍: 1. Elasticsearch 1.x系列: - 分布式搜索引擎:支持水平扩展,可以将数据分布在多个节点上进行并行处理。 - 实时数据索引和搜索:支持实时索引和搜索,可以快速响应用户的查询请求。 - 多种查询类型:支持全文搜索、精确匹配、范围查询、模糊查询等多种查询方式。 - 分布式聚合功能:支持按照不同的条件对数据进行聚合操作,如求和、平均值、最大值、最小值等。 - 支持多种数据类型:支持文本、数字、日期等多种数据类型的索引和搜索。 2. Elasticsearch 2.x系列: - 文档型数据存储:引入了新的文档型数据存储方式,提高了索引和搜索的性能。 - 查询优化:对查询进行了优化,提高了搜索的速度和准确性。 - 安全性增强:引入了基于角色的访问控制机制,提供了更加灵活和安全的权限管理功能。 - 支持更多语言:增加了对中文、日文等非拉丁字符的支持。 3. Elasticsearch 5.x系列: - 索引模板:引入了索引模板的概念,可以定义索引的结构和设置默认的分析器等。 - 集群监控和管理:提供了更加全面和直观的集群监控和管理功能,方便管理员进行集群的维护和管理。 - SQL查询:支持使用SQL语句进行查询,方便开发人员使用熟悉的SQL语法进行数据检索。 - 增强的聚合功能:引入了新的聚合功能,如直方图、百分比等,提供更多灵活的数据分析能力。 4. Elasticsearch 6.x系列: - 索引生命周期管理:引入了索引生命周期管理功能,可以自动管理索引的创建、删除和归档等操作。 - 安全性增强:进一步增强了安全性功能,支持基于SSL/TLS的通信加密和身份验证。 - 支持更多数据类型:增加了对地理位置数据、IP地址数据等更多数据类型的支持。 5. Elasticsearch 7.x系列: - 索引分片优化:对索引分片进行了优化,提高了索引和搜索的性能。 - 引入ILM(Index Lifecycle Management):提供了更加灵活和可配置的索引生命周期管理功能。 - 引入CCR(Cross Cluster Replication):支持跨集群的数据复制和同步,提高了数据的可用性和容灾能力。 - 引入EQL(Elasticsearch Query Language):支持使用类似SQL的语法进行复杂的查询操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值