GithubHelp home page GithubHelp logo

microservice's Introduction

drop database if exists DB03;
create database DB03 character set UTF8;
use DB03;
CREATE TABLE dept (
	dept_no INT auto_increment NOT NULL,
	dept_name varchar(100) NOT NULL,
	db_source varchar(100) NOT null,
	primary key(dept_no)
);
INSERT INTO dept(dept_name, db_source)  VALUES('计划部', DATABASE());
INSERT INTO dept(dept_name, db_source)  VALUES('生产部', DATABASE());
INSERT INTO dept(dept_name, db_source)  VALUES('研发部', DATABASE());



1、eureka的注册与发现
2、eureka集群 @@EnableEurekaClient  @@EnableEurekaServer
3、ribbon负载均衡  @LoadBalance @@EnableEurekaClient
    自定义ribbon @RibbonClient(name = "MICROSERVICECLOUD-DEPT", configuration = MySelfRule.class)
                @Configuration @Bean IRule
4、feign负载均衡:接口+注解,面向接口编程
    @FeignClient(value = "MICROSERVICECLOUD-DEPT")
    @EnableFeignClients(basePackages = "com.betty") //feign默认使用轮询算法
5、Hystrix 断路器
  5.1、服务熔断-- 服务端返回
       @EnableCircuitBreaker //hystrix
       @HystrixCommand(fallbackMethod = "processHystrix_Get")
       @FeignClient(value = "MICROSERVICECLOUD-DEPT")
  5.2、服务降级--客户端,与服务端无关
       与feign (接口+注解的负载均衡)配合使用
       @FeignClient(value = "MICROSERVICECLOUD-DEPT", fallbackFactory = DeptClientFallBackFactory.class)  //服务降级
  5.3、HystrixDashboard 服务监控 (豪猪)

        HystrixDashboard页面: http://localhost:9001/hystrix
                    监控对象: http://localhost:8001/hystrix.stream
                    查看:7色、1圈、1线
6、zuul 网关
    @EnableZuulProxy
    不用代理 http://localhost:8001/dept/get/3
    使用代理 http://myZuul.com:9527/microservicecloud-dept/dept/get/3
7、spring cloud config配置管理

microservice's People

Contributors

b-betty avatar

Watchers

James Cloos avatar  avatar

Forkers

zman-hz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.