SOFA入门
简介
scalable open financial architecture stack , 可扩展开放的金融架构栈;
github: https://github.com/sofastack/sofa-boot
快速构建金融级别云原生架构的中间件。
特点: 开放,金融级别,云原生;
微服务体系组件
云原生架构
传统的微服务管理运维变得越来越快,service mesh 和 serverless 可以解决相关问题。
快速开始
部署注册中心
分布式服务治理的核心组件。
检查是否安装成功:
# 查看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
安装步骤:
部署程序AB
关键步骤:
<!--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>
运行效果
sofa-boot , sofa-rpc的运行原理后面进行研究;
代码
修复了一个sql报错的问题;
还有引用失败报错的问题。