在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Mikaelemmmm/go-zero-looklook开源软件地址:https://github.com/Mikaelemmmm/go-zero-looklook开源编程语言:Go 98.6%开源软件介绍:go-zero-looklookEnglish | 简体中文 SummaryThe old rule is to give a star before you see it. Ha ~ ~, if the star is caught, you have to spank, ha haI may have contacted go zero earlier. I have been using go zero since about 1000star. Later, I became familiar with the go zero author through wechat. The go zero author was very enthusiastic and patient to help me answer many questions. I also want to actively help go zero promote the community, Basically, I answered the relevant questions in the community group, because in this process, I found that many people felt that go zero did not have a complete project example. As a member of the community who wanted to promote the community, I made an available version open source. The main technology stack includes the following:
Tutorial videoThis is the go zero tutorial I'm recording :https://www.bilibili.com/medialist/play/389552232?from=space&business=space_series&business_id=2122723&desc=1 At the end of this tutorial, we will also share go-zero -looklook. Please look forward to it~ Dochttps://github.com/Mikaelemmmm/go-zero-looklook/tree/main/doc/english Under the doc directory of the project Docker compose is recommended in the development environment of the project. The direct chain method is used to give up the trouble caused by service registration and discovery middleware (etcd, nacos, consul ...) For testing and online deployment, k8s (etcd, Nacos, consumer, etc.) has detailed tutorials (build + deploy), which can be communicated in the go zero community group, which is very easy Project SummaryThe whole project uses the micro services developed by go zero, which basically includes go zero and some middleware developed by relevant go zero authors. The technology stack used is basically the self-developed component of the go zero project team, which is basically the go zero software The project directory structure is as follows:
System architecture diagramBusiness architecture diagramGatewaynginx do external gateway, gateway in front of the slb, in addition, many students feel that nginx do not do gateway is not very good, this piece of principle is basically the same, you can replace it with apisix, kong, etc. Development modeThis project uses microservice development, API (HTTP) + RPC (grpc). The API acts as an aggregation service, and the complex and related business calls are uniformly written in RPC. If some simple businesses will not be relied on by other services, they can be directly written in the logic of API LogFor logs, filebeat is used to collect them and report them to Kafka. Because logstash knows everything and the resource occupation is too exaggerated, go stash is used instead of logstash Link: https://github.com/kevwan/go-stash , go stash is developed by the go zero development team. It has high performance and does not occupy resources. There is not much main code. It can be used only by configuration. It is very simple. The Kafka data source is synchronized to elasticsearch. The elasticsearch account and password are not supported by default. I fork a copy and modify it. It simply supports the account and password MonitorPrometheus is used for monitoring. This go zero native support only requires configuration. Here you can see the configuration in the project Link trackingGo zero supports Jaeger and Zipkin by default. You only need to configure it. You can see the configuration Pub\Subkafka ,Publish subscription using go-zero development team developed by go-queue, link: https://github.com/zeromicro/go-queue Here we use kq, kq is based on kafka to do high-performance publish subscriptions Message queues, delayed queues, timed tasksMessage queues, delay queues, timed tasks This project uses asynq, a simple middleware developed based on redis. Of course, the message queue you can also use go-queue Link: https://github.com/hibiken/asynq Distributed transactionDTM is used for distributed transactions. Well, it's very comfortable. I wrote a "go zero nanny tutorial on connecting distributed transactions with DTM" link address: https://github.com/Mikaelemmmm/gozerodtm , this project has not been used yet. It's good to prepare for direct integration in the future. If readers use it, they can directly look at the source code Dtm Link : https://github.com/dtm-labs/dtm DeployDocker compose is recommended in the development environment of the project. The direct chain method is used to give up the trouble caused by service registration and discovery middleware (etcd, Nacos, consul, ...) For testing and online deployment, k8s (etcd, Nacos, consumer, etc.) has detailed tutorials (build + deploy), which can be communicated in the go zero community group, which is very easy project doc :https://github.com/Mikaelemmmm/go-zero-looklook/tree/main/doc gitlab + jenkins + harbor + k8s Click in jenkins to deploy the corresponding service, will go to gitlab to pull the code --> then go to pull the online configuration (online configuration of a separate git repository, why not use the configuration center, the deployment documentation has an introduction) ----> automatically build the image --> push to harbor mirror repository --> use kubectl to automatically publish to k8s ----> in front to hang a nignx do gateway unified portal Thanksgo-zero : https://github.com/zeromicro/go-zero dtm:https://github.com/dtm-labs/dtm |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论