shell> cd /data/software
shell> tar zxvf elasticsearch-7.4.0.tar.gz -C /data/opt/
shell> cd /data/opt/
shell> ln -s elasticsearch-7.4.0 elasticsearch
shell> mkdir -p /elastic/{data,logs}
shell> vim /etc/profile.d/java.sh
JAVA_HOME=/data/opt/elasticsearch/jdk
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
shell> cat /etc/security/limits.conf
# ES
croot - memlock unlimited
croot - nofile 65536
* - as unlimited
* - fsize unlimited
* - nofile 65535
* - memlock 65535
* - stack 65535
* - nproc 65535
shell> cat /etc/sysctl.conf
#增加
vm.max_map_count = 262144
shell> sysctl -p
shell> cd /data/opt/elasticsearch
shell> cat config/elasticsearch.yml
cluster.name: LBC-ELK
node.name: es-node-1
path.data: /elastic/data
path.logs: /elastic/logs
bootstrap.memory_lock: true
network.host: 10.XXX.XXX.115
http.port: 9200
discovery.seed_hosts:["10.XXX.XXX.115","10.XXX.XXX.116","10.XXX.XXX.117"]
shell> cat config/jvm. Options
-Xms30g
-Xmx30g
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-Des.networkaddress.cache.ttl=60
-Des.networkaddress.cache.negative.ttl=10
-XX:+AlwaysPreTouch
-Xss1m
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true
-XX:-OmitStackTraceInFastThrow
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0
-Dio.netty.allocator.numDirectArenas=0
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true
-Djava.io.tmpdir=${ES_TMPDIR}
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=logs
-XX:ErrorFile=logs/hs_err_pid%p.log
8:-XX:+PrintGCDetails
8:-XX:+PrintGCDateStamps
8:-XX:+PrintTenuringDistribution
8:-XX:+PrintGCApplicationStoppedTime
8:-Xloggc:logs/gc.log
8:-XX:+UseGCLogFileRotation
8:-XX:NumberOfGCLogFiles=32
8:-XX:GCLogFileSize=64m
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
9-:-Djava.locale.providers=COMPAT
-XX:+UnlockDiagnosticVMOptions
-Xlog:gc+heap+coops=info
shell> /data/opt/elasticsearch-7.4.0/bin/elasticsearch-plugin install analysis-smartcn
shell> chown -R croot.croot /data/opt/elasticsearch*
shell> chown -R croot.croot /elastic
shell> su - croot
shell> cd /data/opt/elasticsearch
shell> ./bin/elasticsearch
shell> cd /data/software
shell> tar zxvf logstash-7.4.0.tar.gz -C /data/opt/
shell> cd /data/opt/
shell> ln -s logstash-7.4.0 logstash
shell> cd /data/opt/logstash
shell> cat config/ logstash.yml
node.name: logstash-node1
pipeline.id: main-node1
config.reload.automatic: true
http.host: "10.XXX.XXX.112"
shell> cat config/jvm.options
-Xms16g
-Xmx16g
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djruby.compile.invokedynamic=true
-Djruby.jit.threshold=0
-Djruby.regexp.interruptible=true
-XX:+HeapDumpOnOutOfMemoryError
-Djava.security.egd=file:/dev/urandom
-Dlog4j2.isThreadContextMapInheritable=true
shell> cd /data/opt/logstash-7.4.0/config/
shell> wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
shell> gunzip GeoLite2-City.mmdb.gz
shell> cd /data/opt/logstash
shell> nohup ./bin/logstash -f config/conf &
shell> mkdir /data/opt/elasticsearch-7.4.0/config/certs
shell> cd /data/opt/elasticsearch-7.4.0/bin/
shell> ./elasticsearch-certutil ca --days 3650 --ca-dn "CN=LBC Elatic CA" --out /data/opt/elasticsearch-7.4.0/config/certs/lbc-elastic-ca.p12
shell> ./elasticsearch-certutil cert --days 3650 -ca /data/opt/elasticsearch-7.4.0/config/certs/lbc-elastic-ca.p12 --out /data/opt/elasticsearch-7.4.0/config/certs/lbc-elastic-certificates.p12
shell> chmod 660 /data/opt/elasticsearch-7.4.0/config/certs/*
shell> vim /data/opt/elasticsearch-7.4.0/config/elasticsearch.yml
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: certs/lbc-elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: certs/lbc-elastic-certificates.p12
xpack.monitoring.collection.enabled: true
shell> cd /data/opt/elasticsearch-7.4.0/bin/
shell> ./elasticsearch-setup-passwords interactive
elastic/Lbc@net1
apm_system/Lbc@net2
kibana/Lbc@net3
logstash_system/Lbc@net4
beats_system/Lbc@net5
remote_monitoring_user/Lbc@net6
shell> cat /data/opt/logstash/config/logstash.yml
xpack.monitoring.enabled: true
xpack.monitoring.elasticsearch.username: "logstash_system"
xpack.monitoring.elasticsearch.password: "Lbc@net4"
xpack.monitoring.elasticsearch.hosts: ["10.XXX.XXX.115:9200", "10.XXX.XXX.116:9200", "10.XXX.XXX.117:9200"]
shell> cd /data/software/
shell> tar zxvf kibana-7.4.0-linux-x86_64.tar.gz -C /data/opt/
shell> cd /data/opt/
shell> ln -s kibana-7.4.0-linux-x86_64 kibana
shell> cat /data/opt/kibana/config/kibana.yml
server.port: 5601
server.host: "JXQPSELKZB01"
server.name: "JXQPSELKZB01"
elasticsearch.hosts: ["http://10.XXX.XXX.115:9200","http://10.XXX.XXX.116:9200","http://10.XXX.XXX.117:9200"]
elasticsearch.username: "elastic"
elasticsearch.password: "Lbc@net1"
i18n.locale: "zh-CN"
map.tilemap.url: http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}
shell> cd /data/opt/kibana-7.4.0-linux-x86_64/bin
shell> nohup ./kibana &
shell> cd /data/opt/elasticsearch-7.4.0/modules/x-pack-core
shell> sz x-pack-core-7.4.0.jar
org.elasticsearch.license.LicenseVerifier.java
-------------------------------------------------------------
package org.elasticsearch.license;
import java.nio.*;
import org.elasticsearch.common.bytes.*;
import java.security.*;
import java.util.*;
import org.elasticsearch.common.xcontent.*;
import org.apache.lucene.util.*;
import org.elasticsearch.core.internal.io.*;
import java.io.*;
public class LicenseVerifier
{
public static boolean verifyLicense(final License license, final byte[] publicKeyData) {
return true;
}
public static boolean verifyLicense(final License license) {
return true;
}
}
org.elasticsearch.xpack.core.XPackBuild.java
package org.elasticsearch.xpack.core;
import org.elasticsearch.common.io.*;
import java.net.*;
import org.elasticsearch.common.*;
import java.nio.file.*;
import java.io.*;
import java.util.jar.*;
public class XPackBuild
{
public static final XPackBuild CURRENT;
private String shortHash;
private String date;
@SuppressForbidden(reason = "looks up path of xpack.jar directly")
static Path getElasticsearchCodebase() {
final URL url = XPackBuild.class.getProtectionDomain().getCodeSource().getLocation();
try {
return PathUtils.get(url.toURI());
}
catch (URISyntaxException bogus) {
throw new RuntimeException(bogus);
}
}
XPackBuild(final String shortHash, final String date) {
this.shortHash = shortHash;
this.date = date;
}
public String shortHash() {
return this.shortHash;
}
public String date() {
return this.date;
}
static {
final Path path = getElasticsearchCodebase();
String shortHash = null;
String date = null;
Label_0157: {
shortHash = "Unknown";
date = "Unknown";
}
CURRENT = new XPackBuild(shortHash, date);
}
}
shell> javac -cp "/data/opt/elasticsearch-7.4.0/modules/x-pack-core/*:/data/opt/elasticsearch-7.4.0/lib/*" LicenseVerifier.java
shell> javac -cp "/data/opt/elasticsearch-7.4.0/modules/x-pack-core/*:/data/opt/elasticsearch-7.4.0/lib/*" XPackBuild.java
shell> cd /data/software
shell> cp /data/opt/elasticsearch-7.4.0/modules/x-pack-core/x-pack-core-7.4.0.jar .
shell> unzip x-pack-core-7.4.0.jar -d ./x-pack-core-7.4.0
shell> cp LicenseVerifier.class ./x-pack-core-7.4.0/org/elasticsearch/license/
shell> cp XPackBuild.class ./x-pack-core-7.4.0/org/elasticsearch/xpack/core/
shell> jar -cvf x-pack-core-7.4.0.crack.jar -C x-pack-core-7.4.0/ .
shell> cp x-pack-core-7.4.0.crack.jar /data/opt/elasticsearch-7.4.0/modules/x-pack-core/x-pack-core-7.4.0.jar
重启elasticsearch。
修改license文件;
修改type字段为platinum,表示铂金版;
修改expiry_date_in_millis字段为2147482800000,表示时间尽头;
修改max_nodes字段为1000,表示集群数量;
更新许可证;
修改成功后就可以在Kibana页面中上传新的许可证了。
---
- name: Add Elasticsearch GPG key.
rpm_key:
key: https://packages.elastic.co/GPG-KEY-elasticsearch
state: present
- name: Add Filebeat repository.
template:
src: beats.repo.j2
dest: /etc/yum.repos.d/beats.repo
mode: 0644
- name: Install Filebeat.
package: name={{ filebeat_version }} state=present
- name: Copy Filebeat configuration.
template:
src: "/tmp/filebeat.yml"
dest: "/etc/filebeat/filebeat.yml"
owner: root
group: root
mode: 0644
notify: restart filebeat
- name: Ensure Filebeat is started and enabled at boot.
service:
name: filebeat
state: started
enabled: true
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129625.html
摘要:使用自建日志解决方案下面我们介绍下如何使用来搭建日志解决方案。根据配置文件创建一个名为的,如下在集群部署。配置在之前部署时,由于我们已经将加入到中,已经可以对的日志实现监控采集。使用ELK自建UK8S日志解决方案下面我们介绍下如何使用Elasticsearch+Filebeat+Kibana来搭建UK8S日志解决方案。一、部署Elasticsearch1. 关于ElasticsearchEl...
摘要:数据导入与校验容器运行之后,笔者需要验证是否启动成功,可以通过浏览器访问和的页面是否成功来判断。的整体操作流程比较简单,首先是收集各种日志并进行过滤,然后将过滤后的内容发送到服务中,最后用户通过的页面查看中的日志数据作者汤青松微信日期 一、背景 笔者所在项目组的项目由多个子项目所组成,每一个子项目都存在一定的日志,有时候想排查一些问题,需要到各个地方去查看,极为不方便,此前听说有ELK...
摘要:数据导入与校验容器运行之后,笔者需要验证是否启动成功,可以通过浏览器访问和的页面是否成功来判断。的整体操作流程比较简单,首先是收集各种日志并进行过滤,然后将过滤后的内容发送到服务中,最后用户通过的页面查看中的日志数据作者汤青松微信日期 一、背景 笔者所在项目组的项目由多个子项目所组成,每一个子项目都存在一定的日志,有时候想排查一些问题,需要到各个地方去查看,极为不方便,此前听说有ELK...
摘要:数据导入与校验容器运行之后,笔者需要验证是否启动成功,可以通过浏览器访问和的页面是否成功来判断。的整体操作流程比较简单,首先是收集各种日志并进行过滤,然后将过滤后的内容发送到服务中,最后用户通过的页面查看中的日志数据作者汤青松微信日期 一、背景 笔者所在项目组的项目由多个子项目所组成,每一个子项目都存在一定的日志,有时候想排查一些问题,需要到各个地方去查看,极为不方便,此前听说有ELK...
摘要:摘要本篇文章介绍了如何通过数人云部署一套标准的日志收集系统。主机添加完成后,检查主机运行是否正常,如图第二步,发布实例我们将通过数人云将的镜像以模式部署到我们规划的主机和上。 摘要:本篇文章介绍了如何通过数人云部署一套标准的 ELK 日志收集系统。第一步,将主机组织成集群;第二步,发布 ElasticSearch 实例;第三步,发布 Kibana 实例;第四步,发布 Logstash ...
摘要:部署环境依赖第三方组件下载地址官网简单的流程示意图跟都支持集群部署,本文只简单描述如何单独部署部署步骤三件套版本最好一致,小版本可以高,但是不可以低。 window环境下搭建简单ELK日志收集 前言本文主要介绍如何在window环境下部署elk日志收集,网络上大部分是linux的,刚好这边服务需要用到window 环境,配置方式有点不同,大体是一样的。 部署环境window serve...
阅读 1251·2023-01-11 13:20
阅读 1560·2023-01-11 13:20
阅读 1015·2023-01-11 13:20
阅读 1685·2023-01-11 13:20
阅读 3973·2023-01-11 13:20
阅读 2521·2023-01-11 13:20
阅读 1356·2023-01-11 13:20
阅读 3487·2023-01-11 13:20