开发者本地搭建性能监测工具(Windows)
ElasticSearch 8.9.0 开发模式安装
JDK安装
官方提供版本与JDK支持关系:https://www.elastic.co/cn/support/matrix#matrix_jvm
我们安装Elasticsearch 8.9.x,看到支持的最低JDK版本是17。
JDK(Windows/Mac含M1/M2 Arm原生JDK)安装,附各个版本JDK下载链接:https://es-cn.blog.csdn.net/article/details/126861940
Oracle JDK 官方下载:https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe
按照默认设置进行安装。
安装之后我们默认的JDK版本会变成17,这是因为安装过程自动添加了环境变量。在Path环境变量中清理如下两个环境变量(一般在最上面,移动到下面也可以):
- C:\Program Files\Common Files\Oracle\Java\javapath
- C:\Program Files (x86)\Common Files\Oracle\Java\javapath
新建环境变量:
变量名 | 变量值 |
---|---|
ES_JAVA_HOME | C:\Program Files\Java\jdk-17 |
ElasticSearch下载安装
ElasticSearch下载页面:https://www.elastic.co/cn/downloads/elasticsearch
ElasticSearch 8.9.0 版本下载:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.0-windows-x86_64.zip
注意:路径中不能存在空格
解压,修改config目录下elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
# 代表一个集群,集群中有多个节点,其中有一个为主节点,这个主节点是可以通过选举产生的,主从节点是对于集群内部来说的
# Elasticsearch的一个概念就是去中心化,字面上理解就是无中心节点,这是对于集群外部来说的,因为从外部来看Elasticsearch集群,在逻辑上是个整体,你与任何一个节点的通信和与整个Elasticsearch集群通信是等价的。
# cluster.name可以确定你的集群名称,当你的elasticsearch集群在同一个网段中elasticsearch会自动的找到具有相同cluster.name的Elasticsearch服务。所以当同一个网段具有多个Elasticsearch集群时cluster.name就成为同一个集群的标识。
# Use a descriptive name for your cluster:
# 集群名称,默认是elasticsearch
cluster.name: elasticsearch
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# 节点名称同理,可自动生成也可手动配置.
node.name: es-node
#
# Add custom attributes to the node:
# 每个节点都可以定义一些与之关联的通用属性,用于后期集群进行碎片分配时的过滤
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
# 可以指定Elasticsearch的数据存储目录,默认存储在es_home/data目录下
#path.data: /path/to/data
#
# Path to log files:
# 可以指定Elasticsearch的日志存储目录,默认存储在es_home/logs目录下
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
# 当JVM开始写入交换空间时(swapping)ElasticSearch性能会低下,你应该保证它不会写入交换空间
# 锁定物理内存地址,防止elasticsearch内存被交换出去,也就是避免elasticsearch使用swap交换分区
bootstrap.memory_lock: true
#
# 确保ES_HEAP_SIZE参数设置为系统可用内存的一半左右
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.# 确保 ES_MIN_MEM 和 ES_MAX_MEM 环境变量设置为相同的值,以及机器有足够的内存分配给Elasticsearch
# 注意:内存也不是越大越好,一般64位机器,最大分配内存别才超过32G #
# 当系统进行内存交换的时候,elasticsearch的性能很差
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
# 为Elasticsearch设置ip绑定,默认是127.0.0.1,也就是默认只能通过127.0.0.1 或者localhost才能访问
network.host: 127.0.0.1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
# 为Elasticsearch设置自定义端口,默认是9200
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false
# ---------------------------------- Xpack -----------------------------------
xpack.security.enabled: false
回到bin目录下,双击elasticsearch.bat启动
启动会占用系统物理内存的一半,建议根据实际情况调整jvm.options文件-Xms、-Xmx的值。
验证
访问:http://localhost:9200
ElasticSearch 8 默认启动Security,这对新手学习很不友好,实际上违背了Elastic官方设置开发模式的初衷,安全固然重要,但是没必要把门槛设置这么高。
参考:https://es-cn.blog.csdn.net/article/details/123936913
ElasticSearch目录结构
目录名称 | 描述 |
---|---|
bin | 可执行脚本文件,包括启动ElasticSearch服务、插件管理、函数命令等。 |
config | 配置文件目录,如ElasticSearch配置、角色配置、jvm配置等。 |
jdk | 7.x以后特有,自带的Java环境,8.x版本自带jdk 17 |
lib | ElasticSearch所依赖的Java库 |
logs | 默认的日志文件存储路径,生产环境要求必须修改 |
modules | 包含所有的ElasticSearch模块,如Cluster、Discovery、Indices等。 |
plugins | 已经安装的插件的目录 |
data | 默认的数据存放目录,包含节点、分片、索引、文档的所有数据,生产环境要求必须修改 |
SkyWalking
SkyWalking下载安装
SkyWalking官网:https://skywalking.apache.org/
Application performance monitor tool for distributed systems, especially designed for microservices, cloud native and container-based (Kubernetes) architectures.
SkyWalking 9.5.0 版本下载:https://dlcdn.apache.org/skywalking/9.5.0/apache-skywalking-apm-9.5.0.tar.gz
解压缩
注意:路径中不能存在空格
修改bin目录下startup.bat文件中
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one or more
@REM contributor license agreements. See the NOTICE file distributed with
@REM this work for additional information regarding copyright ownership.
@REM The ASF licenses this file to You under the Apache License, Version 2.0
@REM (the "License"); you may not use this file except in compliance with
@REM the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing, software
@REM distributed under the License is distributed on an "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM See the License for the specific language governing permissions and
@REM limitations under the License.@echo offsetlocal
SET JAVA_HOME=%ES_JAVA_HOME%
call "%~dp0"\oapService.bat start
call "%~dp0"\webappService.bat start
endlocal
修改webapp目录下application.yml文件
serverPort: ${SW_SERVER_PORT:-8080}
修改为:
serverPort: ${SW_SERVER_PORT:-8888}
验证
访问:http://localhost:8888/
SkyWalking默认是使用H2作为存储的,我们修改为ElasticSearch。
修改config目录下application.yml文件
storage:selector: ${SW_STORAGE:elasticsearch}elasticsearch:namespace: ${SW_NAMESPACE:"elasticsearch"}clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}connectTimeout: ${SW_STORAGE_ES_CONNECT_TIMEOUT:3000}socketTimeout: ${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}responseTimeout: ${SW_STORAGE_ES_RESPONSE_TIMEOUT:15000}numHttpClientThread: ${SW_STORAGE_ES_NUM_HTTP_CLIENT_THREAD:0}user: ${SW_ES_USER:""}password: ${SW_ES_PASSWORD:""}
# trustStorePath: ${SW_STORAGE_ES_SSL_JKS_PATH:""}
# trustStorePass: ${SW_STORAGE_ES_SSL_JKS_PASS:""}secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} # Secrets management file in the properties format includes the username, password, which are managed by 3rd party tool.dayStep: ${SW_STORAGE_DAY_STEP:1} # Represent the number of days in the one minute/hour/day index.indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:1} # Shard number of new indexesindexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:1} # Replicas number of new indexes# Specify the settings for each index individually.# If configured, this setting has the highest priority and overrides the generic settings.specificIndexSettings: ${SW_STORAGE_ES_SPECIFIC_INDEX_SETTINGS:""}# Super data set has been defined in the codes, such as trace segments.The following 3 config would be improve es performance when storage super size data in es.superDatasetDayStep: ${SW_STORAGE_ES_SUPER_DATASET_DAY_STEP:-1} # Represent the number of days in the super size dataset record index, the default value is the same as dayStep when the value is less than 0superDatasetIndexShardsFactor: ${SW_STORAGE_ES_SUPER_DATASET_INDEX_SHARDS_FACTOR:5} # This factor provides more shards for the super data set, shards number = indexShardsNumber * superDatasetIndexShardsFactor. Also, this factor effects Zipkin traces.superDatasetIndexReplicasNumber: ${SW_STORAGE_ES_SUPER_DATASET_INDEX_REPLICAS_NUMBER:0} # Represent the replicas number in the super size dataset record index, the default value is 0.indexTemplateOrder: ${SW_STORAGE_ES_INDEX_TEMPLATE_ORDER:0} # the order of index templatebulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:5000} # Execute the async bulk record data every ${SW_STORAGE_ES_BULK_ACTIONS} requestsbatchOfBytes: ${SW_STORAGE_ES_BATCH_OF_BYTES:10485760} # A threshold to control the max body size of ElasticSearch Bulk flush.# flush the bulk every 5 seconds whatever the number of requestsflushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:5}concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requestsresultWindowMaxSize: ${SW_STORAGE_ES_QUERY_MAX_WINDOW_SIZE:10000}metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:10000}scrollingBatchSize: ${SW_STORAGE_ES_SCROLLING_BATCH_SIZE:5000}segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200}profileTaskQueryMaxSize: ${SW_STORAGE_ES_QUERY_PROFILE_TASK_SIZE:200}profileDataQueryBatchSize: ${SW_STORAGE_ES_QUERY_PROFILE_DATA_BATCH_SIZE:100}oapAnalyzer: ${SW_STORAGE_ES_OAP_ANALYZER:"{\"analyzer\":{\"oap_analyzer\":{\"type\":\"stop\"}}}"} # the oap analyzer.oapLogAnalyzer: ${SW_STORAGE_ES_OAP_LOG_ANALYZER:"{\"analyzer\":{\"oap_log_analyzer\":{\"type\":\"standard\"}}}"} # the oap log analyzer. It could be customized by the ES analyzer configuration to support more language log formats, such as Chinese log, Japanese log and etc.advanced: ${SW_STORAGE_ES_ADVANCED:""}# Enable shard metrics and records indices into multi-physical indices, one index template per metric/meter aggregation function or record.logicSharding: ${SW_STORAGE_ES_LOGIC_SHARDING:false}# Custom routing can reduce the impact of searches. Instead of having to fan out a search request to all the shards in an index, the request can be sent to just the shard that matches the specific routing value (or values).enableCustomRouting: ${SW_STORAGE_ES_ENABLE_CUSTOM_ROUTING:false}
相关文章:
开发者本地搭建性能监测工具(Windows)
ElasticSearch 8.9.0 开发模式安装 JDK安装 官方提供版本与JDK支持关系:https://www.elastic.co/cn/support/matrix#matrix_jvm 我们安装Elasticsearch 8.9.x,看到支持的最低JDK版本是17。 JDK(Windows/Mac含M1/M2 Arm原生JDK)…...

嵌入式Linux开发实操(八):UART串口开发
串口可以说是非常好用的一个接口,它同USB、CAN、I2C、SPI等接口一样,为SOC/MCU构建了丰富的接口功能。那么在嵌入式linux中又是如何搭建和使用UART接口的呢? 一、Console接口即ttyS0 ttyS0通常做为u-boot(bootloader的一种,像是Windows的BIOS),它需要一个交互界面,一般…...

公告:微信小程序备案期限官方要求
备案期限要求 1、若微信小程序未上架,自2023年9月1日起,微信小程序须完成备案后才可上架,备案时间1-20日不等; 2、若微信小程序已上架,请于2024年3月31日前完成备案,逾期未完成备案,平台将按照…...
cesium中获取高度的误区
this.ellipsoid viewer.scene.globe.ellipsoid; var cartesian viewer.camera.pickEllipsoid(e.position, this.ellipsoid);if(cartesian){// 苗卡尔椭球体的三维坐标 转 地图坐标(弧度)var cartographic viewer.scene.globe.ellipsoid.cartesianToCa…...
基于Centos:服务器基础环境安装: JDK、Maven、Python、Go、Docker、K8s
创建用户 useradd dev groupadd op chown -R :op /opt chmod -R 770 /opt usermod -aG op devJDK8 yum install -y java-1.8.0-openjdk-devel echo export JAVA_HOME/usr/lib/jvm/java-1.8.0/>> /etc/profilesource /etc/profileJDK11 yum install -y java-11-openjd…...
Elasticsearch的数据删除策略只能触发一次
在Elasticsearch中,可以使用Index Lifecycle Management(ILM)来设置删除数据的保留时长。ILM是Elasticsearch的一项功能,用于管理索引的生命周期,包括数据保留、备份、归档等操作。 要设置删除数据的保留时长…...

Open3D 最小二乘拟合空间直线(方法一)
目录 一、算法原理1、空间直线2、最小二乘法拟合二、代码实现三、结果展示本文由CSDN点云侠原创,原文链接。如果你不是在点云侠的博客中看到该文章,那么此处便是不要脸的爬虫。 一、算法原理 1、空间直线 x −...
解决uniapp 二次登陆 登录页是首页时,登录页闪现问题
pages.json文件中,pages数组中第一项是登录页,用户第一次登录后,存储登录状态,以后再进入应用时,自动登录跳转至首页。 但是自动登录跳转至首页时,登录页总是会闪现一下。 第一步:manifest.js…...

如何快速制作一个房地产电子传单?
在如今高度数字化的时代,电子传单成为了宣传推广的一种重要方式。下面将介绍如何利用乔拓云平台快速制作一个房地产电子传单。 第一步,找一个可靠的第三方制作平台/工具,比如乔拓云平台。乔拓云平台是一个功能强大、简单易用的电子传单制作工…...

golang云原生项目之:etcd服务注册与发现
服务注册与发现:ETCD 1直接调包 kitex-contrib: 上面有实现的案例,直接cv。下面是具体的理解 2 相关概念 EtcdResolver: etcd resolver是一种DNS解析器,用于将域名转换为etcd集群中的具体地址,以便应用程序可以与et…...

arm:day4
1. 实现三盏灯的点亮 .text .global _start_start: led1初始化函数LED_INIT: 1 通过RCC_AHB4_ENSETR寄存器,设置GPIOE F组控制器使能 0x50000A28[5:4]1ldr r0,0X50000A28ldr r1,[r0]orr r1,r1,#(0X3<<4)str r1,[r0] 2.1 通过GPIOE_MODER寄存器,…...

flutter 常见的状态管理器
flutter 常见的状态管理器 前言一、Provider二、Bloc三、Redux四、GetX总结 前言 当我们构建复杂的移动应用时,有效的状态管理是至关重要的,因为应用的不同部分可能需要共享数据、相应用户交互并保持一致的状态。Flutter 中有多种状态管理解决方案&#…...
Kotlin的Map
在 Kotlin 中,Map 是一种键值对的集合数据结构,用于存储一组关联的键和值。Kotlin 标准库提供了 Map 接口和多种实现类,使得操作和处理键值对数据更加方便。下面详细描述 Kotlin 的 Map 的用法: 创建 Map Kotlin 提供了几种方式…...

STM32 串口复习
按数据通信方式分类: 串行通信:数据逐位按顺序依次传输。传输速率较低,抗干扰能力较强,通信距离较长,I/O资源占用较少,成本较低。并行通信:数据各位通过多条线同时传输。 按数据传输方向分类&…...
VScode替换cmd powershell为git bash 终端,并设置为默认
效果图 步骤 1. 解决VScode缺少git bash的问题_failed to start bash - is git-bash.exe on the syst_Rudon滨海渔村的博客-CSDN博客效果解决步骤找到git安装目录下的/bin/bash.exe,复制其绝对路径,例如D:\Program Files\Git\bin\bash.exe把路径的右斜…...
网络基础(一)桥接网络
网络基础知识 桥接网络 桥接网络是一种网络设计技术,其目的是将两个或多个网络段连接在一起,使它们在逻辑上表现为单个网络。这通过使用网络桥来实现,网络桥工作在数据链路层(第2层),只关心MAC地址&#…...

C#程序变量统一管理例子 - 开源研究系列文章
今天讲讲关于C#应用程序中使用到的变量的统一管理的代码例子。 我们知道,在C#里使用变量,除了private私有变量外,程序中使用到的公共变量就需要进行统一的存放和管理。这里笔者使用到的公共变量管理库划分为:1)窗体;2)…...
信息熵,信息增益,增益率的理解
西瓜数据集D如下: 编号色泽根蒂敲声纹理脐部触感好瓜1青绿蜷缩浊响清晰凹陷硬滑是2乌黑蜷缩沉闷清晰凹陷硬滑是3乌黑蜷缩浊响清晰凹陷硬滑是4青绿蜷缩沉闷清晰凹陷硬滑是5浅白蜷缩浊响清晰凹陷硬滑是6青绿稍蜷浊响清晰稍凹软粘是7乌黑稍蜷浊响稍糊稍凹软粘是8乌黑稍蜷浊响清晰…...
二级MySQL(一)——基本概念与方法
数据库系统的核心是【数据库管理系统】 E-R图提供了表示信息世界中的方法,主要有实体、属性和【联系】 E-R图是数据库设计的工具之一,一般适用于建立数据库的【概念模型】 将E-R图转换到关系模式时,实体与联系都可以表示成【关系】 关系数…...

13 Web全栈 pnpm
什么是pnpm? 可以理解成performant npm缩写 速度快、节省磁盘空间的软件包管理器 特点 快速- pnpm比其他包管理器快2倍高效- node_modules中的文件链接自特定的内容寻址存储库支持monorepos- 内置支持单仓多包严格- pnpm默认创建了一个非平铺的node_modules 因此代…...

观成科技:隐蔽隧道工具Ligolo-ng加密流量分析
1.工具介绍 Ligolo-ng是一款由go编写的高效隧道工具,该工具基于TUN接口实现其功能,利用反向TCP/TLS连接建立一条隐蔽的通信信道,支持使用Let’s Encrypt自动生成证书。Ligolo-ng的通信隐蔽性体现在其支持多种连接方式,适应复杂网…...

C++实现分布式网络通信框架RPC(3)--rpc调用端
目录 一、前言 二、UserServiceRpc_Stub 三、 CallMethod方法的重写 头文件 实现 四、rpc调用端的调用 实现 五、 google::protobuf::RpcController *controller 头文件 实现 六、总结 一、前言 在前边的文章中,我们已经大致实现了rpc服务端的各项功能代…...
模型参数、模型存储精度、参数与显存
模型参数量衡量单位 M:百万(Million) B:十亿(Billion) 1 B 1000 M 1B 1000M 1B1000M 参数存储精度 模型参数是固定的,但是一个参数所表示多少字节不一定,需要看这个参数以什么…...
在HarmonyOS ArkTS ArkUI-X 5.0及以上版本中,手势开发全攻略:
在 HarmonyOS 应用开发中,手势交互是连接用户与设备的核心纽带。ArkTS 框架提供了丰富的手势处理能力,既支持点击、长按、拖拽等基础单一手势的精细控制,也能通过多种绑定策略解决父子组件的手势竞争问题。本文将结合官方开发文档,…...
前端倒计时误差!
提示:记录工作中遇到的需求及解决办法 文章目录 前言一、误差从何而来?二、五大解决方案1. 动态校准法(基础版)2. Web Worker 计时3. 服务器时间同步4. Performance API 高精度计时5. 页面可见性API优化三、生产环境最佳实践四、终极解决方案架构前言 前几天听说公司某个项…...
线程与协程
1. 线程与协程 1.1. “函数调用级别”的切换、上下文切换 1. 函数调用级别的切换 “函数调用级别的切换”是指:像函数调用/返回一样轻量地完成任务切换。 举例说明: 当你在程序中写一个函数调用: funcA() 然后 funcA 执行完后返回&…...

MMaDA: Multimodal Large Diffusion Language Models
CODE : https://github.com/Gen-Verse/MMaDA Abstract 我们介绍了一种新型的多模态扩散基础模型MMaDA,它被设计用于在文本推理、多模态理解和文本到图像生成等不同领域实现卓越的性能。该方法的特点是三个关键创新:(i) MMaDA采用统一的扩散架构…...

MODBUS TCP转CANopen 技术赋能高效协同作业
在现代工业自动化领域,MODBUS TCP和CANopen两种通讯协议因其稳定性和高效性被广泛应用于各种设备和系统中。而随着科技的不断进步,这两种通讯协议也正在被逐步融合,形成了一种新型的通讯方式——开疆智能MODBUS TCP转CANopen网关KJ-TCPC-CANP…...
C++ 基础特性深度解析
目录 引言 一、命名空间(namespace) C 中的命名空间 与 C 语言的对比 二、缺省参数 C 中的缺省参数 与 C 语言的对比 三、引用(reference) C 中的引用 与 C 语言的对比 四、inline(内联函数…...

现代密码学 | 椭圆曲线密码学—附py代码
Elliptic Curve Cryptography 椭圆曲线密码学(ECC)是一种基于有限域上椭圆曲线数学特性的公钥加密技术。其核心原理涉及椭圆曲线的代数性质、离散对数问题以及有限域上的运算。 椭圆曲线密码学是多种数字签名算法的基础,例如椭圆曲线数字签…...