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部署一致,差异性的地方已经说明

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/497820.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Elasticsearch检索方案之一:使用from+size实现分页

Elasticsearch8.17.0在mac上的安装 Kibana8.17.0在mac上的安装 快速掌握Elasticsearch检索之二&#xff1a;滚动查询(scrool)获取全量数据 Elasticsearch检索之三&#xff1a;官方推荐方案search_after检索实现 前面两篇文章介绍了elasticsearch以及Kibana的安装&…

Unity 实现Canvas显示3D物体

新建一个UI相机&#xff0c;选择渲染层为UI 将主相机的渲染层去掉UI层 、 将Canvas的RenderMode设置为Screen Space - Camera,将RenderCamera设置为UI相机 新建3D物体的UI父物体&#xff0c;并将3D物体的层级设置为UI层 适当的放缩3DObjParent&#xff0c;让3D物体能显示出来…

termux-boot安卓开机自动启动应用

termux安装 github 蓝奏云 v119.1 termux-boot安装 github 蓝奏云 v0.8.1 安装 给权限运行加锁后台 am启动应用命令 am start -n 包名/启动项获取包名和启动入口&#xff08;图中app为爱玩机工具箱&#xff09; 例 简黑时钟蓝奏云 包名com.hm.jhclock 桌面启动项com.hm.jh…

mybatis-plus自动填充时间的配置类实现

mybatis-plus自动填充时间的配置类实现 在实际操作过程中&#xff0c;我们并不希望创建时间、修改时间这些来手动进行&#xff0c;而是希望通过自动化来完成&#xff0c;而mybatis-plus则也提供了自动填充功能来实现这一操作&#xff0c;接下来&#xff0c;就来了解一下mybatis…

【Agent】Chatbot、Copilot与Agent如何帮助我们的提升效率?

人工智能&#xff08;AI&#xff09;技术的迅猛发展正在深刻改变我们的生活和工作方式。你是否曾想过&#xff0c;未来的工作场景会是什么样子&#xff1f;AI的崛起不仅仅是科技的进步&#xff0c;更是我们生活方式的革命。今天&#xff0c;我们将深入探讨三种主要的AI能力&…

爱思唯尔word模板

爱思唯尔word模板 有时候并不一定非得latex https://download.csdn.net/download/qq_38998213/90199214 参考文献书签链接

【Raven1靶场渗透】

文章目录 一、基础信息 二、信息收集 三、暴力破解 四、提权 一、基础信息 Kali IP &#xff1a;192.168.20.146 靶机IP &#xff1a;192.168.20.153 二、信息收集 nmap -sS -sV -p- -A 192.168.20.153 开放了22&#xff0c;80&#xff0c;111&#xff0c;58305端口 访…

QGIS二次开发(地图符号库操作)

实习三 地图符号库操作 3.1 任务要求 基于QGIS&#xff0c;实现地图符号的设计/存储与显示&#xff1b;基于QGIS实现一个点、线、面shp矢量图层文件的显示。通过设置引用的符号&#xff0c;改变矢量图层的显示效果&#xff1b;可编辑地图的符号库汇中的点符号、线符号、面符号…

Pytorch | 利用VA-I-FGSM针对CIFAR10上的ResNet分类器进行对抗攻击

Pytorch | 利用VA-I-FGSM针对CIFAR10上的ResNet分类器进行对抗攻击 CIFAR数据集VA-I-FGSM介绍相关定义算法流程 VAI-FGSM代码实现VAI-FGSM算法实现攻击效果 代码汇总vaifgsm.pytrain.pyadvtest.py 之前已经针对CIFAR10训练了多种分类器&#xff1a; Pytorch | 从零构建AlexNet对…

Elasticsearch:使用 Ollama 和 Go 开发 RAG 应用程序

作者&#xff1a;来自 Elastic Gustavo Llermaly 使用 Ollama 通过 Go 创建 RAG 应用程序来利用本地模型。 关于各种开放模型&#xff0c;有很多话要说。其中一些被称为 Mixtral 系列&#xff0c;各种规模都有&#xff0c;而一种可能不太为人所知的是 openbiollm&#xff0c;这…

实战案例——ZooKeeper集群部署(新手教程超详细)

案例目标 了解ZooKeeper分布式应用程序协调服务使用3台机器搭建ZooKeeper集群使用ZooKeeper集群 案例分析 规划节点 ZooKeeper集群节点规划 Ip 主机名 节点 192.168.110.10 zookeeper1 集群节点 192.168.110.20 zookeeper2 集群节点 192.168.110.30 zookeeper3 …

上手教程:使用Terraform打造弹性VPC架构

最近Akamai发布的虚拟专用云&#xff08;VPC&#xff09;功能提供了一种隔离的网络&#xff0c;让云资源可以用私密的方式进行通信。 关于Akamai VPC功能&#xff0c;最棒的地方在于它有着极高的灵活性。用户可以通过Cloud Manager、开发人员工具&#xff08;如CLI&#xff09…

基于python的扫雷游戏

游戏 游戏目标&#xff1a; 揭开所有非地雷的格子。 如果揭开地雷&#xff0c;游戏失败。 使用标记功能&#xff08;&#x1f6a9;&#xff09;来标记可能的地雷位置。 格子类型&#xff1a; 空白格子&#xff1a;表示周围没有地雷。 数字格子&#xff1a;显示周围 8 个格子…

利用Java爬虫速卖通按关键字搜索AliExpress商品

在这个信息爆炸的时代&#xff0c;数据的价值日益凸显。对于电商领域的从业者来说&#xff0c;能够快速获取商品信息成为了一项重要的技能。速卖通&#xff08;AliExpress&#xff09;作为全球领先的跨境电商平台&#xff0c;拥有海量的商品数据。本文将介绍如何使用Java语言编…

Java中三大构建工具的发展历程(Ant、Maven和Gradle)

&#x1f438; 背景 我们要写一个Java程序&#xff0c;一般的步骤是编译&#xff0c;测试&#xff0c;打包。 这个构建的过程&#xff0c;如果文件比较少&#xff0c;我们可以手动使用java, javac,jar命令去做这些事情。但当工程越来越大&#xff0c;文件越来越多&#xff0c…

ubuntu快速入门

1.进入某个文件夹 cd workspace/2.tab自动补全 3.列出当前文件夹所有文件 ls列出所有文件包括隐藏文件 ls -a 4.创建文件夹 mkdir linuxLearn 5.创建文件 gedit command.sh在commmand.sh键入 echo hello echo hi? echo how are you? PS:touch hello.txt(也可以创建新…

meshy的文本到3d的使用

Meshy官方网站&#xff1a; 中文官网&#xff1a; Meshy官网中文站 ​编辑 Opens in a new window ​编辑www.meshycn.com Meshy AI 中文官网首页 英文官网&#xff1a; Meshy目前似乎还没有单独的英文官网&#xff0c;但您可以在中文官网上找到英文界面或相关英文资料。 链…

嵌入式入门Day34

网络编程 Day1 为什么要学习网络编程&#xff1f;网络发展历史APRAnet阶段TCP/IP两个协议阶段网络体系结构及OSI开放系统系统互联模型网络体系结构概念OSI开放系统互联模型 TCP和UDP异同网络基础相关的概念字节序IP地址的转换IP地址子网掩码端口号 为什么要学习网络编程&#x…

代码解析:安卓VHAL的AIDL参考实现

以下内容基于安卓14的VHAL代码。 总体架构 参考实现采用双层架构。上层是 DefaultVehicleHal&#xff0c;实现了 VHAL AIDL 接口&#xff0c;并提供适用于所有硬件设备的通用 VHAL 逻辑。下层是 FakeVehicleHardware&#xff0c;实现了 IVehicleHardware 接口。此类可模拟与实…

【视觉惯性SLAM:四、相机成像模型】

相机成像模型介绍 相机成像模型是计算机视觉和图像处理中的核心内容&#xff0c;它描述了真实三维世界如何通过相机映射到二维图像平面。相机成像模型通常包括针孔相机的基本成像原理、数学模型&#xff0c;以及在实际应用中如何处理相机的各种畸变现象。 一、针孔相机成像原…