企业营销型网站团队/如何开发一款app软件
Active MQ 07
集群配置
官方文档
http://activemq.apache.org/clustering
主备集群
http://activemq.apache.org/masterslave.html
Master Slave Type | Requirements | Pros | Cons |
---|---|---|---|
Shared File System Master Slave | A shared file system such as a SAN | Run as many slaves as required. Automatic recovery of old masters | Requires shared file system |
JDBC Master Slave | A Shared database | Run as many slaves as required. Automatic recovery of old masters | Requires a shared database. Also relatively slow as it cannot use the high performance journal |
Replicated LevelDB Store | ZooKeeper Server | Run as many slaves as required. Automatic recovery of old masters. Very fast. | Requires a ZooKeeper server. |
Shared File System Master Slave
基于共享存储的Master-Slave;多个broker共用同一数据源,谁拿到锁谁就是master,其他处于待启动状态,如果master挂掉了,某个抢到文件锁的slave变成master
启动后
Master宕机
Master重启
JDBC Master Slave
基于JDBC的Master-Slave:使用同一个数据库,拿到LOCK表的写锁的broker成为master.
性能较低,不能使用高性能日志
Replicated LeveDB Store
基于zookeeper复制LeveDB存储的Master-Slave机制
配置步骤
- 修改broker名称
- 修改数据源
- 如果使用kahadb,配置相同路径
- 如果使用mysql 使用同一数据源(同一数据库和表)
尝试
http://activemq.apache.org/failover-transport-reference.html
failover 故障转移协议
断线重连机制是ActiveMQ的高可用性具体体现之一。ActiveMQ提供failover机制去实现断线重连的高可用性,可以使得连接断开之后,不断的重试连接到一个或多个brokerURL。
默认情况下,如果client与broker直接的connection断开,则client会新起一个线程,不断的从url参数中获取一个url来重试连接。
配置语法
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin","admin","failover:(nio://localhost:5671,nio://localhost:5672)");
可配置选项
Transport Options
Option Name | Default Value | Description |
---|---|---|
backup | false | Initialize and hold a second transport connection - to enable fast failover. |
initialReconnectDelay | 10 | The delay (in ms) before the first reconnect attempt. |
maxCacheSize | 131072 | Size in bytes for the cache of tracked messages. Applicable only if trackMessages is true . |
maxReconnectAttempts | `-1 | 0` |
maxReconnectDelay | 30000 | The maximum delay (in ms) between the second and subsequent reconnect attempts. |
nested.* | null | From ActiveMQ 5.9: common URI options that will be applied to each URI in the list**.** |
randomize | true | If true , choose a URI at random from the list to use for reconnect. |
reconnectDelayExponent | 2.0 | The exponent used during exponential back-off attempts. |
reconnectSupported | true | Determines whether the client should respond to broker ConnectionControl events with a reconnect (see: rebalanceClusterClients ). |
startupMaxReconnectAttempts | -1 | A value of -1 denotes that the number of connection attempts at startup should be unlimited. A value of >=0 denotes the number of reconnect attempts at startup that will be made after which an error is sent back to the client when the client makes a subsequent reconnect attempt. Note: once successfully connected the maxReconnectAttempts option prevails. |
timeout | -1 | From ActiveMQ 5.3: set the timeout on send operations (in ms) without interruption of re-connection process. |
trackMessages | false | Keep a cache of in-flight messages that will flushed to a broker on reconnect. |
updateURIsSupported | true | From ActiveMQ 5.4: determines whether the client should accept updates from the broker to its list of known URIs. |
updateURIsURL | null | From ActiveMQ 5.4: a URL (or path to a local file) to a text file containing a comma separated list of URIs to use for reconnect in the case of failure. |
useExponentialBackOff | true | If true an exponential back-off is used between reconnect attempts. |
warnAfterReconnectAttempts | 10 | From ActiveMQ 5.10: a value >0 specifies the number of reconnect attempts before a warning is logged. A logged warning indicates that there is no current connection but re-connection is being attempted. A value of <=0 disables the logging of warnings about reconnect attempts. |
backup
初始化的时候创建第二个连接,快速故障转移
initialReconnectDelay
第一次重试延迟
trackMessages
设置是否缓存(故障发生时)尚未传送完成的消息,当broker一旦重新连接成功,便将这些缓存中的消息刷新到新连接的代理中,使得消息可以在broker切换前后顺利传送。默认false
maxCacheSize
当trackMessage启动时,缓存的最大子字节数
maxReconnectAttempts
默认1|0,自5.6版本开始,-1为默认值,代表不限重试次数,0标识从不重试(只尝试连接一次,并不重连),5.6以前的版本,0为默认值,代表不重试,如果设置大于0的数,则代表最大重试次数。
maxReconnectDelay
最长重试间隔
randomize
使用随机连接,以达到负载均衡的目的,默认true
只配主备的情况下最好关闭
startupMaxReconnectAttempts
初始化时的最大重试次
“-1”表示在启动时连接尝试的次数是无限的。
’ >=0 '的值表示在启动时重新连接尝试的次数
一旦成功连接后续将使用“maxReconnectAttempts”选项
timeout
连接超时
updateURIsSupported
是否可以动态修改broker uri
updateURIsURL
指定动态修改地址的路径
useExponentialBackOff
重连时间间隔是否以指数形式增长
reconnectDelayExponent
指数增长时的指数
warnAfterReconnectAttempts
重连日志记录
负载均衡
官方文档
http://activemq.apache.org/networks-of-brokers.html
静态网络配置
在broker节点下配置networkConnectors
- networkConnectors(网络连接器)主要用来配置ActiveMQ服务端与服务端之间的通信
- TransportConnector(传输连接器)主要用于配置ActiveMQ服务端和客户端之间的通信方式
<networkConnectors><networkConnector duplex="true" name="amq-cluster" uri="static:failover://(nio://localhost:5671,nio://localhost:5672)" />
</networkConnectors>
参与的节点都需要修改
注意如果单机启动多个节点,记得修改端口避免冲突
启动成功后Connections
中会有其他节点
Network
中也会显示桥接连接
负载均衡的环境下,broker上的消息优先给在本地连接的consumer
当networkerConnector与remote Broker建立链接之后,那么remote Broker将会向local Broker交付订阅信息,包括remote broker持有的destinations、Consumers、持久订阅者列表等;那么此后local Broker将把remote Broker做一个消息“订阅者”
Advisory
ActiveMQ提供了“Advisory”机制,通常ActiveMQ内部将某些事件作为“advisory”在全局广播,比如destination的创建、consumer的加入、DLQ的产生等,这将额外的消耗极小的性能;我们可以在ActiveMQ的监控页面上看到影响的消息,开发者也可以View这些消息(通道名称以“ActiveMQ.Advisory.”开头)。对于分布式网络中的broker,将严重依赖“Advisory”,特别是“dynamic network”,默认已开启
在一个broker上发生事件,都会以“通知”的方式发送给配置文件中指定的所有networkConnector
Dynamic networks
“动态网络”表明当remote Broker持有通道的消费者时,local Broker才会转发相应的消息;此时我们需要开启advisorySupport。当remote broker上有Consumer创建时,Advisory中将会广播消息,消息为ConsumerInfo类型,它将包括consumer所在的broker path,如果local broker与此path建立了networkConnector,那么此后local Broker将会启动响应的消息转发。
Static networks
相对于“动态网络”而言,“静态网络”将不依赖Advisory,在任何时候,即使remote Broker中没有相应的consumer,消息也将转发给remote Broker
将brokers作为简单代理并转发消息到远端而不管是否有消费者
可配置属性
URI的几个属性
property | default | description |
---|---|---|
initialReconnectDelay | 1000 | time(ms) to wait before attempting a reconnect (if useExponentialBackOff is false) |
maxReconnectDelay | 30000 | time(ms) to wait before attempting to re-connect |
useExponentialBackOff | true | increases time between reconnect for every failure in a reconnect sequence |
backOffMultiplier | 2 | multipler used to increase the wait time if using exponential back off |
NetworkConnector Properties
property | default | description |
---|---|---|
name | bridge | name of the network - for more than one network connector between the same two brokers - use different names |
dynamicOnly | false | if true, only activate a networked durable subscription when a corresponding durable subscription reactivates, by default they are activated on startup. |
decreaseNetworkConsumerPriority | false | if true, starting at priority -5, decrease the priority for dispatching to a network Queue consumer the further away it is (in network hops) from the producer. When false all network consumers use same default priority(0) as local consumers |
networkTTL | 1 | the number of brokers in the network that messages and subscriptions can pass through (sets both message&consumer -TTL) |
messageTTL | 1 | (version 5.9) the number of brokers in the network that messages can pass through |
consumerTTL | 1 | (version 5.9) the number of brokers in the network that subscriptions can pass through (keep to 1 in a mesh) |
conduitSubscriptions | true | multiple consumers subscribing to the same destination are treated as one consumer by the network |
excludedDestinations | empty | destinations matching this list won’t be forwarded across the network (this only applies to dynamicallyIncludedDestinations) |
dynamicallyIncludedDestinations | empty | destinations that match this list will be forwarded across the network n.b. an empty list means all destinations not in the exluded list will be forwarded |
useVirtualDestSubs | false | if true, the network connection will listen to advisory messages for virtual destination consumers |
staticallyIncludedDestinations | empty | destinations that match will always be passed across the network - even if no consumers have ever registered an interest |
duplex | false | if true, a network connection will be used to both produce *AND* Consume messages. This is useful for hub and spoke scenarios when the hub is behind a firewall etc. |
prefetchSize | 1000 | Sets the prefetch size on the network connector’s consumer. It must be > 0 because network consumers do not poll for messages |
suppressDuplicateQueueSubscriptions | false | (from 5.3) if true, duplicate subscriptions in the network that arise from network intermediaries will be suppressed. For example, given brokers A,B and C, networked via multicast discovery. A consumer on A will give rise to a networked consumer on B and C. In addition, C will network to B (based on the network consumer from A) and B will network to C. When true, the network bridges between C and B (being duplicates of their existing network subscriptions to A) will be suppressed. Reducing the routing choices in this way provides determinism when producers or consumers migrate across the network as the potential for dead routes (stuck messages) are eliminated. networkTTL needs to match or exceed the broker count to require this intervention. |
bridgeTempDestinations | true | Whether to broadcast advisory messages for created temp destinations in the network of brokers or not. Temp destinations are typically created for request-reply messages. Broadcasting the information about temp destinations is turned on by default so that consumers of a request-reply message can be connected to another broker in the network and still send back the reply on the temporary destination specified in the JMSReplyTo header. In an application scenario where most/all messages use request-reply pattern, this will generate additional traffic on the broker network as every message typically sets a unique JMSReplyTo address (which causes a new temp destination to be created and broadcasted via an advisory message in the network of brokers). When disabling this feature such network traffic can be reduced but then producer and consumers of a request-reply message need to be connected to the same broker. Remote consumers (i.e. connected via another broker in your network) won’t be able to send the reply message but instead raise a “temp destination does not exist” exception. |
alwaysSyncSend | false | (version 5.6) When true, non persistent messages are sent to the remote broker using request/reply in place of a oneway. This setting treats both persistent and non-persistent messages the same. |
staticBridge | false | (version 5.6) If set to true, broker will not dynamically respond to new consumers. It will only use staticallyIncludedDestinations to create demand subscriptions |
userName | null | The username to authenticate against the remote broker |
password | null | The password for the username to authenticate against the remote broker |
name
相同的名称会被添加到同一集群中
dynamicOnly
是否直接转发,设置成true的话 broker会在没有消费者的时候不去转发消息
decreaseNetworkConsumerPriority
如果为true,网络的消费者优先级降低为-5。如果为false,则默认跟本地消费者一样为0.
networkTTL messageTTL consumerTTL
消息和订阅在网络中被broker转发(穿过)的最大次数,消息在网络中每转发一次,都会将TTL-1
conduitSubscriptions
多个消费者消费消息被当作一个消费者
excludedDestinations
在这个名单中的Destination不会在网络中被转发
<excludedDestinaitons><queue physicalName="include.test.foo"/><topic physicalName="include.test.bar"/></excludedDestinaitons>
dynamicallyIncludedDestinations
通过网络转发的destinations,注意空列表代表所有的都转发。
<dynamicallyIncludeDestinaitons><queue physicalName="include.test.foo"/><topic physicalName="include.test.bar"/></dynamicallyIncludeDestinaitons>
useVirtualDestSubs
开启此选项会在转发消息时
staticallyIncludedDestinations
匹配的目的地将始终通过网络传递——即使没有消费者对此感兴趣 对应静态networks
<staticallyIncludeDestinaitons><queue physicalName="aways.include.queue"/></staticallyIncludeDestinaitons>
duplex
是否允许双向连接如果该属性为true,当这个节点使用Network Bridge连接到其它目标节点后,将强制目标也建立Network Bridge进行反向连接
prefetchSize
缓冲消息大小,必须大于0,不会主动拉取消息
suppressDuplicateQueueSubscriptions
如果为true, 重复的订阅关系一产生即被阻止。
bridgeTempDestinations
是否转发临时destination,禁用后再使用request/reply模型的时候客户端需要连接到同一broker,不然会找不到destination
alwaysSyncSend
开启后转发非持久化消息会使用request/reply模型
staticBridge
如果设置为true,则代理将不会动态响应新的consumer,只能使用staticallyIncludedDestinations中的destination
userName password
连接broker时的用户名和密码
动态网络配置
官方文档
http://activemq.apache.org/multicast-transport-reference
使用multicast协议,可以指定组播地址或使用multicast://default
(239.255.2.3)
配置networkConnectors
<networkConnectors><networkConnector uri="multicast://239.0.0.5" duplex="false"/>
</networkConnectors>
broker启动后会使用udp协议向组播地址发送数据报文以便让其他在这个组播地址的节点感知到自己的存在
每个UDP数据报中,包含的主要信息包括本节点ActiveMQ的版本信息,以及连接到自己所需要使用的host名字、协议名和端口信息。
配置transportConnector
指明将哪一个连接通过UDP数据报向其他ActiveMQ节点进行公布,就需要在transportConnector标签上使用discoveryUri属性进行标识
<transportConnector name="auto+nio" uri="auto+nio://localhost:5672" discoveryUri="multicast://239.0.0.5"/>
消息回流
在消息转发的时候,remote broker转发Local broker的消息会消费掉LocalBroker的消息
那么在转发的过程中,消息在被拉取后和发送给consumer的过程中重启的话会造成消息丢失
replayWhenNoConsumers
选项可以使remote broke上有需要转发的消息但是没有被消费时,把消息回流到它原始的broker.同时把enableAudit设置为false,为了防止消息回流后被当作重复消息而不被分发
<destinationPolicy><policyMap><policyEntries><policyEntry queue=">" enableAudit="false"><networkBridgeFilterFactory><conditionalNetworkBridgeFilterFactory replayWhenNoConsumers="true"/></networkBridgeFilterFactory></policyEntry></policyEntries></policyMap></destinationPolicy>
消息副本
http://activemq.apache.org/replicated-message-store
相关文章:

ActiveMQ 07 集群配置
Active MQ 07 集群配置 官方文档 http://activemq.apache.org/clustering 主备集群 http://activemq.apache.org/masterslave.html Master Slave TypeRequirementsProsConsShared File System Master SlaveA shared file system such as a SANRun as many slaves as requ…...

Redis(哨兵模式)
什么是哨兵机制 问题: redis 主从复制模式下, 一旦主节点由于故障不能提供服务, 需要人工进行主从切换, 同时大量客户端需要被通知切换到新的主节点上, 对于有一定规模的应用来说, 对于人力的资源消耗会很大.解决: 通过哨兵对主从结构进行监控, 一旦出现主节点挂了的情况, 自动…...

一种基于镜像指示位办法的RingBuffer实现,解决Mirror和2的幂个数限制
简介 在嵌入式开发中,经常有需要用到RingBuffer的概念,在RingBuffer中经常遇到一个Buffer满和Buffer空的判断的问题,一般的做法是留一个单位的buffer不用,这样做最省事,但是当RingBuffer单位是一个结构体时࿰…...

【Java开发指南 | 第十一篇】Java运算符
读者可订阅专栏:Java开发指南 |【CSDN秋说】 文章目录 算术运算符关系运算符位运算符逻辑运算符赋值运算符条件运算符(?:)instanceof 运算符Java运算符优先级 Java运算符包括:算术运算符、关系运算符、位运算符、逻辑运算符、赋值…...

【IC前端虚拟项目】验证环境方案思路和文档组织
【IC前端虚拟项目】数据搬运指令处理模块前端实现虚拟项目说明-CSDN博客 对于mvu的验证环境,从功能角度就可以分析出需要搭建哪些部分,再看一下mvu的周围环境哈: 很明显验证环境必然要包括几个部分: 1.模拟idu发送指令; 2.模拟ram/ddr读写数据; 3.rm模拟mvu的行为; …...

程序设计|C语言教学——C语言基础1:C语言的引入和入门
一、程序的执行 1.定义 解释:借助一个程序,那个程序能够试图理解你的程序,然后按照你的要求执行。下次执行的时候还需要从零开始解释。 编译:借助一个程序,能够像翻译官一样,把你的程序翻译成机器语言&a…...

初学python记录:力扣928. 尽量减少恶意软件的传播 II
题目: 给定一个由 n 个节点组成的网络,用 n x n 个邻接矩阵 graph 表示。在节点网络中,只有当 graph[i][j] 1 时,节点 i 能够直接连接到另一个节点 j。 一些节点 initial 最初被恶意软件感染。只要两个节点直接连接,…...

LlamaIndex 组件 - Storing
文章目录 一、储存概览1、概念2、使用模式3、模块 二、Vector Stores1、简单向量存储2、矢量存储选项和功能支持3、Example Notebooks 三、文件存储1、简单文档存储2、MongoDB 文档存储3、Redis 文档存储4、Firestore 文档存储 四、索引存储1、简单索引存储2、MongoDB 索引存储…...

在Linux系统中设定延迟任务
一、在系统中设定延迟任务要求如下: 要求: 在系统中建立easylee用户,设定其密码为easylee 延迟任务由root用户建立 要求在5小时后备份系统中的用户信息文件到/backup中 确保延迟任务是使用非交互模式建立 确保系统中只有root用户和easylee用户…...

JVM之方法区的详细解析
方法区 方法区:是各个线程共享的内存区域,用于存储已被虚拟机加载的类信息、常量、即时编译器编译后的代码等数据,虽然 Java 虚拟机规范把方法区描述为堆的一个逻辑部分,但是也叫 Non-Heap(非堆) 设置方法…...

Go 使用ObjectID
ObjectID介绍 MongoDB中的ObjectId是一种特殊的12字节 BSON 类型数据,用于为主文档提供唯一的标识符,默认情况下作为 _id 字段的默认值出现在每一个MongoDB集合中的文档中。以下是ObjectId的具体组成: 1. 时间戳(Timestamp&…...

基于SpringBoot+Vue的疾病防控系统设计与实现(源码+文档+包运行)
一.系统概述 在如今社会上,关于信息上面的处理,没有任何一个企业或者个人会忽视,如何让信息急速传递,并且归档储存查询,采用之前的纸张记录模式已经不符合当前使用要求了。所以,对疾病防控信息管理的提升&a…...

2024年阿里云4核8G配置云服务器价格低性能高!
阿里云4核8G服务器租用优惠价格700元1年,配置为ECS通用算力型u1实例(ecs.u1-c1m2.xlarge)4核8G配置、1M到3M带宽可选、ESSD Entry系统盘20G到40G可选,CPU采用Intel(R) Xeon(R) Platinum处理器,阿里云优惠 aliyunfuwuqi…...

关于ContentProvider这一遍就够了
ContentProvider是什么? ContentProvider是Android四大组件之一,主要用于不同应用程序之间或者同一个应用程序的不同部分之间共享数据。它是Android系统中用于存储和检索数据的抽象层,允许不同的应用程序通过统一的接口访问数据,…...

《1w实盘and大盘基金预测 day23》
这几天预测错麻了,哈哈哈,完全和技术没关系,全是消息面。 昨日预测: 2958-2984-3010 证券继续下跌,昨天诱多把我诱惑进去了(看2-3天的反弹也没了),今天直接出掉昨天买的。 整体操作…...

向量数据库与图数据库:理解它们的区别
作者:Elastic Platform Team 大数据管理不仅仅是尽可能存储更多的数据。它关乎能够识别有意义的见解、发现隐藏的模式,并做出明智的决策。这种对高级分析的追求一直是数据建模和存储解决方案创新的驱动力,远远超出了传统关系数据库。 这些创…...

WIN7用上最新版Chrome
1.下载WIN10最新版Chrome的离线安装包 谷歌浏览器 Chrome 最新版离线安装包下载地址 v123.0.6312.123 - 每日自动更新 | 异次元软件 文件名称:123.0.6312.123_chrome_installer.exe。 123.0.6312.123_chrome_installer.exe 文件右键解压缩得到 chrome.7z&#x…...

node.jd版本降级/升级
第一步.先清空本地安装的node.js版本 按健winR弹出窗口,键盘输入cmd,然后敲回车(或者鼠标直接点击电脑桌面最左下角的win窗口图标弹出,输入cmd再点击回车键) 进入命令控制行窗口,输入where node,查看本地…...

python+playwright 学习-88 禁止加载图片等资源
前言 对于爬虫的小伙伴来说,有时候只需抓取页面的文本,不用加载图片,可以加快操作页面速度,那么我们可以设置禁止加载图片等资源。 禁止图片加载 根据url地址的后缀,图片资源后缀一般是png,jpg,jpeg,gif等格式。 from playwright.sync_api import sync_playwrightwith…...

Linux:Redis7.2.4的简单在线部署(1)
注意:我写的这个文章是以最快速的办法去搭建一个redis的基础环境,作用是为了做实验简单的练习,如果你想搭建一个相对稳定的redis去使用,可以看我下面这个文章 Linux:Redis7.2.4的源码包部署(2)-…...

HackMyVM-Connection
目录 信息收集 arp nmap WEB web信息收集 dirsearch smbclient put shell 提权 系统信息收集 suid gdb提权 信息收集 arp ┌─[rootparrot]─[~/HackMyVM] └──╼ #arp-scan -l Interface: enp0s3, type: EN10MB, MAC: 08:00:27:16:3d:f8, IPv4: 192.168.9.115 S…...

Prometheus接入AlterManager配置邮件告警(基于K8S环境部署)
目录 一.配置Alertmanager告警发送至邮箱二.Prometheus接入AlertManager三.部署PrometheusAlterManager(放到一个Pod中)四. 测试告警 基于 此环境做实验 一.配置Alertmanager告警发送至邮箱 1.创建AlertManager ConfigMap资源清单 vim alertmanager-cm.yaml --- kind: Confi…...

find方法
find() 方法用于在数组中查找符合条件的第一个元素,并返回该元素。如果找到匹配的元素,则返回该元素的值;如果未找到匹配的元素,则返回 undefined。 例如: const firstWithdrawal movements.find(mov > mov < 0); consol…...

TLS v1.3 导致JetBrains IDE jdk.internal.net.http.common CPU占用高
开发环境 GoLand版本:2022.3.4 问题原因 JDK 中的 TLS v1.3 实现引起 解决办法 使用 SOCKS 代理代替HTTP代理 禁用 Space 和 Code With Me 插件 禁用 TLS v1.3,参考:https://stackoverflow.com/questions/54485755/java-11-httpclient-…...

计算机网络 2.2数据传输方式
第二节 数据传输方式 一、数据通信系统模型 添加图片注释,不超过 140 字(可选) 1.数据终端设备(DTE) 作用:用于处理用户数据的设备,是数据通信系统的信源和信宿。 设备:便携计算机…...

陇剑杯 流量分析 webshell CTF writeup
陇剑杯 流量分析 链接:https://pan.baidu.com/s/1KSSXOVNPC5hu_Mf60uKM2A?pwdhaek 提取码:haek目录结构 LearnCTF ├───LogAnalize │ ├───linux简单日志分析 │ │ linux-log_2.zip │ │ │ ├───misc日志分析 │ │ …...

【测试开发学习历程】python常用的模块(下)
目录 8、MySQL数据库的操作-pymysql 8.1 连接并操作数据库 9、ini文件的操作-configparser 9.1 模块-configparser 9.2 读取ini文件中的内容 9.3 获取指定建的值 10 json文件操作-json 10.1 json文件的格式或者json数据的格式 10.2 json.load/json.loads 10.3 json.du…...

GCDAsynSocket之TCP简析
GCDAsynSocket是一个开源的基于GCD的异步的socket库。它支持IPV4和IPV6地址,TLS/SSL协议。同时它支持iOS端和Mac端。本篇主要介绍一下GCDAsynSocket中的TCP用法和实现。 首先通过下面这个方法初始化一个GCDAsynSocket对象。 - (id)initWithDelegate:(id<GCDAsyn…...

大型网站系统架构演化实例_1.单体架构和垂直架构
大型网站的技术挑战主要来自于庞大的用户,高并发的访问和海量的数据,任何简单的业务一旦需要处理数以P计的数据和面对数以亿计的用户,问题就会变得很棘手。通常大型网站架构主要解决这类问题。 1.第一阶段:单体架构 大型网站都是…...

2024蓝桥杯——宝石问题
先展示题目 声明 以下代码仅是我的个人看法,在自己考试过程中的优化版,本人考试就踩了很多坑,我会—一列举出来。代码可能很多,但是总体时间复杂度不高只有0(N) 函数里面的动态数组我没有写开辟判断和free,这里我忽略…...