首页 文章 精选 留言 我的

精选列表

搜索[双足行走],共9107篇文章
优秀的个人博客,低调大师

又双叒叕来session共享

之前写过两篇springboot分布式中的session共享解决方案,参考《springboot中redis的使用和分布式session共享问题》和 《再谈session共享》 经过同事共同研究,原来springboot提供另外一种解决方案:0行代码解决方案 配置文件 spring.session.redis.namespace=自己定义的命名空间 spring.session.store-type=redis 是的,只需要这两行即可,不再需要其他配置或者代码实现,测试方法见上面两篇文章。 TIPS:1、使用redis解决session共享,那么就不能使用其他的session管理器,比如shiro自带的sessionManger,否则会导致以上配置失效 2、上面配置中没有提供超时配置,redis超时可以使用server.session.timeout=1800实现 附springboot提供另外的session管理机制 <pre class="programlisting" style="line-height: 1.4; color: black; font-size: 15px; padding: 6px 10px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); border-radius: 3px; clear: both; overflow: auto; font-family: Consolas, &quot;Liberation Mono&quot;, Courier, monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"># SPRING SESSION ([SessionProperties](https://github.com/spring-projects/spring-boot/tree/v1.5.9.RELEASE/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java)) spring.session.hazelcast.flush-mode=on-save # Sessions flush mode. spring.session.hazelcast.map-name=spring:session:sessions # Name of the map used to store sessions. spring.session.jdbc.initializer.enabled= # Create the required session tables on startup if necessary. Enabled automatically if the default table name is set or a custom schema is configured. spring.session.jdbc.schema=classpath:org/springframework/session/jdbc/schema-@@platform@@.sql # Path to the SQL file to use to initialize the database schema. spring.session.jdbc.table-name=SPRING_SESSION # Name of database table used to store sessions. spring.session.mongo.collection-name=sessions # Collection name used to store sessions. spring.session.redis.flush-mode=on-save # Sessions flush mode. spring.session.redis.namespace= # Namespace for keys used to store sessions. spring.session.store-type= # Session store type.</pre>

优秀的个人博客,低调大师

模拟WALMART网络架构-双栈冗余

SiteA and Site B 通信 SiteA: 192.168.1.X 192.168.3.X SiteB: 192.168.2.X 192.168.4.X =====MPLS Router Configuration===== R1 2 3 4 5 6 ====〉代表不同的MPLS 供应商 Step1:--MPLS域启用MPLS ip cef mpls ip mpls ldp router-id lo0 force mpls label protocol ldp int s0/0 mpls ip int s0/1 mpls ip Step2:---MPLS域 IGP通 router eigrp 80 no auto net 0.0.0.0 passive-interface f0/0 Step3:---MPLS域 PE接口启用VRF R1: ip vrf walmart rd 100:13 --->对方可以不一致,本地意义区分私网路由 route-target 100:79 -----〉对方必须一致 int f0/0 ip vrf forwarding walmart ip add R3: ip vrf walmart rd 100:31 route-target 100:79 int f0/0 ip vrf forwarding walmart ip add 验证show ip vrf detail [brief] R4:/R6: ip vrf walmart rd 200:46[200:64] route-target 200:81 int f0/0 ip vrf forwarding walmart ip add Step4:----MPLS域 MBGP R1: router bgp 100 bgp router-id 1.1.1.1 bgp log-neighbor-changes no bgp default ipv4-unicast \\起手配 neighbor 3.3.3.3 remote-as 100 neighbor 3.3.3.3 update-source Loopback0 ! ! address-family vpnv4------\\MP BGP neighbor 3.3.3.3 activate neighbor 3.3.3.3 send-community extended exit-address-family address-family ipv4 vrf walmart----- EBGP neighbor 17.1.1.7 remote-as 300 neighbor 17.1.1.7 activate exit-address-family R3: router bgp 100 bgp router-id 3.3.3.3 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor 1.1.1.1 remote-as 100 neighbor 1.1.1.1 update-source Loopback0 ! ! address-family vpnv4 neighbor 1.1.1.1 activate neighbor 1.1.1.1 send-community extended exit-address-family address-family ipv4 vrf walmart----- EBGP neighbor 39.1.1.9 remote-as 300 neighbor 39.1.1.9 activate exit-address-family 验证: sh ip bgp vpnv4 vrf walmart summary R3#sh ip bgp vpnv4 all summary ============================================= R4: router bgp 200 bgp router-id 4.4.4.4 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor 6.6.6.6 remote-as 200 neighbor 6.6.6.6 update-source Loopback0 ! ! address-family vpnv4 neighbor 6.6.6.6 activate neighbor 6.6.6.6 send-community extended address-family ipv4 vrf walmart neighbor 48.1.1.8 remote-as 300 neighbor 48.1.1.8 activate R6: router bgp 200 bgp router-id 6.6.6.6 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor 4.4.4.4 remote-as 200 neighbor 4.4.4.4 update-source Loopback0 ! ! address-family vpnv4 neighbor 4.4.4.4 activate neighbor 4.4.4.4 send-community extended address-family ipv4 vrf walmart neighbor 61.1.1.1 remote-as 400 neighbor 61.1.1.1 activate =============================================== Step5:-CE BGP 300 /400 R7-CE#sh run | b r b router bgp 300 bgp router-id 7.7.7.7 bgp log-neighbor-changes neighbor 17.1.1.1 remote-as 100 no network 7.7.7.7 mask 255.255.255.255 R9-CE#sh run | b r b router bgp 400 bgp router-id 9.9.9.9 bgp log-neighbor-changes neighbor 39.1.1.3 remote-as 100 no network 9.9.9.9 mask 255.255.255.255 R7-CE#traceroute 9.9.9.9 source 7.7.7.7 Type escape sequence to abort. Tracing the route to 9.9.9.9 VRF info: (vrf in name/id, vrf out name/id) 1 17.1.1.1 60 msec 32 msec 52 msec 2 12.1.1.2 [MPLS: Labels 19/18 Exp 0] 44 msec 40 msec 52 msec 3 39.1.1.3 [MPLS: Label 18 Exp 0] 48 msec 52 msec 52 msec 4 39.1.1.9 48 msec 48 msec 52 msec 察看标签 R1#sh ip bgp vpnv4 vrf walmart 9.9.9.9 BGP routing table entry for 100:13:9.9.9.9/32, version 3 Paths: (1 available, best #1, table walmart) Advertised to update-groups: 2 400, imported path from 100:31:9.9.9.9/32 3.3.3.3 (metric 2809856) from 3.3.3.3 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, internal, best Extended Community: RT:100:79 mpls labels in/out nolabel/18 R1#sh ip bgp vpnv4 vrf walmart 7.7.7.7 BGP routing table entry for 100:13:7.7.7.7/32, version 4 Paths: (1 available, best #1, table walmart) Advertised to update-groups: 1 300 17.1.1.7 from 17.1.1.7 (7.7.7.7) Origin IGP, metric 0, localpref 100, valid, external, best Extended Community: RT:100:79 mpls labels in/out 18/nolabel R1#show mpls forwarding-table Local Outgoing Prefix Bytes tag Outgoing Next Hop tag tag or VC or Tunnel Id switched interface 16 Pop tag 23.1.1.0/24 0 Se0/0 point2point 17 Pop tag 2.2.2.2/32 0 Se0/0 point2point 18 Untagged 7.7.7.7/32[V] 2796 Fa0/0 17.1.1.7 19 19 3.3.3.3/32 0 Se0/0 point2point =================================内网HSRP====================== R7-CE#sh run int f1/0.1 Building configuration... Current configuration : 206 bytes ! interface FastEthernet1/0.1 encapsulation dot1Q 1 native ip address 192.168.1.251 255.255.255.0 standby 1 ip 192.168.1.1 standby 1 priority 120 standby 1 preempt standby 1 track 1 decrement 30 end R7-CE#sh run int f1/0.3 Building configuration... Current configuration : 199 bytes ! interface FastEthernet1/0.3 encapsulation dot1Q 3 ip address 192.168.3.251 255.255.255.0 standby 3 ip 192.168.3.1 standby 3 priority 120 standby 3 preempt //开启抢占 standby 3 track 1 decrement 30 \\如果接口down了优先级减30 end R8-CE#sh run int f1/0.1 Building configuration... Current configuration : 182 bytes ! interface FastEthernet1/0.1 encapsulation dot1Q 1 native ip address 192.168.1.252 255.255.255.0 standby 1 ip 192.168.1.1 standby 1 preempt //standby 1 track 1 decrement 30 R8-CE#sh run int f1/0.3 Building configuration... Current configuration : 175 bytes ! interface FastEthernet1/0.3 encapsulation dot1Q 3 ip address 192.168.3.253 255.255.255.0 standby 3 ip 192.168.3.1 standby 3 preempt //standby 3 track 1 decrement 30 end =================CE IBGP============================= R7-CE#sh run | b r r router rip version 2 network 7.0.0.0 network 78.0.0.0 no auto-summary ! router bgp 300 bgp router-id 7.7.7.7 bgp log-neighbor-changes network 192.168.1.0 network 192.168.3.0 neighbor 8.8.8.8 remote-as 300 neighbor 8.8.8.8 update-source Loopback0 neighbor 8.8.8.8 next-hop-self neighbor 17.1.1.1 remote-as 100 R8-CE#sh run | b r r router rip version 2 network 8.0.0.0 network 78.0.0.0 no auto-summary ! router bgp 300 bgp router-id 8.8.8.8 bgp log-neighbor-changes neighbor 7.7.7.7 remote-as 300 neighbor 7.7.7.7 update-source Loopback0 neighbor 7.7.7.7 next-hop-self neighbor 48.1.1.4 remote-as 200 R7-CE#sh ip bgp BGP table version is 5, local router ID is 7.7.7.7 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path * i 192.168.1.0 8.8.8.8 0 100 0 i *> 0.0.0.0 0 32768 i *> 192.168.2.0 17.1.1.1 0 100 400 i * i 8.8.8.8 0 100 0 200 400 i * i 192.168.3.0 8.8.8.8 0 100 0 i *> 0.0.0.0 0 32768 i *> 192.168.4.0 17.1.1.1 0 100 400 i * i 8.8.8.8 0 100 0 200 400 i 但R7-R8不希望学习到内部路由192.168.1.0 192.168.3.0,我们可以过滤掉 IBGP 过滤内网路由 R7-CE#sh run | be ip prefix-list ip prefix-list deny seq 5 permit 192.168.1.0/24 ip prefix-list deny seq 10 permit 192.168.3.0/24 R7-CE#sh run | be route-map route-map block deny 10 match ip address prefix-list deny ! route-map block permit 20 R7: router bgp 300 neighbor 8.8.8.8 route-map block in R8: router bgp 300 neighbor 7.7.7.7 route-map block in R7-CE#sh ip bgp BGP table version is 5, local router ID is 7.7.7.7 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path *> 192.168.1.0 0.0.0.0 0 32768 i * i 192.168.2.0 8.8.8.8 0 100 0 200 400 i *> 17.1.1.1 0 100 400 i *> 192.168.3.0 0.0.0.0 0 32768 i * i 192.168.4.0 8.8.8.8 0 100 0 200 400 i *> 17.1.1.1 0 100 400 i ======BUYTRIP场地 & internet========= R15: R15#sh run | b r e router eigrp 80 network 15.0.0.0 network 57.0.0.0 no auto-summary R7: ip route 0.0.0.0 0.0.0.0 61.1.1.6 R7-CE#sh run | b r b router bgp 300 redistribute eigrp 80 metric 400 network 0.0.0.0 mask 0.0.0.0 R7-CE#sh run | b r e router eigrp 80 network 57.0.0.0 redistribute bgp 300 metric 1000 100 255 1 1500 redistribute static R8: router bgp 300 bgp router-id 8.8.8.8 bgp log-neighbor-changes network 192.168.1.0 network 192.168.3.0 redistribute static metric 300 neighbor 7.7.7.7 remote-as 300 neighbor 7.7.7.7 update-source Loopback0 neighbor 7.7.7.7 next-hop-self neighbor 7.7.7.7 route-map block in neighbor 48.1.1.4 remote-as 200 EIGRP本地优化: access-list 10 permit 0.0.0.0 0.0.0.0 router ei 80 distribute-list 10 in fastEthernet 1/0 本文转自 bilinyee博客,原文链接: http://blog.51cto.com/ericfu/1963262 如需转载请自行联系原作者

优秀的个人博客,低调大师

阿里云双11访谈之CDN

以下内容根据访谈视频整理而成 阿里云CDN简介 阿里云从零八年开始自建CDN并服务于整个阿里巴巴集团,从12年开始服务于双十一,目前阿里云是中国最大的公有云CDN的厂商,也是全国第一批取得专业CDN全国范围服务运营商执照的一个团队。CDN是非常普适性的云计算服务产品,主要解决网络带宽小,用户分布范围广,访问稳定性和服务体验。传统解决方案通常需要花很大的成本来自建优质的多线机房和软硬件基础设施建设。软件硬件设施建设。在这种情况下,接入CND是简单有效的方式。接入CDN能大量的简化网站系统运维的工作量,解决多个地区、多个运营商互联互通的问题,得到用户体验的提升。阿里云CDN从2008年开始自建节点到现在已经打磨了将近十年。基础建设遍布全球200多个节点,有80T左右的带宽储备、技术储备也积累了非常丰富的经验。 接下来分享一下阿里云CDN的基

优秀的个人博客,低调大师

说到作到,HADOOP双节点配置成功

参考文档: http://jenming.wordpress.com/2012/10/08/running-hadoop-on-centos-6-multi-node-cluster/ 还是外国友人写的靠谱。 无密码SSH验证,这个百试百灵,而其它国内写的,都要靠运气呀。不过,这块知识我确实有点弱。。 这次测试的是一个NAMENODE,两个DATANODE, 用ESX虚拟机完成测试。 相关50070的截图和HDFS的输出REPORT。 下一步,得正经找点JAVA和HADOOP应用的书来攻一下罗 ~~~ 清明假期,完美结束!!! 收到。睡个早觉。。

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册