摘要: 遇到一次该问题,问题出自docker没上一次没正常关闭,解决办法如下: sudo service docker restart 阅读全文
posted @ 2020-02-24 01:51 fishness 阅读(1908) 评论(0) 推荐(0)
摘要: 死锁:是指两个或两个以上的进程(或线程)在执行过程中,因争夺资源而造成的一种互相等待的现象,若无外力作用,它们都将无法推进下去。 产生死锁的必要条件: 1、互斥条件:所谓互斥就是进程在某一时间内独占资源。 2、请求与保持条件:一个进程因请求资源而阻塞时,对已获得的资源保持不放。 3、不剥夺条件:进程 阅读全文
posted @ 2020-02-14 01:00 fishness 阅读(983) 评论(0) 推荐(0)
摘要: java 中的线程分为两种:守护线程(Daemon)和用户线程(User)。 任何线程都可以设置为守护线程和用户线程,通过方法 Thread.setDaemon(boolon);true 则把该线程设置为守护线程,反之则为用户线程。Thread.setDaemon()必须在 Thread.start 阅读全文
posted @ 2020-02-14 00:59 fishness 阅读(932) 评论(0) 推荐(0)
摘要: 我使用浏览器缓存local storage做设计。 设计时候我们本应该第一步进入首页,但我们就进行一个设计转换,我们先进一个临时页面。 第一步:判断local storage是否有我们特定设计的缓存,叫launchFlag吧! 第二步:我们可以进行一个判断跳转,有我们就去首页,没有我们就去温情页。 阅读全文
posted @ 2020-01-17 01:54 fishness 阅读(142) 评论(0) 推荐(0)
摘要: 实现思想: 负载均衡算法:请求书%服务器数量得到实际服务器下标HttpClient进行调用 利用DiscoveryClient 1.注入@Autowired private DiscoveryClient discoveryClient 2.List<ServiceInstance> discove 阅读全文
posted @ 2020-01-15 18:03 fishness 阅读(316) 评论(0) 推荐(0)
摘要: 1.创建两个demo(我使用的是springboot)项目,分别整合了consul,端口分别2222,3333 2.yml配置(两个分别配置注册到consul) server: ##服务端口 port: 3333 spring: application: ##服务名称 name:consul clo 阅读全文
posted @ 2020-01-15 17:39 fishness 阅读(1252) 评论(0) 推荐(0)
摘要: 1.创建两个demo(我使用的是springboot)项目,分别整合了zookeeper,端口分别2222,3333 2.yml配置(两个分别配置注册到zookeeper) server: ##服务端口 port: 3333 spring: application: ##服务名称 name:zk c 阅读全文
posted @ 2020-01-15 17:36 fishness 阅读(614) 评论(0) 推荐(0)
摘要: 1.创建两个eureka注册中心项目作为demo,访问端口分别为7777,8888 2.yml配置将(配置端口互相互换即可) server: port: 7777 eureka: instance: hostname: 127.0.0.1 client: ###因为自己是注册中心,是否需要将自己注册 阅读全文
posted @ 2020-01-15 17:16 fishness 阅读(182) 评论(0) 推荐(0)
摘要: 1.加入依赖 <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </ 阅读全文
posted @ 2020-01-15 16:54 fishness 阅读(297) 评论(0) 推荐(0)
摘要: 1.https://www.consul.io下载consul,解压 2.cmd进入解压盘,输入命令 consul agent -dev -ui -node=cy 3.访问 http://127.0.0.1:8500 4.springcloud项目中加入整合依赖 <dependencies> <!- 阅读全文
posted @ 2020-01-15 16:41 fishness 阅读(407) 评论(0) 推荐(0)