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
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/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...
閱讀 1346·2023-01-11 13:20
閱讀 1684·2023-01-11 13:20
閱讀 1132·2023-01-11 13:20
閱讀 1858·2023-01-11 13:20
閱讀 4100·2023-01-11 13:20
閱讀 2704·2023-01-11 13:20
閱讀 1385·2023-01-11 13:20
閱讀 3597·2023-01-11 13:20