• SOFA入门


    image.png

    简介

    scalable open financial architecture stack , 可扩展开放的金融架构栈;

    github: https://github.com/sofastack/sofa-boot

    快速构建金融级别云原生架构的中间件。

    特点: 开放,金融级别,云原生;

    file

    微服务体系组件

    file

    image.png

    云原生架构

    传统的微服务管理运维变得越来越快,service mesh 和 serverless 可以解决相关问题。

    file

    image.png

    快速开始

    image.png

    部署注册中心

    分布式服务治理的核心组件。

    file

    检查是否安装成功:

    # 查看meta角色的健康检测接口:
    $ curl http://localhost:9615/health/check
    {"success":true,"message":"... raftStatus:Leader"}
    
    # 查看data角色的健康检测接口:
    $ curl http://localhost:9622/health/check
    {"success":true,"message":"... status:WORKING"}
    
    # 查看session角色的健康检测接口:
    $ curl http://localhost:9603/health/check
    {"success":true,"message":"..."}
    

    部署链路跟踪

    The Docker Zipkin project is able to build docker images, provide scripts and a docker-compose.yml for launching pre-built images. The quickest start is to run the latest image directly:

    docker run -d -p 9411:9411 openzipkin/zipkin
    

    部署监控

    依赖ES服务或者grafana ;

    本地安装es服务:

    docker run -d --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:5.6
    

    检查es服务:

    http://localhost:9200/_cat/health?v

    安装步骤:

    file

    部署程序AB

    https://www.sofastack.tech/guides/sofastack-quick-start/#5-%E5%8F%91%E5%B8%83-sofarpc-%E6%9C%8D%E5%8A%A1

    关键步骤:

    file

    <!--SOFARPC 依赖-->
    <dependency>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>rpc-sofa-boot-starter</artifactId>
    </dependency>
    <!--SOFATracer 依赖-->
    <dependency>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>tracer-sofa-boot-starter</artifactId>
    </dependency>
    <!--SOFARegistry 依赖-->
    <dependency>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>registry-client-all</artifactId>
    </dependency>
    <!--runtime 依赖-->
    <dependency>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>runtime-sofa-boot-starter</artifactId>
    </dependency>
    <!--SOFALookout 依赖-->
    <dependency>
        <groupId>com.alipay.sofa.lookout</groupId>
        <artifactId>lookout-sofa-boot-starter</artifactId>
    </dependency>
    

    运行效果

    image.png

    sofa-boot , sofa-rpc的运行原理后面进行研究;

    代码

    修复了一个sql报错的问题;

    还有引用失败报错的问题。

    实例代码点我获取!

    原创不易,关注诚可贵,转发价更高!转载请注明出处,让我们互通有无,共同进步,欢迎沟通交流。
    我会持续分享Java软件编程知识和程序员发展职业之路,欢迎关注,我整理了这些年编程学习的各种资源,关注公众号‘李福春持续输出’,发送'学习资料'分享给你!

  • 相关阅读:
    :Netty中的Idle事件
    :Netty中的Idle事件
    大数据分析在石化企业的应用探讨
    全关联优化
    Java中的instanceof关键字
    Java中的instanceof关键字
    第七章 正则模式
    Rac sequence
    监控ping
    第六章 HASH
  • 原文地址:https://www.cnblogs.com/snidget/p/12969350.html
Copyright © 2020-2023  润新知