Mysql(MGR)和ProxySQL搭建部署-Kubernetes版本
一、Mysql(MGR)
1.1 statefulSet.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:labels:app: mysqlname: mysqlnamespace: yihuazt
spec:replicas: 3serviceName: mysql-headlessselector:matchLabels:app: mysqltemplate:metadata:labels:app: mysqlspec:affinity:podAntiAffinity:requiredDuringSchedulingIgnoredDuringExecution:- labelSelector:matchExpressions:- key: appoperator: Invalues:- mysqltopologyKey: "kubernetes.io/hostname"containers:- name: mysqlimage: registry.harbor.com:30002/yihuazt/mysql:8.0.28resources:requests:cpu: "1"memory: "1024Mi"volumeMounts:- name: mysql-datamountPath: /var/lib/mysql/- name: mysql-cmmountPath: /etc/mysql/my.cnfsubPathExpr: $(POD_NAME).cnf- name: mysql-cmmountPath: /docker-entrypoint-initdb.d/init.sqlsubPath: init.sql- name: mysql-cmmountPath: /var/lib/mysql-files/proxysql.sqlsubPath: proxysql.sqlports:- containerPort: 3306- containerPort: 24901env:- name: TZvalue: "Asia/Shanghai"- name: MYSQL_ROOT_PASSWORDvalueFrom:secretKeyRef:name: mysql-certkey: password- name: POD_IPvalueFrom:fieldRef:apiVersion: v1fieldPath: status.podIP- name: POD_NAMEvalueFrom:fieldRef:apiVersion: v1fieldPath: metadata.namevolumes:- name: mysql-cmconfigMap:name: mysql-cmitems:- key: mysql-0.cnfpath: mysql-0.cnf- key: mysql-1.cnfpath: mysql-1.cnf- key: mysql-2.cnfpath: mysql-2.cnf- key: init.sqlpath: init.sql- key: proxysql.sqlpath: proxysql.sqlvolumeClaimTemplates:- metadata:name: mysql-dataspec:accessModes:- ReadWriteOnceresources:requests:storage: 100GistorageClassName: yihuazt-nfsvolumeMode: Filesystem
1.2 service.yaml
apiVersion: v1
kind: Service
metadata:name: mysql-headlessnamespace: yihuazt
spec:ports:- name: mysqlprotocol: TCPport: 3306targetPort: 3306- name: mgrprotocol: TCPport: 24901targetPort: 24901selector:app: mysqlclusterIP: Nonetype: ClusterIP
1.3 configMap.yaml
注意:
# 用于限制哪些 IP 地址或 IP 网段可以与 Group Replication 集群进行通信
,由于k8s部署Pod是不同网段,
跨网段的 MySQL 实例进行 Group Replication必须配置参数,指定哪些 IP 地址或子网允许连接。
- loose-group_replication_ip_whitelist='10.244.0.0/16'
# 用于设置主机名(hostname)的配置参数。这个参数通常用于配置 MySQL Replication 环境中的主机名。如果未配置,MGR集群主机名与无头服务DNS不匹配,通讯失败。
- report_host=mysql-1.mysql-headless.yihuazt.svc.cluster.local
# server_id一定不能设置为0
- server_id=1
apiVersion: v1
kind: ConfigMap
metadata:name: mysql-cmnamespace: yihuaztlabels:app: mysql
data:mysql-0.cnf: |# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; version 2 of the License.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA## The MySQL Server configuration file.## For explanations see# http://dev.mysql.com/doc/mysql/en/server-system-variables.html[mysqld]pid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockdatadir = /var/lib/mysqlsecure-file-priv= NULL# Custom config should go here!includedir /etc/mysql/conf.d/default_authentication_plugin=mysql_native_passwordplugin_dir=/usr/lib/mysql/pluginserver_id=1gtid_mode=ONenforce_gtid_consistency=ONbinlog_checksum=NONEtransaction_write_set_extraction=XXHASH64loose-group_replication_recovery_use_ssl=ONloose-group_replication_group_name="bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee"loose-group_replication_start_on_boot=OFFloose-group_replication_local_address="mysql-0.mysql-headless.yihuazt.svc.cluster.local:24901"loose-group_replication_group_seeds="mysql-0.mysql-headless.yihuazt.svc.cluster.local:24901,mysql-1.mysql-headless.yihuazt.svc.cluster.local:24901,mysql-2.mysql-headless.yihuazt.svc.cluster.local:24901"loose-group_replication_bootstrap_group=OFFloose-group_replication_ip_whitelist='10.244.0.0/16'report_host=mysql-0.mysql-headless.yihuazt.svc.cluster.localmysql-1.cnf: |# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; version 2 of the License.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA## The MySQL Server configuration file.## For explanations see# http://dev.mysql.com/doc/mysql/en/server-system-variables.html[mysqld]pid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockdatadir = /var/lib/mysqlsecure-file-priv= NULL# Custom config should go here!includedir /etc/mysql/conf.d/default_authentication_plugin=mysql_native_passwordplugin_dir=/usr/lib/mysql/pluginserver_id=2gtid_mode=ONenforce_gtid_consistency=ONbinlog_checksum=NONEloose-group_replication_recovery_get_public_key=ONloose-group_replication_recovery_use_ssl=ONloose-group_replication_group_name="bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee"loose-group_replication_start_on_boot=OFFloose-group_replication_local_address="mysql-1.mysql-headless.yihuazt.svc.cluster.local:24901"loose-group_replication_group_seeds="mysql-0.mysql-headless.yihuazt.svc.cluster.local:24901,mysql-1.mysql-headless.yihuazt.svc.cluster.local:24901,mysql-2.mysql-headless.yihuazt.svc.cluster.local:24901"loose-group_replication_bootstrap_group=OFFloose-group_replication_ip_whitelist='10.244.0.0/16'report_host=mysql-1.mysql-headless.yihuazt.svc.cluster.localmysql-2.cnf: |# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; version 2 of the License.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA## The MySQL Server configuration file.## For explanations see# http://dev.mysql.com/doc/mysql/en/server-system-variables.html[mysqld]pid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockdatadir = /var/lib/mysqlsecure-file-priv= NULL# Custom config should go here!includedir /etc/mysql/conf.d/default_authentication_plugin=mysql_native_passwordplugin_dir=/usr/lib/mysql/pluginserver_id=3gtid_mode=ONenforce_gtid_consistency=ONbinlog_checksum=NONEloose-group_replication_recovery_get_public_key=ONloose-group_replication_recovery_use_ssl=ONloose-group_replication_group_name="bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee"loose-group_replication_start_on_boot=OFFloose-group_replication_local_address="mysql-2.mysql-headless.yihuazt.svc.cluster.local:24901"loose-group_replication_group_seeds="mysql-0.mysql-headless.yihuazt.svc.cluster.local:24901,mysql-1.mysql-headless.yihuazt.svc.cluster.local:24901,mysql-2.mysql-headless.yihuazt.svc.cluster.local:24901"loose-group_replication_bootstrap_group=OFFloose-group_replication_ip_whitelist='10.244.0.0/16'report_host=mysql-2.mysql-headless.yihuazt.svc.cluster.localinit.sql: |CREATE USER rpl_user@'%' IDENTIFIED BY 'asAS123456!';GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';FLUSH PRIVILEGES;RESET MASTER;INSTALL PLUGIN group_replication SONAME 'group_replication.so';/*SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'group_replication' \G;*/CHANGE MASTER TO MASTER_USER="rpl_user", MASTER_PASSWORD="asAS123456!" FOR CHANNEL 'group_replication_recovery';/*SET GLOBAL group_replication_bootstrap_group=ON;START GROUP_REPLICATION;SET GLOBAL group_replication_bootstrap_group=OFF;SELECT * FROM performance_schema.replication_group_members;*/proxysql.sql: |/*mysql -uroot -prootmcafee123 < /var/lib/mysql-files/proxysql.sql*/use sys;DELIMITER $$CREATE USER 'monitor'@'%' IDENTIFIED BY "monitor@1025";CREATE USER 'proxysql'@'%' IDENTIFIED BY "proxysql@1025";GRANT ALL PRIVILEGES ON *.* TO 'monitor'@'%' ;GRANT ALL PRIVILEGES ON *.* TO 'proxysql'@'%' ;FLUSH PRIVILEGES;CREATE FUNCTION my_id() RETURNS TEXT(36) DETERMINISTIC NO SQL RETURN (SELECT @@global.server_uuid as my_id);$$CREATE FUNCTION gr_member_in_primary_partition()RETURNS VARCHAR(3)DETERMINISTICBEGINRETURN (SELECT IF( MEMBER_STATE='ONLINE' AND ((SELECT COUNT(*) FROMperformance_schema.replication_group_members WHERE MEMBER_STATE NOT IN ('ONLINE', 'RECOVERING')) >=((SELECT COUNT(*) FROM performance_schema.replication_group_members)/2) = 0),'YES', 'NO' ) FROM performance_schema.replication_group_members JOINperformance_schema.replication_group_member_stats USING(member_id) where member_id=my_id());END$$CREATE VIEW gr_member_routing_candidate_status AS SELECTsys.gr_member_in_primary_partition() as viable_candidate,IF( (SELECT (SELECT GROUP_CONCAT(variable_value) FROMperformance_schema.global_variables WHERE variable_name IN ('read_only','super_read_only')) != 'OFF,OFF'), 'YES', 'NO') as read_only,Count_Transactions_Remote_In_Applier_Queue as transactions_behind, Count_Transactions_in_queue as 'transactions_to_cert'from performance_schema.replication_group_member_stats where member_id=my_id();$$
1.4 secret.yml
echo -n "rootmcafee123" | base64
echo "cm9vdG1jYWZlZTEyMw==" | base64 --decode
apiVersion: v1
kind: Secret
metadata:name: mysql-certnamespace: yihuazt
type: Opaque
data:password: cm9vdG1jYWZlZTEyMw==
二、ProxySQL
2.1 deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:name: proxysqlnamespace: yihuazt
spec:replicas: 1selector:matchLabels:app: proxysqltemplate:metadata:labels:app: proxysqlspec:containers:- name: proxysqlimage: registry.harbor.com:30002/yihuazt/proxysql:2.6.5ports:- containerPort: 6033- containerPort: 6032- containerPort: 6070env:- name: TZvalue: "Asia/Shanghai"volumeMounts:- name: proxysql-datamountPath: /var/lib/proxysql- name: proxysql-configmountPath: /etc/proxysql.cnfsubPath: proxysql.cnfvolumes:- name: proxysql-configconfigMap:name: proxysql-cmitems:- key: proxysql.cnfpath: proxysql.cnf- name: proxysql-datapersistentVolumeClaim:claimName: proxysql-pvc
2.2 service.yaml
apiVersion: v1
kind: Service
metadata:name: proxysqlnamespace: yihuazt
spec:selector:app: proxysqltype: NodePortports:- port: 6033targetPort: 6033nodePort: 30633name: external
2.3 persistentVolumeClaim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: proxysql-pvcnamespace: yihuazt
spec:storageClassName: "yihuazt-nfs"accessModes:- ReadWriteOnceresources:requests:storage: 30Gi
2.4 configMap.yaml
apiVersion: v1
kind: ConfigMap
metadata:name: proxysql-cmnamespace: yihuaztlabels:app: proxysql
data:proxysql.cnf: |#file proxysql.cfg######################################################################################### This config file is parsed using libconfig , and its grammar is described in: # http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-File-Grammar # Grammar is also copied at the end of this file ################################################################################################################################################################################# IMPORTANT INFORMATION REGARDING THIS CONFIGURATION FILE: ######################################################################################### On startup, ProxySQL reads its config file (if present) to determine its datadir. # What happens next depends on if the database file (disk) is present in the defined# datadir (i.e. "/var/lib/proxysql/proxysql.db").## If the database file is found, ProxySQL initializes its in-memory configuration from # the persisted on-disk database. So, disk configuration gets loaded into memory and # then propagated towards the runtime configuration. ## If the database file is not found and a config file exists, the config file is parsed # and its content is loaded into the in-memory database, to then be both saved on-disk # database and loaded at runtime.## IMPORTANT: If a database file is found, the config file is NOT parsed. In this case# ProxySQL initializes its in-memory configuration from the persisted on-disk# database ONLY. In other words, the configuration found in the proxysql.cnf# file is only used to initial the on-disk database read on the first startup.## In order to FORCE a re-initialise of the on-disk database from the configuration file # the ProxySQL service should be started with "systemctl start proxysql-initial".#########################################################################################datadir="/var/lib/proxysql"errorlog="/var/lib/proxysql/proxysql.log"admin_variables={admin_credentials="admin:admin"# mysql_ifaces="127.0.0.1:6032;/tmp/proxysql_admin.sock"mysql_ifaces="0.0.0.0:6032"# refresh_interval=2000# debug=true}mysql_variables={threads=4max_connections=2048default_query_delay=0default_query_timeout=36000000have_compress=truepoll_timeout=2000# interfaces="0.0.0.0:6033;/tmp/proxysql.sock"interfaces="0.0.0.0:6033"default_schema="information_schema"stacksize=1048576server_version="8.0.28 (ProxySQL)"connect_timeout_server=3000# make sure to configure monitor username and password# https://github.com/sysown/proxysql/wiki/Global-variables#mysql-monitor_username-mysql-monitor_passwordmonitor_username="monitor"monitor_password="monitor@1025"monitor_history=600000monitor_connect_interval=60000monitor_ping_interval=10000monitor_read_only_interval=1500monitor_read_only_timeout=500ping_interval_server_msec=120000ping_timeout_server=500commands_stats=truesessions_sort=trueconnect_retries_on_failure=10}# defines all the MySQL serversmysql_servers =(# {# address = "127.0.0.1" # no default, required . If port is 0 , address is interpred as a Unix Socket Domain# port = 3306 # no default, required . If port is 0 , address is interpred as a Unix Socket Domain# hostgroup = 0 # no default, required# status = "ONLINE" # default: ONLINE# weight = 1 # default: 1# compression = 0 # default: 0# max_replication_lag = 10 # default 0 . If greater than 0 and replication lag passes such threshold, the server is shunned# },# {# address = "/var/lib/mysql/mysql.sock"# port = 0# hostgroup = 0# },# {# address="127.0.0.1"# port=21891# hostgroup=0# max_connections=200# },# { address="127.0.0.2" , port=3306 , hostgroup=0, max_connections=5 },# { address="127.0.0.1" , port=21892 , hostgroup=1 },# { address="127.0.0.1" , port=21893 , hostgroup=1 }# { address="127.0.0.2" , port=3306 , hostgroup=1 },# { address="127.0.0.3" , port=3306 , hostgroup=1 },# { address="127.0.0.4" , port=3306 , hostgroup=1 },# { address="/var/lib/mysql/mysql.sock" , port=0 , hostgroup=1 }{ address="mysql-0.mysql-headless.yihuazt.svc.cluster.local" , port=3306 , hostgroup=10 }, { address="mysql-1.mysql-headless.yihuazt.svc.cluster.local" , port=3306 , hostgroup=10 }, { address="mysql-2.mysql-headless.yihuazt.svc.cluster.local" , port=3306 , hostgroup=10 })# defines all the MySQL usersmysql_users:(# {# username = "username" # no default , required# password = "password" # default: ''# default_hostgroup = 0 # default: 0# active = 1 # default: 1# },# {# username = "root"# password = ""# default_hostgroup = 0# max_connections=1000# default_schema="test"# active = 1# },# { username = "user1" , password = "password" , default_hostgroup = 0 , active = 0 }{username = "proxysql"password = "proxysql@1025"active = 1default_hostgroup = 10transaction_persistent = 1})#defines MySQL Query Rulesmysql_query_rules:(# {# rule_id=1# active=1# match_pattern="^SELECT .* FOR UPDATE$"# destination_hostgroup=0# apply=1# },# {# rule_id=2# active=1# match_pattern="^SELECT"# destination_hostgroup=1# apply=1# }{rule_id=1active=1match_digest="^SELECT.*FOR UPDATE$"destination_hostgroup=10apply=1},{rule_id=2active=1match_digest="^SELECT"destination_hostgroup=30apply=1})scheduler=(# {# id=1# active=0# interval_ms=10000# filename="/var/lib/proxysql/proxysql_galera_checker.sh"# arg1="0"# arg2="0"# arg3="0"# arg4="1"# arg5="/var/lib/proxysql/proxysql_galera_checker.log"# })mysql_replication_hostgroups=(# {# writer_hostgroup=30# reader_hostgroup=40# comment="test repl 1"# },# {# writer_hostgroup=50# reader_hostgroup=60# comment="test repl 2"# })mysql_group_replication_hostgroups=({writer_hostgroup=10backup_writer_hostgroup=20reader_hostgroup=30offline_hostgroup=40active=1max_writers=1writer_is_also_reader=0max_transactions_behind=100})# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-File-Grammar## Below is the BNF grammar for configuration files. Comments and include directives are not part of the grammar, so they are not included here. ## configuration = setting-list | empty## setting-list = setting | setting-list setting# # setting = name (":" | "=") value (";" | "," | empty)# # value = scalar-value | array | list | group# # value-list = value | value-list "," value# # scalar-value = boolean | integer | integer64 | hex | hex64 | float# | string# # scalar-value-list = scalar-value | scalar-value-list "," scalar-value# # array = "[" (scalar-value-list | empty) "]"# # list = "(" (value-list | empty) ")"# # group = "{" (setting-list | empty) "}"# # empty =
运行方法与Docker部署一致,差异性的地方已经说明
相关文章:
Mysql(MGR)和ProxySQL搭建部署-Kubernetes版本
一、Mysql(MGR) 1.1 statefulSet.yaml apiVersion: apps/v1 kind: StatefulSet metadata:labels:app: mysqlname: mysqlnamespace: yihuazt spec:replicas: 3serviceName: mysql-headlessselector:matchLabels:app: mysqltemplate:metadata:labels:app: mysqlspec:affinity:p…...
将现有Web 网页封装为macOS应用
文章目录 方式一:Unite for macOS方式二:Web2Desk方式三:Nativefier方式四:Flutter Flutter WebView Plugin总结 方式一:Unite for macOS Unite 是一款专为 macOS 设计的工具,可以将任意 Web 页面快速封装…...

药片(药丸)和胶囊识别数据集,使用yolo,pasical voc xml, coco json格式标注,可识别药片和胶囊两种标签,2445张原始图片
药片(药丸)和胶囊识别数据集,使用yolo,pasical voc xml, coco json格式标注,可识别药片和胶囊两种标签,2445张原始图片 数据集分割 训练组80% 1967图片 有效集13% 317图片 测试集7% 161图片 预处…...
在Linux的世界中怎么玩转定时器任务
定时器使用 先是看到一段使用Linux Sevice服务的脚本,意外发现在ExecStart启动脚本中,它利用无限循环做定时任务的事情,非常突兀! 觉得既然用得了Linux Service,那么,与之配套的cron定时器服务是否更应该…...
HTML——20 自定义属性
<!DOCTYPE html> <html><head><meta charset"UTF-8"><title>自定义属性</title></head><body><a href"https://ai.m.taobao.com" 自定义属性"属性值">淘宝网</a><a href"h…...

2025:OpenAI的“七十二变”?
朋友们,准备好迎接AI的狂欢了吗?🚀 是不是跟我一样,每天醒来的第一件事就是看看AI领域又有什么新动向? 尤其是那个名字如雷贯耳的 OpenAI,简直就是AI界的弄潮儿,一举一动都牵动着我们这些“AI发…...

mac docker部署jar包流程
mac docker部署jar包流程 默认服务器已经准备好了相关的准备工作,如:docker,docker内安装所需软件数据库,jdk等,将要部署等jar包。 1:将jar 包上传到服务器目录下:/usr/local/service (没有目录可以自己创建…...
【postgresql 物化视图】自动刷新物化视图2种方法
普通视图就是一个虚拟表,不占内存。而物化视图是存在的,占内存。 物化视图,默认是手动刷新。下面是手动刷新的例子。我们来创建一个物化视图。 create MATERIALIZED VIEW dnh_analasis_view as select cjsj,a,b,c,d from table_1; REFRESH …...
HMSC联合物种分布模型
联合物种分布模型(Joint Species Distribution Modelling,JSDM)在生态学领域,特别是群落生态学中发展最为迅速,Hmsc是物种群落分层模型的缩写(Hierarchical Modelling of Species Communities),它是一种基于…...
stm32f103zet6 ds18b20
main.c // main.c #include "sys.h" #include "ds18b20.h"int main(void){ uart_init(9600);delay_init();while(DS18B20_Init()) //DS18B20初始化 {printf("error");delay_ms(200);}while(1){printf("%4.2f\r\n",Get_Temp());}}ds18…...
【前端,TypeScript】TypeScript速成(六):函数
函数 函数的定义 定义一个最简单的加法函数: function add(a: number, b: number): number {return a b }(可以看到 JavaScript/TypeScript 的语法与 Golang 也非常的相似) 调用该函数: console.log(add(2, 3)) // out [LOG…...

React引入Echart水球图
在搭建React项目时候,遇到了Echart官方文档中没有的水球图,此时该如何配置并将它显示到项目中呢? 目录 一、拓展网站 二、安装 三、React中引入 1、在components文件夹下新建一个组件 2、在组件中引入 3、使用水波球组件 一、拓展网站 …...

谷歌浏览器的智能推荐功能使用指南
谷歌浏览器作为全球最受欢迎的网络浏览器之一,以其强大的功能和简洁的界面深受用户喜爱。其中,智能推荐功能通过利用先进的算法和数据分析,为用户提供个性化的内容推荐,大大提升了上网体验。本文将详细介绍如何开启和使用谷歌浏览…...

GitHub 上排名前 11 的开源管理后台(Admin Dashboard)项目
如果你是一名开发者,经常处理数据或参与项目管理,那么这篇文章绝对值得收藏!当你需要一个高效、易用的管理后台(Admin Dashboard)项目时,本文会给你灵感。 在现代企业管理和业务运营中,管理后台…...

【运维】部署MKDocs
部署MKDocs obsidian 记录笔记,通过 mkdocs 私有化部署。 1 使用MKDocs创建笔记 创建仓库,安装 Material for MkDocs 和 mkdocs-minify-plugin mkdir tmp cd tmp git initpip install mkdocs-material pip install mkdocs-minify-pluginmkdocs new .2 …...

C# 读取多种CAN报文文件转换成统一格式数据,工具类:CanMsgRead
因为经常有读取CAN报文trace文件的需求,而且因为CAN卡不同、记录软件不同会导致CAN报文trace文件的格式都有差异。为了方便自己后续开发,我写了一个CanMsgRead工具类,只要提供CAN报文路径和CAN报文格式的选项即可将文件迅速读取转换为统一的C…...

计算机网络 (8)物理层的传输方式
一、串行传输与并行传输 串行传输 定义:串行传输是一种数据传输方式,指的是逐位地按照顺序传输数据。在串行传输中,数据位逐个按照一定的顺序进行传输,可以通过单条线路或信道进行。特点: 逐位传输:串行传输…...
【C#】WPF设置Separator为垂直方向
1. 方法1 <Separator BorderBrush"Gray"><Separator.LayoutTransform><RotateTransform Angle"90" /></Separator.LayoutTransform> </Separator>2. 方法2 <Separator Style"{StaticResource {x:Static ToolBar.S…...

太速科技-519-基于ZU19EG的4路100G光纤的PCIe 加速计算卡
基于ZU19EG的4路100G光纤的PCIe 加速计算卡 一、板卡概述 本板卡系我司自主设计研发,基于Xilinx公司Zynq UltraScale MPSOC系列SOC XCZU19EG-FFVC1760架构,支持PCIE Gen3x16模式。其中,ARM端搭载一组64-bit DDR4,总容量达…...

安卓入门二 Kotlin基础
Kotlin Kotlin的历史 Kotlin由Jet Brains公司开发设计,2011年公布第一版,2012年开源。 2016年发布1.0正式版,并且Jet Brains在IDEA加入对Kotlin的支持,安卓自此又有新的选择。 2019年谷歌宣布Kotlin成为安卓第一开发语言&#x…...
Java 语言特性(面试系列2)
一、SQL 基础 1. 复杂查询 (1)连接查询(JOIN) 内连接(INNER JOIN):返回两表匹配的记录。 SELECT e.name, d.dept_name FROM employees e INNER JOIN departments d ON e.dept_id d.dept_id; 左…...
Vue记事本应用实现教程
文章目录 1. 项目介绍2. 开发环境准备3. 设计应用界面4. 创建Vue实例和数据模型5. 实现记事本功能5.1 添加新记事项5.2 删除记事项5.3 清空所有记事 6. 添加样式7. 功能扩展:显示创建时间8. 功能扩展:记事项搜索9. 完整代码10. Vue知识点解析10.1 数据绑…...

阿里云ACP云计算备考笔记 (5)——弹性伸缩
目录 第一章 概述 第二章 弹性伸缩简介 1、弹性伸缩 2、垂直伸缩 3、优势 4、应用场景 ① 无规律的业务量波动 ② 有规律的业务量波动 ③ 无明显业务量波动 ④ 混合型业务 ⑤ 消息通知 ⑥ 生命周期挂钩 ⑦ 自定义方式 ⑧ 滚的升级 5、使用限制 第三章 主要定义 …...

HBuilderX安装(uni-app和小程序开发)
下载HBuilderX 访问官方网站:https://www.dcloud.io/hbuilderx.html 根据您的操作系统选择合适版本: Windows版(推荐下载标准版) Windows系统安装步骤 运行安装程序: 双击下载的.exe安装文件 如果出现安全提示&…...

uniapp微信小程序视频实时流+pc端预览方案
方案类型技术实现是否免费优点缺点适用场景延迟范围开发复杂度WebSocket图片帧定时拍照Base64传输✅ 完全免费无需服务器 纯前端实现高延迟高流量 帧率极低个人demo测试 超低频监控500ms-2s⭐⭐RTMP推流TRTC/即构SDK推流❌ 付费方案 (部分有免费额度&#x…...

用docker来安装部署freeswitch记录
今天刚才测试一个callcenter的项目,所以尝试安装freeswitch 1、使用轩辕镜像 - 中国开发者首选的专业 Docker 镜像加速服务平台 编辑下面/etc/docker/daemon.json文件为 {"registry-mirrors": ["https://docker.xuanyuan.me"] }同时可以进入轩…...

Linux --进程控制
本文从以下五个方面来初步认识进程控制: 目录 进程创建 进程终止 进程等待 进程替换 模拟实现一个微型shell 进程创建 在Linux系统中我们可以在一个进程使用系统调用fork()来创建子进程,创建出来的进程就是子进程,原来的进程为父进程。…...

HDFS分布式存储 zookeeper
hadoop介绍 狭义上hadoop是指apache的一款开源软件 用java语言实现开源框架,允许使用简单的变成模型跨计算机对大型集群进行分布式处理(1.海量的数据存储 2.海量数据的计算)Hadoop核心组件 hdfs(分布式文件存储系统)&a…...

Aspose.PDF 限制绕过方案:Java 字节码技术实战分享(仅供学习)
Aspose.PDF 限制绕过方案:Java 字节码技术实战分享(仅供学习) 一、Aspose.PDF 简介二、说明(⚠️仅供学习与研究使用)三、技术流程总览四、准备工作1. 下载 Jar 包2. Maven 项目依赖配置 五、字节码修改实现代码&#…...

LLMs 系列实操科普(1)
写在前面: 本期内容我们继续 Andrej Karpathy 的《How I use LLMs》讲座内容,原视频时长 ~130 分钟,以实操演示主流的一些 LLMs 的使用,由于涉及到实操,实际上并不适合以文字整理,但还是决定尽量整理一份笔…...