SpringCloud 如何做到不同zone服务隔离 5C

3个回答

SpringCloudconfig不是可以使用git作为配置中心存储吗,你不同省份的保存到不同的文件夹下就可以了，

airfling 回复一壶酒: 动态的你就不要放到注解里面啦，你肯定要有个服务中心来管理所有的服务的，例如nginx服务器做路由，对外暴露肯定是一个服务的地址，最后只需要根据应用名来选择对应的服务即可

airfling 这个在spring cloud config里面是很容易配置，因为你要为每个系统配置应用名，标识，和版本号，都是可以配置的

SpringCloudconfig不是可以使用git作为配置中心存储吗,你不同省份的保存到不同的文件夹下就可以了，

Java连接数据库连接不上出现时区错误代码都没问题，Mysq server版本也没问题

How Far Can Drive At Most 具体代码实现
Problem Description Now I am going to drive on a street. The street is a straight line. It will cost me one unit oil per meter. And my car can contain V units at most. Unfortunately some zones of the street have been damaged badly. The number of damaged zones is Q. One zone is represented as (l, r, C), means the zone between l to r is damaged, and it will cost me another C units of oil per peter. Please notice that zones may intersect. My question is how far can I drive at most. Input Several cases(cases <= 10). The first line is the case number T. Then T cases follow. For each case : First line two integers l (indicating the length of the street) and V (indicating the amount of oil my car can contain at most when I start)(1 <= len, V <= 10 ^ 9). Second line of each case is an integer Q (0 <= Q <= 50000). Then Q lines follow, each with three integers (l, r, C), means the zone between l to r has been damaged and it will cost me another C units of oil per meter(1 <= l < r <= len, 1 <= C <= 100). (If you still can not understand the details, please see the hint.) Output For each case, print the farthest I can drive, and output it with exactly two digits after the decimal point. Sample Input 2 100 100 2 10 20 5 10 30 14 1000 10000 3 10 20 4 10 30 14 10 15 5 Sample Output 14.50 1000.00
John's Canonical Difference Bound Matrices 的程序
Problem Description When John studied the timed automaton, he met the problem about how to trigger the machine. With the problem deeply studied, he found that it can be ascribed to the clock constraints of the timed automaton. The timed automation in question is described below: The clock variables, or simply clocks, are variables whose values are integers. Of course, time passes at the same rate for all clocks, and any clock can be reset to zero. John uses C to denote the finite set of clocks, and defines the clock constraints for C as follows: (1) All inequalities of the form t#c or c#t are clock constraints, where t is a clock, # is either < or <= , and c is an integer. (2) If A1 and A2 are clock constraints, then A1 ^ A2 is a clock constraint. John notes that a clock constraint can define several regions in some multidimensional space. He wants to know such regions, so he defines the clock zones recursively as follows. For simplicity, he let C0 = C {x0} , where x0 is a reference clock whose value is always 0. The clock zone A can be described by a Difference Bound Matrix D (called a DBM) which is a matrix (Dij) of size | C0|×| C0| . Each Dij has the form (dij,#) , where dij Z {\$} , # { < ,<=} . The value of Dij can be evaluated in the following form: For every inequality xi - xj#dij in clock zone A , let Dij = (dij,#) , where xi and xj are two clocks. If the bound of xi - xj for xi and xj is unknown, let Dij = (\$, < ) . For example, DBM of the clock zone given by x1 - x2 < 2 ^ 0 < x2<=2 ^ 1<=x1 is shown below: The representation of a clock zone by a DBM is not unique. In this example, there are some implied constraints that are not reflected in the DBM. Since x1 - x2 < 2 and x2<=2 , it must be the case x1 < 4 . Since x0 = 0 , the original D10 = (\$, < ) can be changed into D10 = (4, < ) . Such adjusting operation is called the tighten operation. Now John wants to do the similar adjusting operations of difference bounds for all clocks xi and xj until further application of this tighten operation does not change the matrix. John obtains the following new canonical difference bound matrix: Note that some clock zone may contain contrary conditions and has not canonical difference bound matrix. But John can not obtain a canonical difference bound matrix for a complex clock zone. He asks for your help. Input The first line of the input file is a single integer T (1<=T<=20) , which is the number of test cases you must process, followed by T test cases: Each test case consists of several lines. Four integers i , j , d and r are given on each line, representing a constraint xi - xj < d or xi - xj<=d (0<=i, j<=m, -10000 < d < 10000) . If r = 0 , then this line represents an inequality in the form of xi - xj < d , otherwise it represents an inequality in the form of xi - xj<=d . The maximal index m of clocks indicates that the indexes of the clocks are 0, 1,..., m,(1<=m<=100) . Note that you have to get the value of m by yourself. A symbol # given on a single line indicates the end of a test case. Output For each test case, first output ``Case #:" on a single line, where # is the case number starting from 1. Print a blank line after each test case. For each test case, output the description of the canonical difference bound matrix. If it doesn't have a canonical difference bound matrix, print ``Canonical DBM does not exist." (without quotes); If it has a such canonical difference bound matrix, print the matrix in the format as indicated in the sample output. Every element Dij of the matrix should be written in the form (dij,#) , where # is either < or <=. If the bound of xi - xj for xi and xj is unknown, print (\$,<) at the position (i, j) . Two consecutive elements on each row should be separated by a single space. Sample Input 1 1 2 2 0 0 2 0 0 2 0 2 1 0 1 -1 1 # Sample Output Case 1: (0,<=) (-1,<=) (0,<) (4,<) (0,<=) (2,<) (2,<=) (1,<=) (0,<=)

Bus Pass 的算法问题
springcloud zookeeper注册中心，在客服端用restTemplate 访问，第一次访问正常，第二次以后都是失败

Router>en Router#conft Enterconfiguration commands, one per line. End with CNTL/Z. Router(config)#access-list111 permit tcp 192.1.1.0 0.0.0.255 host 192.1.2.2 Router(config)#class-maptype inspect match-all trust-dmz-http Router(config-cmap)#matchaccess-group 111 Router(config-cmap)#matchprotocol http Router(config-cmap)#exit Router(config)#policy-maptype inspect trust-dmz Router(config-pmap)#classtype inspect trust-dmz-http Router(config-pmap-c)#inspect %Nospecific protocol configured in class trust-dmz-http for inspection. Allprotocols will be inspected Router(config-pmap-c)#exit Router(config)#access-list121 permit tcp 192.1.1.0 0.0.0.255 host 192.1.3.2 Router(config)#class-maptype inspect match-all trust-notrust Router(config-cmap)#matchaccess-group 121 Router(config-cmap)#matchprotocol http Router(config-cmap)#exit Router(config)#policy-maptype inspect trust-notrust Router(config-pmap)#classtype inspect trust-notrust Router(config-pmap-c)#inspect %Nospecific protocol configured in class trust-notrust for inspection. Allprotocols will be inspected Router(config-pmap-c)#exit Router(config-pmap)#exit Router(config)#access-list131 permit tcp 192.1.2.0 0.0.0.255 host192.1.3.2 Router(config)#class-maptype inspect match-all dmz-notrust Router(config-cmap)#matchaccess-group 131 Router(config-cmap)#matchprotocol http Router(config-cmap)#exit Router(config)#policy-maptype inspect dmz-notrust Router(config-pmap)#classtype inspect dmz-notrust Router(config-pmap-c)#inspect %Nospecific protocol configured in class dmz-notrust for inspection. All protocolswill be inspected Router(config-pmap-c)#exit Router(config-pmap)#exit Router(config)#access-list141 permit tcp 192.1.3.0 0.0.0.255 host192.1.2.2 Router(config)#class-maptype inspect match-all notrust-dmz Router(config-cmap)#matchaccess-group 141 Router(config-cmap)#matchprotocol http Router(config-cmap)#exit Router(config-pmap)#policy-maptype inspect notrust-dmz Router(config-pmap)#classtype inspect notrust-dmz Router(config-pmap-c)#inspect %Nospecific protocol configured in class notrust-dmz for inspection. All protocolswill be inspected Router(config-pmap-c)#exit Router(config-pmap)#exit Router(config)#zonesecurity trust Router(config-sec-zone)#exit Router(config)#zonesecurity notrust Router(config-sec-zone)#exit Router(config)#zonesecurity dmz Router(config-sec-zone)#exit Router(config)#interfacefa 0/0 Router(config-if)#zone-membersecurity trust Router(config-if)#exit Router(config)#interfacefa 0/1 Router(config-if)#zone-membersecurity notrust Router(config-if)#exit Router(config)#interfacefa 1/0 Router(config-if)#zone-membersecurity dmz Router(config-if)#exit Router(config)#zone-pairsecurity trust-dmz source trust destination dmz Router(config-sec-zone-pair)#service-policytype inspect trust-dmz Router(config-sec-zone-pair)#exit Router(config)#zone-pairsecurity trust-notrust source trust destination notrust Router(config-sec-zone-pair)#service-policytype inspect trust-notrust Router(config-sec-zone-pair)#exit Router(config)#zone-pairsecurity notrust-dmz source notrust destination dmz Router(config-sec-zone-pair)#service-policytype inspect notrust-dmz Router(config-sec-zone-pair)#exit Router(config)#zone-pairsecurity dmz-notrust source dmz destination notrust Router(config-sec-zone-pair)#service-policytype inspect dmz-notrust Router(config-sec-zone-pair)#exit Router(config)#

nginx的 limit_req_zone问题
http { .... limit_req_zone \$binary_remote_addr zone=one:10m rate=10r/s; ... } server { ... location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)\$ { ... expires 7d; } location / { limit_req zone=one ; root html; index index.html index.jsp; ... } } 这是配置文件，可是1秒发了第二个请求就显示503（总共发了好几个，不过非js.css.jpg等请求只有两个（是不同的请求）），我在limit_req zone=one 后面加上burst=1就可以了，我看了nginx的文档的意思，rate=10r/s;应该就是允许一秒10个，超过10个才跟burst有关，为什么rate=10r/s没起作用 更多 0
Cliff Climbing 的编程的问题
Problem Description At 17:00, special agent Jack starts to escape from the enemy camp. There is a cliff in between the camp and the nearest safety zone. Jack has to climb the almost vertical cliff by stepping his feet on the blocks that cover the cliff. The cliff has slippery blocks where Jack has to spend time to take each step. He also has to bypass some blocks that are too loose to support his weight. Your mission is to write a program that calculates the minimum time to complete climbing. Figure D-1 shows an example of cliff data that you will receive. The cliff is covered with square blocks. Jack starts cliff climbing from the ground under the cliff, by stepping his left or right foot on one of the blocks marked with 'S' at the bottom row. The numbers on the blocks are the "slippery levels". It takes t time units for him to safely put his foot on a block marked with t, where 1 ≤ t ≤ 9. He cannot put his feet on blocks marked with 'X'. He completes the climbing when he puts either of his feet on one of the blocks marked with 'T' at the top row. Figure D-1: Example of Cliff Data Jack's movement must meet the following constraints. After putting his left (or right) foot on a block, he can only move his right (or left, respectively) foot. His left foot position (lx, ly) and his right foot position (rx, ry) should satisfy lx < rx and | lx - rx | + | ly - ry | ≤ 3. This implies that, given a position of his left foot in Figure D-2 (a), he has to place his right foot on one of the nine blocks marked with blue color. Similarly, given a position of his right foot in Figure D-2 (b), he has to place his left foot on one of the nine blocks marked with blue color. Figure D-2: Possible Placements of Feet Input The input is a sequence of datasets. The end of the input is indicated by a line containing two zeros separated by a space. Each dataset is formatted as follows: w h s(1,1) ... s(1,w) s(2,1) ... s(2,w) ... s(h,1) ... s(h,w) The integers w and h are the width and the height of the matrix data of the cliff. You may assume 2 ≤ w ≤ 30 and 5 ≤ h ≤ 60. Each of the following h lines consists of w characters delimited by a space. The character s(y, x) represents the state of the block at position (x, y) as follows: * 'S': Jack can start cliff climbing from this block. * 'T': Jack finishes climbing when he reaches this block. * 'X': Jack cannot put his feet on this block. * '1' - '9' (= t): Jack has to spend t time units to put either of his feet on this block. 　 You can assume that it takes no time to put a foot on a block marked with 'S' or 'T'. Output For each dataset, print a line only having a decimal integer indicating the minimum time required for the cliff climbing, when Jack can complete it. Otherwise, print a line only having "-1" for the dataset. Each line should not have any characters other than these numbers. Sample Input 6 6 4 4 X X T T 4 7 8 2 X 7 3 X X X 1 8 1 2 X X X 6 1 1 2 4 4 7 S S 2 3 X X 2 10 T 1 1 X 1 X 1 X 1 1 1 X 1 X 1 1 1 X S S 2 10 T X 1 X 1 X 1 X 1 1 1 X 1 X 1 1 1 X S S 10 10 T T T T T T T T T T X 2 X X X X X 3 4 X 9 8 9 X X X 2 9 X 9 7 7 X 7 3 X X 8 9 X 8 9 9 9 6 3 X 5 X 5 8 9 9 9 6 X X 5 X 5 8 6 5 4 6 8 X 5 X 5 8 9 3 9 6 8 X 5 X 5 8 3 9 9 6 X X X 5 X S S S S S S S S S S 10 7 2 3 2 3 2 3 2 3 T T 1 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 4 3 2 3 2 3 2 3 2 3 5 3 2 3 1 3 2 3 2 3 5 2 2 3 2 4 2 3 2 3 5 S S 2 3 2 1 2 3 2 3 0 0 Sample Output 12 5 -1 22 12
Cliff Climbing 具体的代码
Problem Description At 17:00, special agent Jack starts to escape from the enemy camp. There is a cliff in between the camp and the nearest safety zone. Jack has to climb the almost vertical cliff by stepping his feet on the blocks that cover the cliff. The cliff has slippery blocks where Jack has to spend time to take each step. He also has to bypass some blocks that are too loose to support his weight. Your mission is to write a program that calculates the minimum time to complete climbing. Figure D-1 shows an example of cliff data that you will receive. The cliff is covered with square blocks. Jack starts cliff climbing from the ground under the cliff, by stepping his left or right foot on one of the blocks marked with 'S' at the bottom row. The numbers on the blocks are the "slippery levels". It takes t time units for him to safely put his foot on a block marked with t, where 1 ≤ t ≤ 9. He cannot put his feet on blocks marked with 'X'. He completes the climbing when he puts either of his feet on one of the blocks marked with 'T' at the top row. Figure D-1: Example of Cliff Data Jack's movement must meet the following constraints. After putting his left (or right) foot on a block, he can only move his right (or left, respectively) foot. His left foot position (lx, ly) and his right foot position (rx, ry) should satisfy lx < rx and | lx - rx | + | ly - ry | ≤ 3. This implies that, given a position of his left foot in Figure D-2 (a), he has to place his right foot on one of the nine blocks marked with blue color. Similarly, given a position of his right foot in Figure D-2 (b), he has to place his left foot on one of the nine blocks marked with blue color. Figure D-2: Possible Placements of Feet Input The input is a sequence of datasets. The end of the input is indicated by a line containing two zeros separated by a space. Each dataset is formatted as follows: w h s(1,1) ... s(1,w) s(2,1) ... s(2,w) ... s(h,1) ... s(h,w) The integers w and h are the width and the height of the matrix data of the cliff. You may assume 2 ≤ w ≤ 30 and 5 ≤ h ≤ 60. Each of the following h lines consists of w characters delimited by a space. The character s(y, x) represents the state of the block at position (x, y) as follows: * 'S': Jack can start cliff climbing from this block. * 'T': Jack finishes climbing when he reaches this block. * 'X': Jack cannot put his feet on this block. * '1' - '9' (= t): Jack has to spend t time units to put either of his feet on this block. 　 You can assume that it takes no time to put a foot on a block marked with 'S' or 'T'. Output For each dataset, print a line only having a decimal integer indicating the minimum time required for the cliff climbing, when Jack can complete it. Otherwise, print a line only having "-1" for the dataset. Each line should not have any characters other than these numbers. Sample Input 6 6 4 4 X X T T 4 7 8 2 X 7 3 X X X 1 8 1 2 X X X 6 1 1 2 4 4 7 S S 2 3 X X 2 10 T 1 1 X 1 X 1 X 1 1 1 X 1 X 1 1 1 X S S 2 10 T X 1 X 1 X 1 X 1 1 1 X 1 X 1 1 1 X S S 10 10 T T T T T T T T T T X 2 X X X X X 3 4 X 9 8 9 X X X 2 9 X 9 7 7 X 7 3 X X 8 9 X 8 9 9 9 6 3 X 5 X 5 8 9 9 9 6 X X 5 X 5 8 6 5 4 6 8 X 5 X 5 8 9 3 9 6 8 X 5 X 5 8 3 9 9 6 X X X 5 X S S S S S S S S S S 10 7 2 3 2 3 2 3 2 3 T T 1 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 4 3 2 3 2 3 2 3 2 3 5 3 2 3 1 3 2 3 2 3 5 2 2 3 2 4 2 3 2 3 5 S S 2 3 2 1 2 3 2 3 0 0 Sample Output 12 5 -1 22 12

Cliff Climbing 程序求助
Problem Description At 17:00, special agent Jack starts to escape from the enemy camp. There is a cliff in between the camp and the nearest safety zone. Jack has to climb the almost vertical cliff by stepping his feet on the blocks that cover the cliff. The cliff has slippery blocks where Jack has to spend time to take each step. He also has to bypass some blocks that are too loose to support his weight. Your mission is to write a program that calculates the minimum time to complete climbing. Figure D-1 shows an example of cliff data that you will receive. The cliff is covered with square blocks. Jack starts cliff climbing from the ground under the cliff, by stepping his left or right foot on one of the blocks marked with 'S' at the bottom row. The numbers on the blocks are the "slippery levels". It takes t time units for him to safely put his foot on a block marked with t, where 1 ≤ t ≤ 9. He cannot put his feet on blocks marked with 'X'. He completes the climbing when he puts either of his feet on one of the blocks marked with 'T' at the top row. Figure D-1: Example of Cliff Data Jack's movement must meet the following constraints. After putting his left (or right) foot on a block, he can only move his right (or left, respectively) foot. His left foot position (lx, ly) and his right foot position (rx, ry) should satisfy lx < rx and | lx - rx | + | ly - ry | ≤ 3. This implies that, given a position of his left foot in Figure D-2 (a), he has to place his right foot on one of the nine blocks marked with blue color. Similarly, given a position of his right foot in Figure D-2 (b), he has to place his left foot on one of the nine blocks marked with blue color. Figure D-2: Possible Placements of Feet Input The input is a sequence of datasets. The end of the input is indicated by a line containing two zeros separated by a space. Each dataset is formatted as follows: w h s(1,1) ... s(1,w) s(2,1) ... s(2,w) ... s(h,1) ... s(h,w) The integers w and h are the width and the height of the matrix data of the cliff. You may assume 2 ≤ w ≤ 30 and 5 ≤ h ≤ 60. Each of the following h lines consists of w characters delimited by a space. The character s(y, x) represents the state of the block at position (x, y) as follows: * 'S': Jack can start cliff climbing from this block. * 'T': Jack finishes climbing when he reaches this block. * 'X': Jack cannot put his feet on this block. * '1' - '9' (= t): Jack has to spend t time units to put either of his feet on this block. 　 You can assume that it takes no time to put a foot on a block marked with 'S' or 'T'. Output For each dataset, print a line only having a decimal integer indicating the minimum time required for the cliff climbing, when Jack can complete it. Otherwise, print a line only having "-1" for the dataset. Each line should not have any characters other than these numbers. Sample Input 6 6 4 4 X X T T 4 7 8 2 X 7 3 X X X 1 8 1 2 X X X 6 1 1 2 4 4 7 S S 2 3 X X 2 10 T 1 1 X 1 X 1 X 1 1 1 X 1 X 1 1 1 X S S 2 10 T X 1 X 1 X 1 X 1 1 1 X 1 X 1 1 1 X S S 10 10 T T T T T T T T T T X 2 X X X X X 3 4 X 9 8 9 X X X 2 9 X 9 7 7 X 7 3 X X 8 9 X 8 9 9 9 6 3 X 5 X 5 8 9 9 9 6 X X 5 X 5 8 6 5 4 6 8 X 5 X 5 8 9 3 9 6 8 X 5 X 5 8 3 9 9 6 X X X 5 X S S S S S S S S S S 10 7 2 3 2 3 2 3 2 3 T T 1 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 4 3 2 3 2 3 2 3 2 3 5 3 2 3 1 3 2 3 2 3 5 2 2 3 2 4 2 3 2 3 5 S S 2 3 2 1 2 3 2 3 0 0 Sample Output 12 5 -1 22 12
DNS服务器的日志信息请教。
Oct 8 09:36:17 WCentos named-sdb[7778]: managed-keys-zone ./IN: Unable to fetch DNSKEY set '.': timed out Oct 8 09:36:17 WCentos named-sdb[7778]: managed-keys-zone ./IN: Unable to fetch DNSKEY set 'dlv.isc.org': timed out 新搭建的DNS服务器 messages 出现以上日志，请问出现这个问题的原因，该如何解决，感谢。
Bus Pass 计算
Bus Pass 公交车的问题，C语言
feign 通过服务名调用报错404
Linux下配置DNS服务器，报错“has no address records (A or AAAA)”，怎么解决，求大师指导

Java学习的正确打开方式

Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）

HashMap 相关概念 HashTab、HashMap、TreeMap 均以键值对像是存储或操作数据元素。HashTab继承自Dictionary，HashMap、TreeMap继承自AbstractMap，三者均实现Map接口 **HashTab：**同步哈希表，不支持null键或值，因为同步导致性能影响，很少被使用 **HashMap：**应用较多的非同步哈希表，支持null键或值，是键值对...

linux系列之常用运维命令整理笔录

Python 基础（一）：入门必备知识

Python十大装B语法
Python 是一种代表简单思想的语言，其语法相对简单，很容易上手。不过，如果就此小视 Python 语法的精妙和深邃，那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点，并附上详细的实例代码。如能在实战中融会贯通、灵活使用，必将使代码更为精炼、高效，同时也会极大提升代码B格，使之看上去更老练，读起来更优雅。 1. for - else 什么？不是 if 和 else 才

2019年11月中国大陆编程语言排行榜
2019年11月2日，我统计了某招聘网站，获得有效程序员招聘数据9万条。针对招聘信息，提取编程语言关键字，并统计如下： 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7

JDK12 Collectors.teeing 你真的需要了解一下

“狗屁不通文章生成器”登顶GitHub热榜，分分钟写出万字形式主义大作

《程序人生》系列-这个程序员只用了20行代码就拿了冠军

11月8日，由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办，科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。 　　区块链技术被认为是继蒸汽机、电力、互联网之后，下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力，电力解决了人类基本的生活需求，互联网彻底改变了信息传递的方式，区块链作为构造信任的技术有重要的价值。 　　1...