├── .github └── workflows │ ├── gitee-sync.yml │ └── update-git-book.yml ├── Contributing.md ├── LICENSE.md ├── README.md ├── SUMMARY.md ├── _config.yml ├── assets ├── 50MB.png ├── 50mb.png ├── 687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f322e706e67.png ├── 687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f636c69656e742e706e67.png ├── 687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f7365727665722e706e67.png ├── CLA1.png ├── CLA2.png ├── CLA3.png ├── build_with_parameters.png ├── build_with_parameters_en.png ├── cla1.png ├── cla2.png ├── cla3.png ├── client_en.png ├── encoding_error.png ├── eureka-tars-java.png ├── java_server_deploy.png ├── java_server_deploy_en.png ├── mysql_sqlmode.png ├── mysql_sqlmode_en.png ├── ping-mu-kuai-zhao-20191004-shang-wu-10.24.42.png ├── platform_en.png ├── pptseer.en.png ├── registry_not_founded.png ├── registry_not_founded_en.png ├── registry_not_invoker.png ├── registry_not_invoker_en.png ├── registry_web_empty.png ├── registry_web_empty_en.png ├── registry_web_endpoint.png ├── registry_web_endpoint_en.png ├── resin.png ├── server_en.png ├── stage_view.png ├── stage_view_en.png ├── stat.png ├── stat_en.png ├── tars-en.png ├── tars-java-jar.png ├── tars.png ├── tars_auth_client.png ├── tars_auth_client_en.png ├── tars_auth_endpoint.png ├── tars_auth_endpoint_en.png ├── tars_auth_server.png ├── tars_auth_server_en.png ├── tars_config_app1.png ├── tars_config_app1_en.png ├── tars_config_app2.png ├── tars_config_app2_en.png ├── tars_config_appconfig.png ├── tars_config_appconfig_en.png ├── tars_config_appconfig_result.png ├── tars_config_appconfig_result_en.png ├── tars_config_jiegoutu.png ├── tars_config_jiegoutu_en.png ├── tars_config_references.png ├── tars_config_references_en.png ├── tars_config_server1.png ├── tars_config_server1_en.png ├── tars_config_server2.png ├── tars_config_server2_en.png ├── tars_config_server3_ref1.png ├── tars_config_server3_ref1_en.png ├── tars_config_server3_ref2.png ├── tars_config_server3_ref2_en.png ├── tars_config_set1.png ├── tars_config_set1_en.png ├── tars_config_set2.png ├── tars_config_set2_en.png ├── tars_config_table1.png ├── tars_config_table2.png ├── tars_cpp_quickstart_bushu1_en.png ├── tars_cpp_quickstart_bushu2_en.png ├── tars_cpp_quickstart_patch_en.png ├── tars_cpp_quickstart_patchresult_en.png ├── tars_cpp_quickstart_upload_en.png ├── tars_cpp_third_protocol.png ├── tars_cpp_third_protocol_en.png ├── tars_dye.png ├── tars_dye_en.png ├── tars_flow.png ├── tars_flow_en.png ├── tars_framework_git_flows.jpg ├── tars_go_quickstart_bushu1.png ├── tars_go_quickstart_bushu1_en.png ├── tars_go_quickstart_release.png ├── tars_go_quickstart_release_en.png ├── tars_go_quickstart_service_inactive.png ├── tars_go_quickstart_service_inactive_en.png ├── tars_go_quickstart_service_ok.png ├── tars_go_quickstart_service_ok_en.png ├── tars_idc.png ├── tars_idc_en.png ├── tars_idc_pic.png ├── tars_idc_pic_en.png ├── tars_java_quickstart_bushu1.png ├── tars_java_quickstart_bushu2.png ├── tars_java_quickstart_patch.png ├── tars_java_quickstart_patchresult.png ├── tars_java_quickstart_upload.png ├── tars_jiaohu (1).png ├── tars_jiaohu.png ├── tars_junheng.png ├── tars_junheng_en.png ├── tars_not_resolve.png ├── tars_notify (1).png ├── tars_notify.png ├── tars_overload.png ├── tars_overload_en.png ├── tars_performance.png ├── tars_performance_en.png ├── tars_property.png ├── tars_property_en.png ├── tars_push_deploy.png ├── tars_push_deploy_en.png ├── tars_result.png ├── tars_rongcuo.png ├── tars_rongcuo_en.png ├── tars_server_client (1).png ├── tars_server_client.png ├── tars_set.png ├── tars_set_en.png ├── tars_set_pic1.png ├── tars_set_pic1_en.png ├── tars_set_pic2.png ├── tars_set_pic2_en.png ├── tars_set_pic3.png ├── tars_ssl_endpoint.png ├── tars_stat (1).png ├── tars_stat.png ├── tars_stat_en.png ├── tars_tarslog_bushu.png ├── tars_tarslog_bushu_en.png ├── tars_tarslog_patch.png ├── tars_tarslog_patch_en.png ├── tars_tarsnotify_bushu.png ├── tars_tarsnotify_bushu_en.png ├── tars_tarsnotify_patch.png ├── tars_tarsnotify_patch_en.png ├── tars_tarsproperty_bushu (1).png ├── tars_tarsproperty_bushu.png ├── tars_tarsproperty_bushu_en.png ├── tars_tarsproperty_patch (1).png ├── tars_tarsproperty_patch.png ├── tars_tarsproperty_patch_en.png ├── tars_tarsproto (1).png ├── tars_tarsproto.png ├── tars_tarsqueryproperty_bushu.png ├── tars_tarsqueryproperty_bushu_en.png ├── tars_tarsqueryproperty_patch.png ├── tars_tarsqueryproperty_patch_en.png ├── tars_tarsquerystat_bushu.png ├── tars_tarsquerystat_bushu_en.png ├── tars_tarsquerystat_patch.png ├── tars_tarsquerystat_patch_en.png ├── tars_tarsstat_bushu.png ├── tars_tarsstat_bushu_en.png ├── tars_tarsstat_patch.png ├── tars_tarsstat_patch_en.png ├── tars_template_table1.png ├── tars_top_en.png ├── tars_tuopu.png ├── tars_tupclass.png ├── tars_tupstruct.png ├── tars_tupstruct_en.png ├── tars_web.png ├── tars_web_en.png ├── tars_web_index-1.png ├── tars_web_index.png ├── tars_web_index1_en.png ├── tars_web_index_en.png ├── tars_web_system (1).png ├── tars_web_system.png ├── tars_web_system_en.png ├── tars_web_system_index.png ├── tars_web_system_index_en.png ├── tarsjs_architecture.png ├── tb-platform.png ├── tb_disordered.png ├── tb_http_result.png ├── tb_ordered.png ├── tb_tars_result.png ├── trace_1_en.png ├── trace_2_en.png ├── trace_3_en.png ├── trace_4_en.png └── trace_5_en.png ├── base ├── tars-concept.md ├── tars-intro.md ├── tars-protocol.md └── tars-tup.md ├── benchmark ├── README.md ├── build.md ├── develop.md ├── http-guide.md └── tars-guide.md ├── cla.md ├── cooperation └── tars_framework_git_flows.md ├── demo ├── tarscpp │ ├── README.md │ ├── tars_co.md │ ├── tars_cpp_future_promise.md │ ├── tars_cpp_http_demo.md │ ├── tars_cpp_quickstart.md │ └── tars_push.md ├── tarsgo.md ├── tarsjava.md └── tarsphp │ ├── README.md │ ├── da-jian-httpserver.md │ ├── da-jian-tcpserver.md │ ├── da-jian-timerserver.md │ ├── da-jian-websocketserver.md │ └── tan-mu-huo-dong-shi-zhan.md ├── dev ├── tars-auth.md ├── tars-call-chain.md ├── tars-config.md ├── tars-idc-set.md ├── tars-monitor.md ├── tars-protobuf.md ├── tars-resource.md ├── tars-template.md ├── tars-web-api.md ├── tars-web-user.md ├── tars.js │ ├── README.md │ ├── nodetools-cli.md │ ├── tars-config.md │ ├── tars-dyeing.md │ ├── tars-logs.md │ ├── tars-monitor.md │ ├── tars-node-agent.md │ ├── tars-notify.md │ ├── tars-rpc.md │ ├── tars-stream.md │ ├── tars-utils.md │ ├── tars-winston-tars.md │ └── tars2node.md ├── tarscpp │ ├── README.md │ ├── tars-2.0-update.md │ ├── tars-cookie.md │ ├── tars-guide.md │ ├── tars-http.md │ ├── tars-http1.md │ ├── tars-http2.md │ ├── tars-performance.md │ ├── tars-promise.md │ ├── tars-protobuf.md │ ├── tars-push.md │ ├── tars-server-thread.md │ ├── tars-spec.md │ ├── tars-thirdparty-protocol.md │ ├── tars-tls.md │ └── tars_cpp_quickstart.md ├── tarsgo │ ├── README.md │ ├── pb2tarsgo.md │ ├── performance.md │ └── spec.md ├── tarsjava │ ├── README.md │ ├── images │ │ ├── Logback-config.png │ │ ├── docker-hello-world.png │ │ ├── eureka-tars-java.png │ │ ├── tars-deployment-client.png │ │ ├── tars-deployment-http.png │ │ ├── tars-deployment.png │ │ ├── tars-en.png │ │ ├── tars-http-call.png │ │ ├── tars-pubjar-client.png │ │ ├── tars-pubjar.png │ │ ├── tars-publication.png │ │ ├── tars-state-client.png │ │ ├── tars-state.png │ │ ├── tars-tarstest-client.png │ │ ├── tars-tarstest.png │ │ ├── tars-test-client.png │ │ ├── tars-test.png │ │ ├── tars-testclient.png │ │ ├── tars-testserver.png │ │ ├── tars-uploadjar.png │ │ ├── tars-uploadjarclient.png │ │ ├── tars-uploadtars-client.png │ │ ├── tars-uploadtars.png │ │ └── tarsjavastart-info.png │ ├── shi-yong-zhi-nan.md │ ├── stress-testing.md │ ├── tars-http-server.md │ ├── tars-java-start.md │ ├── tars-quick-start.md │ ├── tars-reference.md │ ├── tars-tutorials.md │ ├── tarsspring-shi-yong-shuo-ming.md │ ├── tarsspringboot-shi-yong-shuo-ming.md │ └── tarsspringcloud-shi-yong-shuo-ming.md └── tarsphp │ ├── .DS_Store │ ├── Advanced │ ├── ci.md │ ├── laravel.md │ ├── swoft.md │ ├── swoole-suport-tars.md │ ├── thinkphp.md │ └── yii2.md │ ├── Environment │ ├── docker.md │ ├── php.md │ └── platform.md │ ├── Framework │ ├── introduce.md │ ├── tars-client.md │ ├── tars-config.md │ ├── tars-deploy.md │ ├── tars-extension.md │ ├── tars-log.md │ ├── tars-monitor.md │ ├── tars-registry.md │ ├── tars-report.md │ ├── tars-server.md │ ├── tars-utils.md │ └── tars2php.md │ ├── Question │ ├── changelog.md │ ├── debug.md │ ├── index.md │ └── outsource.md │ ├── QuickStart │ ├── introduce.md │ ├── tars-act-demo.md │ ├── tars-http-server.md │ ├── tars-tcp-server.md │ ├── tars-timer-server.md │ └── tars-websocket-server.md │ ├── README.md │ └── backup │ ├── README.md │ ├── chi-xu-ji-cheng-fang-an.md │ ├── shi-yong-shi-jian.md │ ├── swoole-kuang-jia-ru-he-jie-ru-tars.md │ ├── tars-client.md │ ├── tars-config.md │ ├── tars-extension.md │ ├── tars-log.md │ ├── tars-monitor.md │ ├── tars-ping-tai-zhen-dui-php-xiu-gai-shuo-ming.md │ ├── tars-registry.md │ ├── tars-report.md │ ├── tars-server.md │ ├── tars-utils.md │ ├── tars2php-zi-dong-sheng-cheng-php-lei-gong-ju-shi-yong-shuo-ming.md │ ├── tars2php.md │ ├── yu-laravel-jie-he-shi-yong.md │ ├── yu-swoft-jie-he-shi-yong.md │ ├── yu-thinkphp-jie-he-shi-yong.md │ └── yu-yii2-jie-he-shi-yong.md ├── env ├── README.md ├── tars.js.md ├── tarscpp.md ├── tarsgo.md ├── tarsjava.md └── tarsphp.md ├── hello-world ├── README.md ├── tars.js.md ├── tarscpp.md ├── tarsgo.md ├── tarsjava.md └── tarsphp.md ├── installation ├── README.md ├── docker-install.md ├── docker.md ├── expand.md ├── k8s-docker-1.md ├── k8s-docker-2.md ├── mysql.md ├── node.md ├── source-windows.md ├── source.md └── web.md └── question ├── Install_faq-en.md ├── tarsbenchmark-question.md ├── tarscpp-question.md ├── tarsjava-question.md ├── tarsnodejs-question.md └── tarsphp-question.md /.github/workflows/gitee-sync.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - master 5 | tags: 6 | - "*" 7 | 8 | name: Sync to Gitee 9 | jobs: 10 | run: 11 | name: Run 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout source code 15 | uses: actions/checkout@v1 16 | - name: Mirror Github to Gitee 17 | uses: Yikun/hub-mirror-action@v1.2 18 | with: 19 | src: github/TarsCloud 20 | dst: gitee/TarsCloud 21 | dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} 22 | dst_token: ${{ secrets.GITEE_TOKEN }} 23 | account_type: org 24 | timeout: 600 25 | debug: true 26 | force_update: true 27 | static_list: "TarsDocs_en" -------------------------------------------------------------------------------- /.github/workflows/update-git-book.yml: -------------------------------------------------------------------------------- 1 | name: update-git-book 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | jobs: 8 | build: 9 | runs-on: ubuntu-20.04 10 | steps: 11 | - name: trigger 12 | run: | 13 | curl -X POST https://api.github.com/repos/TarsCloud/GitBook/dispatches -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.MY_REPO_TOKEN }}" --data '{"event_type": "docs_auto"}' 14 | -------------------------------------------------------------------------------- /Contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | If you contributed but cannot find your ID here, please submit PR and add your GitHub ID to both [Tars repo](https://github.com/TarsCloud/Tars/pulls) and [here](https://github.com/TarsCloud/TarsDocs_en/pulls). 4 | 5 | ## TarsDocs_en 6 | 7 | - KatharineOzil 8 | - ruanshudong 9 | - yukkiball 10 | - jerrylucky 11 | - bartdong 12 | - franklee0817 13 | - meijing0114 14 | - forrestlinfeng 15 | - zouchengzhuo 16 | - qiuxin 17 | - danielzheng-Tencent 18 | - TimmyYu 19 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, THE TARS FOUNDATION 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [点我查看中文版](https://tarscloud.github.io/TarsDocs/) 2 | 3 | # Tars 4 | 5 | - Twitter: [@TarsCloud](https://twitter.com/TarsCloud) 6 | - [Mailing List](https://groups.google.com/g/tars-foundation-information) 7 | - [Official Website](http://tarscloud.org/) 8 | - [News](https://tarscloud.org/feed/newsroom) 9 | - qq group code-1: 579079160 10 | - qq group code-2: 669339903 11 | - WeChat: TarsCloud 12 | - [For more information, please contact TarsCloud](https://tarscloud.org/about/contacts) 13 | 14 | ## What is Tars? 15 | 16 | Tars comes from the robot in Interstellar movie. Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule. 17 | 18 | Tars, aka TAF(Total Application Framework), has been used in Tencent since 2008. It supports C++,Java,Nodejs and php for now. This framework offers a set of solution for development, maintenance and testing, which making develop, deploy and testing service efficiently. 19 | It integrated extensible protocol for encoding/decoding, high-performance RPC communication framework, name service, monitor, statistics and configuration. You can use it to develop your reliable distributed application based on microservice fast, and reach fully efficient service management. 20 | 21 | Nowadays it's used by hundreds of bussiness in Tencent, services that developed base on TAF run on 16 thousands of machines. 22 | 23 | See the detailed introduction [SUMMARY.md](SUMMARY.md). 24 | 25 | ## Supported platforms 26 | For now it supports OS as below: 27 | 28 | - Linux 29 | - Windows 30 | - Mac 31 | 32 | ## Supported languages 33 | 34 | For now it supports following languages: 35 | 36 | - C++ 37 | - Java 38 | - Nodejs 39 | - PHP 40 | - Go 41 | 42 | 47 | 48 | ## Submodule 49 | 50 | Directory |Features 51 | ------------------|---------------- 52 | framework |Source code implementation of C++ language framework basic service 53 | cpp |C++ language framework rpc source code implementation 54 | java |java language framework rpc source code implementation 55 | go |go language framework rpc source code implementation 56 | nodejs |nodejs language framework rpc source code implementation 57 | php |php language framework rpc source code implementation 58 | tup |source code implementation of tup group protocol in each language 59 | web |manage tars web source implementation 60 | docker |build tars docker script 61 | 62 | ## License 63 | 64 | The open-source protocol Tars used is BSD-3-Clause, see [LICENSE.md](https://github.com/TarsCloud/TarsDocs_en/blob/master/LICENSE). 65 | 66 | ## Contributing 67 | 68 | If you meet any problems never found in historical issues, please submit one! 69 | 70 | If you find any bugs or get any new ideas, please submit PR! 71 | 72 | **Note: Before you submit PR, please check whether you signed [CLA](cla.md)!!** 73 | 74 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /assets/50MB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/50MB.png -------------------------------------------------------------------------------- /assets/50mb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/50mb.png -------------------------------------------------------------------------------- /assets/687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f322e706e67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f322e706e67.png -------------------------------------------------------------------------------- /assets/687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f636c69656e742e706e67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f636c69656e742e706e67.png -------------------------------------------------------------------------------- /assets/687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f7365727665722e706e67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/687474703a2f2f3367696d672e71712e636f6d2f74726f6d5f732f74617273646f632f7365727665722e706e67.png -------------------------------------------------------------------------------- /assets/CLA1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/CLA1.png -------------------------------------------------------------------------------- /assets/CLA2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/CLA2.png -------------------------------------------------------------------------------- /assets/CLA3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/CLA3.png -------------------------------------------------------------------------------- /assets/build_with_parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/build_with_parameters.png -------------------------------------------------------------------------------- /assets/build_with_parameters_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/build_with_parameters_en.png -------------------------------------------------------------------------------- /assets/cla1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/cla1.png -------------------------------------------------------------------------------- /assets/cla2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/cla2.png -------------------------------------------------------------------------------- /assets/cla3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/cla3.png -------------------------------------------------------------------------------- /assets/client_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/client_en.png -------------------------------------------------------------------------------- /assets/encoding_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/encoding_error.png -------------------------------------------------------------------------------- /assets/eureka-tars-java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/eureka-tars-java.png -------------------------------------------------------------------------------- /assets/java_server_deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/java_server_deploy.png -------------------------------------------------------------------------------- /assets/java_server_deploy_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/java_server_deploy_en.png -------------------------------------------------------------------------------- /assets/mysql_sqlmode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/mysql_sqlmode.png -------------------------------------------------------------------------------- /assets/mysql_sqlmode_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/mysql_sqlmode_en.png -------------------------------------------------------------------------------- /assets/ping-mu-kuai-zhao-20191004-shang-wu-10.24.42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/ping-mu-kuai-zhao-20191004-shang-wu-10.24.42.png -------------------------------------------------------------------------------- /assets/platform_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/platform_en.png -------------------------------------------------------------------------------- /assets/pptseer.en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/pptseer.en.png -------------------------------------------------------------------------------- /assets/registry_not_founded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/registry_not_founded.png -------------------------------------------------------------------------------- /assets/registry_not_founded_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/registry_not_founded_en.png -------------------------------------------------------------------------------- /assets/registry_not_invoker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/registry_not_invoker.png -------------------------------------------------------------------------------- /assets/registry_not_invoker_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/registry_not_invoker_en.png -------------------------------------------------------------------------------- /assets/registry_web_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/registry_web_empty.png -------------------------------------------------------------------------------- /assets/registry_web_empty_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/registry_web_empty_en.png -------------------------------------------------------------------------------- /assets/registry_web_endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/registry_web_endpoint.png -------------------------------------------------------------------------------- /assets/registry_web_endpoint_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/registry_web_endpoint_en.png -------------------------------------------------------------------------------- /assets/resin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/resin.png -------------------------------------------------------------------------------- /assets/server_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/server_en.png -------------------------------------------------------------------------------- /assets/stage_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/stage_view.png -------------------------------------------------------------------------------- /assets/stage_view_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/stage_view_en.png -------------------------------------------------------------------------------- /assets/stat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/stat.png -------------------------------------------------------------------------------- /assets/stat_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/stat_en.png -------------------------------------------------------------------------------- /assets/tars-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars-en.png -------------------------------------------------------------------------------- /assets/tars-java-jar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars-java-jar.png -------------------------------------------------------------------------------- /assets/tars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars.png -------------------------------------------------------------------------------- /assets/tars_auth_client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_auth_client.png -------------------------------------------------------------------------------- /assets/tars_auth_client_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_auth_client_en.png -------------------------------------------------------------------------------- /assets/tars_auth_endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_auth_endpoint.png -------------------------------------------------------------------------------- /assets/tars_auth_endpoint_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_auth_endpoint_en.png -------------------------------------------------------------------------------- /assets/tars_auth_server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_auth_server.png -------------------------------------------------------------------------------- /assets/tars_auth_server_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_auth_server_en.png -------------------------------------------------------------------------------- /assets/tars_config_app1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_app1.png -------------------------------------------------------------------------------- /assets/tars_config_app1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_app1_en.png -------------------------------------------------------------------------------- /assets/tars_config_app2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_app2.png -------------------------------------------------------------------------------- /assets/tars_config_app2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_app2_en.png -------------------------------------------------------------------------------- /assets/tars_config_appconfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_appconfig.png -------------------------------------------------------------------------------- /assets/tars_config_appconfig_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_appconfig_en.png -------------------------------------------------------------------------------- /assets/tars_config_appconfig_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_appconfig_result.png -------------------------------------------------------------------------------- /assets/tars_config_appconfig_result_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_appconfig_result_en.png -------------------------------------------------------------------------------- /assets/tars_config_jiegoutu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_jiegoutu.png -------------------------------------------------------------------------------- /assets/tars_config_jiegoutu_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_jiegoutu_en.png -------------------------------------------------------------------------------- /assets/tars_config_references.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_references.png -------------------------------------------------------------------------------- /assets/tars_config_references_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_references_en.png -------------------------------------------------------------------------------- /assets/tars_config_server1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_server1.png -------------------------------------------------------------------------------- /assets/tars_config_server1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_server1_en.png -------------------------------------------------------------------------------- /assets/tars_config_server2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_server2.png -------------------------------------------------------------------------------- /assets/tars_config_server2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_server2_en.png -------------------------------------------------------------------------------- /assets/tars_config_server3_ref1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_server3_ref1.png -------------------------------------------------------------------------------- /assets/tars_config_server3_ref1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_server3_ref1_en.png -------------------------------------------------------------------------------- /assets/tars_config_server3_ref2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_server3_ref2.png -------------------------------------------------------------------------------- /assets/tars_config_server3_ref2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_server3_ref2_en.png -------------------------------------------------------------------------------- /assets/tars_config_set1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_set1.png -------------------------------------------------------------------------------- /assets/tars_config_set1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_set1_en.png -------------------------------------------------------------------------------- /assets/tars_config_set2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_set2.png -------------------------------------------------------------------------------- /assets/tars_config_set2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_set2_en.png -------------------------------------------------------------------------------- /assets/tars_config_table1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_table1.png -------------------------------------------------------------------------------- /assets/tars_config_table2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_config_table2.png -------------------------------------------------------------------------------- /assets/tars_cpp_quickstart_bushu1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_cpp_quickstart_bushu1_en.png -------------------------------------------------------------------------------- /assets/tars_cpp_quickstart_bushu2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_cpp_quickstart_bushu2_en.png -------------------------------------------------------------------------------- /assets/tars_cpp_quickstart_patch_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_cpp_quickstart_patch_en.png -------------------------------------------------------------------------------- /assets/tars_cpp_quickstart_patchresult_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_cpp_quickstart_patchresult_en.png -------------------------------------------------------------------------------- /assets/tars_cpp_quickstart_upload_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_cpp_quickstart_upload_en.png -------------------------------------------------------------------------------- /assets/tars_cpp_third_protocol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_cpp_third_protocol.png -------------------------------------------------------------------------------- /assets/tars_cpp_third_protocol_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_cpp_third_protocol_en.png -------------------------------------------------------------------------------- /assets/tars_dye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_dye.png -------------------------------------------------------------------------------- /assets/tars_dye_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_dye_en.png -------------------------------------------------------------------------------- /assets/tars_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_flow.png -------------------------------------------------------------------------------- /assets/tars_flow_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_flow_en.png -------------------------------------------------------------------------------- /assets/tars_framework_git_flows.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_framework_git_flows.jpg -------------------------------------------------------------------------------- /assets/tars_go_quickstart_bushu1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_go_quickstart_bushu1.png -------------------------------------------------------------------------------- /assets/tars_go_quickstart_bushu1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_go_quickstart_bushu1_en.png -------------------------------------------------------------------------------- /assets/tars_go_quickstart_release.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_go_quickstart_release.png -------------------------------------------------------------------------------- /assets/tars_go_quickstart_release_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_go_quickstart_release_en.png -------------------------------------------------------------------------------- /assets/tars_go_quickstart_service_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_go_quickstart_service_inactive.png -------------------------------------------------------------------------------- /assets/tars_go_quickstart_service_inactive_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_go_quickstart_service_inactive_en.png -------------------------------------------------------------------------------- /assets/tars_go_quickstart_service_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_go_quickstart_service_ok.png -------------------------------------------------------------------------------- /assets/tars_go_quickstart_service_ok_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_go_quickstart_service_ok_en.png -------------------------------------------------------------------------------- /assets/tars_idc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_idc.png -------------------------------------------------------------------------------- /assets/tars_idc_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_idc_en.png -------------------------------------------------------------------------------- /assets/tars_idc_pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_idc_pic.png -------------------------------------------------------------------------------- /assets/tars_idc_pic_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_idc_pic_en.png -------------------------------------------------------------------------------- /assets/tars_java_quickstart_bushu1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_java_quickstart_bushu1.png -------------------------------------------------------------------------------- /assets/tars_java_quickstart_bushu2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_java_quickstart_bushu2.png -------------------------------------------------------------------------------- /assets/tars_java_quickstart_patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_java_quickstart_patch.png -------------------------------------------------------------------------------- /assets/tars_java_quickstart_patchresult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_java_quickstart_patchresult.png -------------------------------------------------------------------------------- /assets/tars_java_quickstart_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_java_quickstart_upload.png -------------------------------------------------------------------------------- /assets/tars_jiaohu (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_jiaohu (1).png -------------------------------------------------------------------------------- /assets/tars_jiaohu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_jiaohu.png -------------------------------------------------------------------------------- /assets/tars_junheng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_junheng.png -------------------------------------------------------------------------------- /assets/tars_junheng_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_junheng_en.png -------------------------------------------------------------------------------- /assets/tars_not_resolve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_not_resolve.png -------------------------------------------------------------------------------- /assets/tars_notify (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_notify (1).png -------------------------------------------------------------------------------- /assets/tars_notify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_notify.png -------------------------------------------------------------------------------- /assets/tars_overload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_overload.png -------------------------------------------------------------------------------- /assets/tars_overload_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_overload_en.png -------------------------------------------------------------------------------- /assets/tars_performance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_performance.png -------------------------------------------------------------------------------- /assets/tars_performance_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_performance_en.png -------------------------------------------------------------------------------- /assets/tars_property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_property.png -------------------------------------------------------------------------------- /assets/tars_property_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_property_en.png -------------------------------------------------------------------------------- /assets/tars_push_deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_push_deploy.png -------------------------------------------------------------------------------- /assets/tars_push_deploy_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_push_deploy_en.png -------------------------------------------------------------------------------- /assets/tars_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_result.png -------------------------------------------------------------------------------- /assets/tars_rongcuo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_rongcuo.png -------------------------------------------------------------------------------- /assets/tars_rongcuo_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_rongcuo_en.png -------------------------------------------------------------------------------- /assets/tars_server_client (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_server_client (1).png -------------------------------------------------------------------------------- /assets/tars_server_client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_server_client.png -------------------------------------------------------------------------------- /assets/tars_set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_set.png -------------------------------------------------------------------------------- /assets/tars_set_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_set_en.png -------------------------------------------------------------------------------- /assets/tars_set_pic1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_set_pic1.png -------------------------------------------------------------------------------- /assets/tars_set_pic1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_set_pic1_en.png -------------------------------------------------------------------------------- /assets/tars_set_pic2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_set_pic2.png -------------------------------------------------------------------------------- /assets/tars_set_pic2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_set_pic2_en.png -------------------------------------------------------------------------------- /assets/tars_set_pic3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_set_pic3.png -------------------------------------------------------------------------------- /assets/tars_ssl_endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_ssl_endpoint.png -------------------------------------------------------------------------------- /assets/tars_stat (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_stat (1).png -------------------------------------------------------------------------------- /assets/tars_stat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_stat.png -------------------------------------------------------------------------------- /assets/tars_stat_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_stat_en.png -------------------------------------------------------------------------------- /assets/tars_tarslog_bushu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarslog_bushu.png -------------------------------------------------------------------------------- /assets/tars_tarslog_bushu_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarslog_bushu_en.png -------------------------------------------------------------------------------- /assets/tars_tarslog_patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarslog_patch.png -------------------------------------------------------------------------------- /assets/tars_tarslog_patch_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarslog_patch_en.png -------------------------------------------------------------------------------- /assets/tars_tarsnotify_bushu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsnotify_bushu.png -------------------------------------------------------------------------------- /assets/tars_tarsnotify_bushu_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsnotify_bushu_en.png -------------------------------------------------------------------------------- /assets/tars_tarsnotify_patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsnotify_patch.png -------------------------------------------------------------------------------- /assets/tars_tarsnotify_patch_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsnotify_patch_en.png -------------------------------------------------------------------------------- /assets/tars_tarsproperty_bushu (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsproperty_bushu (1).png -------------------------------------------------------------------------------- /assets/tars_tarsproperty_bushu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsproperty_bushu.png -------------------------------------------------------------------------------- /assets/tars_tarsproperty_bushu_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsproperty_bushu_en.png -------------------------------------------------------------------------------- /assets/tars_tarsproperty_patch (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsproperty_patch (1).png -------------------------------------------------------------------------------- /assets/tars_tarsproperty_patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsproperty_patch.png -------------------------------------------------------------------------------- /assets/tars_tarsproperty_patch_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsproperty_patch_en.png -------------------------------------------------------------------------------- /assets/tars_tarsproto (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsproto (1).png -------------------------------------------------------------------------------- /assets/tars_tarsproto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsproto.png -------------------------------------------------------------------------------- /assets/tars_tarsqueryproperty_bushu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsqueryproperty_bushu.png -------------------------------------------------------------------------------- /assets/tars_tarsqueryproperty_bushu_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsqueryproperty_bushu_en.png -------------------------------------------------------------------------------- /assets/tars_tarsqueryproperty_patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsqueryproperty_patch.png -------------------------------------------------------------------------------- /assets/tars_tarsqueryproperty_patch_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsqueryproperty_patch_en.png -------------------------------------------------------------------------------- /assets/tars_tarsquerystat_bushu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsquerystat_bushu.png -------------------------------------------------------------------------------- /assets/tars_tarsquerystat_bushu_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsquerystat_bushu_en.png -------------------------------------------------------------------------------- /assets/tars_tarsquerystat_patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsquerystat_patch.png -------------------------------------------------------------------------------- /assets/tars_tarsquerystat_patch_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsquerystat_patch_en.png -------------------------------------------------------------------------------- /assets/tars_tarsstat_bushu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsstat_bushu.png -------------------------------------------------------------------------------- /assets/tars_tarsstat_bushu_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsstat_bushu_en.png -------------------------------------------------------------------------------- /assets/tars_tarsstat_patch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsstat_patch.png -------------------------------------------------------------------------------- /assets/tars_tarsstat_patch_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tarsstat_patch_en.png -------------------------------------------------------------------------------- /assets/tars_template_table1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_template_table1.png -------------------------------------------------------------------------------- /assets/tars_top_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_top_en.png -------------------------------------------------------------------------------- /assets/tars_tuopu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tuopu.png -------------------------------------------------------------------------------- /assets/tars_tupclass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tupclass.png -------------------------------------------------------------------------------- /assets/tars_tupstruct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tupstruct.png -------------------------------------------------------------------------------- /assets/tars_tupstruct_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_tupstruct_en.png -------------------------------------------------------------------------------- /assets/tars_web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web.png -------------------------------------------------------------------------------- /assets/tars_web_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_en.png -------------------------------------------------------------------------------- /assets/tars_web_index-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_index-1.png -------------------------------------------------------------------------------- /assets/tars_web_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_index.png -------------------------------------------------------------------------------- /assets/tars_web_index1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_index1_en.png -------------------------------------------------------------------------------- /assets/tars_web_index_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_index_en.png -------------------------------------------------------------------------------- /assets/tars_web_system (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_system (1).png -------------------------------------------------------------------------------- /assets/tars_web_system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_system.png -------------------------------------------------------------------------------- /assets/tars_web_system_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_system_en.png -------------------------------------------------------------------------------- /assets/tars_web_system_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_system_index.png -------------------------------------------------------------------------------- /assets/tars_web_system_index_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tars_web_system_index_en.png -------------------------------------------------------------------------------- /assets/tarsjs_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tarsjs_architecture.png -------------------------------------------------------------------------------- /assets/tb-platform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tb-platform.png -------------------------------------------------------------------------------- /assets/tb_disordered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tb_disordered.png -------------------------------------------------------------------------------- /assets/tb_http_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tb_http_result.png -------------------------------------------------------------------------------- /assets/tb_ordered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tb_ordered.png -------------------------------------------------------------------------------- /assets/tb_tars_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/tb_tars_result.png -------------------------------------------------------------------------------- /assets/trace_1_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/trace_1_en.png -------------------------------------------------------------------------------- /assets/trace_2_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/trace_2_en.png -------------------------------------------------------------------------------- /assets/trace_3_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/trace_3_en.png -------------------------------------------------------------------------------- /assets/trace_4_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/trace_4_en.png -------------------------------------------------------------------------------- /assets/trace_5_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/assets/trace_5_en.png -------------------------------------------------------------------------------- /benchmark/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | [tb(tars benchmark)](https://github.com/TarsCloud/TarsBenchmark) It is a non-code benchmark tool specially tailored for tars service, with the following features: 4 | 5 | - High performance: 8-core machine TPS supports more than 20W/s; 6 | - Network compatibility: The network layer supports TCP and UDP protocol; 7 | - Protocol scalability: It supports http/tars service benchmark, open to third-protocol agreements 8 | - Perfect real-time monitor. Provide the number of TPS/Success Rate/Cost time within the cycle; 9 | 10 | ## Framework 11 | 12 | The tb is designed in a multi-process model. The main process is responsible for resource scheduling and display, and the benchmark process is responsible for network transmission and reception and statistics. The network layer can flexibly choose TCP or UDP; adopts a protocol factory to manage various service protocols, supports http/tars by default; the main process and the benchmark process exchange signals through control information, and the data interacts through the lock-free shared memory queue to achieve the lowest resource consumption. The main process periodically collects each The network statistics of the benchmark process are output to the console after a simple summary. 13 | 14 | ![tb system](../assets/tb-platform.png) 15 | 16 | 17 | ## Usage 18 | 19 | Sample 20 | ```text 21 | ./tb -c 600 -s 6000 -D 192.168.31.1 -P 10505 -p tars -S tars.DemoServer.DemoObj -M test -C test.txt 22 | ``` 23 | 参数说明 24 | ```text 25 | -h Help infomation 26 | -c Number of connections 27 | -D Target server address(ipv4) 28 | -P Target server port 29 | -p Service protocol(tars|http) 30 | -t(optional) Overtime time,default 3 second 31 | -T(optional) Network protocol,default tcp 32 | -I(optional) Continue time(by second),default 1h 33 | -i(optional) View interval(by second),default 10s 34 | -s(optional) Maximum tps limit per target server 35 | -n(optional) Maximum process 36 | ``` 37 | See details in [develop.md](develop.md) 38 | 39 | -------------------------------------------------------------------------------- /benchmark/build.md: -------------------------------------------------------------------------------- 1 | # TarsBenchmark 2 | > * [Intro](#chapter-1) 3 | > * [Dependent environment](#chapter-2) 4 | > * [Construction](#chapter-3) 5 | > * [Quick release](#chapter-4) 6 | 7 | 8 | # 1 Intro 9 | 10 | This section mainly introduces the development environment required for tb tool based on Centos7. 11 | 12 | **Note: If the TarsCpp environment has been installed on this machine before, you need to upgrade to the latest TarsCpp version** 13 | 14 | # 2 Dependent environment 15 | 16 | | Software | Software requirements | 17 | | :--- | :--- | 18 | | linux kernel: | >=2.6.18 | 19 | | gcc version: | >=4.8、glibc-devel | 20 | | bison version: | >=2.5| 21 | | flex version: | >=2.5 | 22 | | cmake version: | >=2.8.8| 23 | | TarsCpp version: | >=2.4.0| 24 | 25 | ## 2.1. Download and install build package dependency 26 | 27 | 28 | Source compilation needs to be installed: gcc, glibc, bison, flex, cmake 29 | 30 | for example,in Centos7: 31 | ``` 32 | yum install glibc-devel gcc gcc-c++ bison flex cmake 33 | ``` 34 | 35 | ## 2.2. Construction of TarsCpp development environment 36 | 37 | ```text 38 | git clone https://github.com/TarsCloud/TarsCpp.git --recursive 39 | cd TarsCpp 40 | mkdir build 41 | cd build 42 | cmake .. 43 | make 44 | make install 45 | ``` 46 | 47 | Now the compilation environment of TarsCpp has been completed, and the tb can be constructed in the next step. 48 | 49 | 50 | # 3 Construction TarsBenchmark 51 | 52 | The main compilation steps are as follows. After successful compilation, the tb tool is generated in the build/bin directory. It is an executable program that can directly test the service of [TARS](tars-guide.md) or [HTTP](http-guide.md). 53 | ``` 54 | git clone https://github.com/TarsCloud/TarsBenchmark.git 55 | cd TarsBenchmark && mkdir build && cd build 56 | cmake .. 57 | make 58 | ``` 59 | 60 | In addition, two executable files of benchmark service will be generated (NodeServer and AdminServer), can be released to the Web platform through the following steps, so that the online benchmark can be realized. 61 | 62 | 63 | # 4 Quick release 64 | 65 | The online benchmark service can be implemented with the latest version of [TarsWeb](https://github.com/TarsCloud/TarsWeb). Quick release steps are as follows: 66 | ```shell 67 | ./install.sh webhost token adminsip nodeip 68 | ``` 69 | 70 | Description: 71 | ```text 72 | webhost Host or ip:port on the TarsWeb management side 73 | token Which can obtain the http://webhost/auth.html#/token through the management side 74 | adminsip The IP address of the AdminServer deployment, it must be deployed at a single point. It is recommended to deploy together with tarsregistry.。 75 | nodeip The IP address of the NodeServer deployment, it should be separated from the AdminServer, it is recommended to expand the capacity on the management side. The more machines deployed, the stronger the ability to support parallel benchmark. 76 | ``` -------------------------------------------------------------------------------- /benchmark/develop.md: -------------------------------------------------------------------------------- 1 | ## TarsBenchmark Instructions 2 | 3 | tb can download source code to [Compile](build.md), The tool supports to benchmark services of [Http Protocol](http-guide.md) and [Tars Protocol](tars-guide.md) by default, It can also flexibly support the other third protocol development service. 4 | 5 | ### Third protocol development 6 | If your service agreement is not Tars or Http, to adapt to develop a new service protocol according to the following specifications, you can also use the underlying mechanism of tb to achieve the target service high-performance and real-time feedback. The tool discovers new protocols through the dynamic registration mechanism. Developers do this by implementing {new} Protocol.h and {new} Protocol.cpp. Be sure to declare these two macros: DECLARE_DYNCREATE/IMPLEMENT_DYNCREATE (which must be declared in cpp), and complete the process in three steps: 7 | 8 | - 1.Refer to httpProtocol to inherit the Protocol protocol class. 9 | - 2.Implement the three function of input/encode/decode. 10 | - 3.Implement the initialization function to intercept the parameters required by the command line. 11 | 12 | ```cpp 13 | class httpProtocol : public Protocol 14 | { 15 | DECLARE_DYNCREATE(httpProtocol) 16 | public: 17 | httpProtocol() {} 18 | virtual ~httpProtocol() {} 19 | 20 | /** 21 | * @brief initialize 22 | * 23 | * @param argc number of argv 24 | * @param argv parameter 25 | * 26 | * @return 0:succ, other: fail 27 | */ 28 | virtual int initialize(int argc, char** argv); 29 | 30 | /** 31 | * @brief isSupportSeq 32 | * 33 | * @return boolean 34 | */ 35 | virtual int isSupportSeq() { return false; } 36 | 37 | /** 38 | * @brief input 39 | * 40 | * @param buf buffer point 41 | * @param len buffer length 42 | * 43 | * @return int =0incomplete; >0:real packet length; <0:wrong, 44 | */ 45 | virtual int input(const char *buf, size_t len); 46 | 47 | /** 48 | * @brief encode 49 | * 50 | * @param req request 51 | * @param len buffer length 52 | * @param uniqId unique ID 53 | * 54 | * @return 0:succ, <0: fail, >0 real buffer length 55 | */ 56 | virtual int encode(char *buf, int& len, int& uniqId); 57 | 58 | /** 59 | * @brief decode 60 | * 61 | * @param buf buffer point 62 | * @param len buffer length 63 | * @param uniqId unique ID 64 | * 65 | * @return 0:succ, other: fail 66 | */ 67 | virtual int decode(const char *buf, int len, int& uniqId); 68 | }; 69 | ``` 70 | 71 | 72 | Before starting the development work, you need to know which mode the target service of the stress test belongs to. Specify it by implementing the isSupportSeq method. The default is the unordered mode. 73 | 74 | **Ordered Mode** 75 | In this mode, the benchmark client sends a request to the target server at a constant speed at the specified rate, and does not rely on the server's last request to return. When sending the request, the client will generate a **globally unique id** to the server, and when the server returns the packet, it will bring this id to the client. When the interface function is passed through uniqId, the tb tool will transfer the globally unique id to the new protocol module in encode. Decode sends the id returned by the server to the server by rewriting the uniqId. 76 | ![ordered](../assets/tb_ordered.png) 77 | 78 | 79 | **Disordered Mode** 80 | In this mode, the server does not return the sequence number to the client, and the benchmark client will send the request to the target server at a uniform speed below the specified rate, which strongly depends on the return of the server. The response or timeout of the previous request must be received before sending the next request. The following figure is an example. 81 | ![disordered](../assets/tb_disordered.png) 82 | -------------------------------------------------------------------------------- /benchmark/http-guide.md: -------------------------------------------------------------------------------- 1 | ## Case Instructions 2 | 3 | This is a example of how to use the tb to benchmark http service. 4 | 5 | The following step example describes how to start tb, then the tool continuously sends the Post request to the http server, and the server returns the result to the tb client correctly. After the test is completed, The response resule will be displaying in the console. 6 | 7 | ### 1.1. Startup example 8 | ```text 9 | ./tb -n 2 -c 5000 -s 20000 -D 192.168.10.3 -P 80 -p http -i 10 -u "http://192.168.16.1/cgi-bin/proxy?cmd=test&f=json" -F aa.txt 10 | ``` 11 | 12 | http protocol parameter description 13 | ```text 14 | -H(Optional) Set Header. It is recommended to modify it with "". 15 | -C(Optional) Set Cookie. It is recommended to modify it with "". 16 | -F(Optional) The file of post content. Default is GET request. 17 | -u(Optional) Destination URL address 18 | ``` 19 | 20 | ### 1.2. Closing example 21 | Initiative close: ctrl+C or killall tb,Wait a few seconds and then output the final statistical results.
22 | Passive close: The default duration is 1 hour. After 1 hour, the benchmark tool will bt stopped and the statistical results are output. This time can be adjusted by the-I parameter. 23 | 24 | 25 | ### 1.3. Display the results 26 | ![results](../assets/tb_http_result.png) -------------------------------------------------------------------------------- /cla.md: -------------------------------------------------------------------------------- 1 | # CLA 2 | 3 | ## The Contributor License Agreement 4 | 5 | Tencent defines the legal status of the contributed code in a _Contributor License Agreement_ \(CLA\). 6 | 7 | Only original source code from CLA signatories can be accepted into TARS. 8 | 9 | ### What am I agreeing to? 10 | 11 | This CLA allows either an individual or an entity \(the "**Corporation**"\) to Submit Contributions to Tencent, to authorize Contributions Submitted by its employees or agents to Tencent \(in the case of a Corporation\), and to grant copyright and patent licenses thereto. 12 | 13 | It is important to read and understand this legal agreement. 14 | 15 | ### How do I sign? 16 | 17 | 1. Create a pull request, the system will remind you the CLA is not signed yet. Click the url. You will recive an email at the same time. 18 | 19 | ![](assets/cla1.png) 20 | 21 | 22 | 23 | 2. Click to sign in with Github to agree. 24 | 25 | ![](assets/cla2.png) 26 | 27 | 3. That's it, for real! 28 | 29 | ![](assets/cla3.png) 30 | 31 | ### Ensure your Github e-mail address matches address used to sign CLA 32 | 33 | Your Github email address **must match** the same address you use when signing the CLA. Github has [documentation](https://help.github.com/articles/setting-your-commit-email-address-on-github/) on setting email addresses. 34 | 35 | You must also set your [git e-mail](https://help.github.com/articles/setting-your-email-in-git) to match this e-mail address as well. 36 | 37 | If you've already submitted a PR you can correct your user.name and user.email and then use use `git commit --amend --reset-author` and then `git push --force` to correct the PR. 38 | 39 | -------------------------------------------------------------------------------- /cooperation/tars_framework_git_flows.md: -------------------------------------------------------------------------------- 1 | # TarsFramework GitHub Cooperation Rules 2 | 3 | ## Introduction 4 | 5 | [TarsFramework](https://github.com/TarsCloud/TarsFramework) integrated several services like TarsRegistry,TarsNode,TarsProperty etc. The services were built by [TarsCpp](https://github.com/TarsCloud/TarsCpp). [TarsProtocol](https://github.com/TarsCloud/TarsProtocol) is a shared submodule of TarsCpp and some other Tars repositories. [TarsWeb](https://github.com/TarsCloud/TarsWeb) is a web tool that was built for TarsFramework management. We decided to choose v2.4 as the first Tars LTS version and build several versions rules those 4 related repositories. Just to make sure we could build better multi-version support here. 6 | 7 | ## Plan 8 | 9 | We made a basic rule for version deploy. The new version of each repository must follow this rule. v`{main version number}`.`{subversion number}`.`{build number}` 10 | 11 | - The first main version number is 2, the first subversion number is 4. Each compatible feature improvement and bug fix on this version will be considered as a build. For example, bugfix on v2.4.0 will trigger a v2.4.1 tag release. 12 | - We will plan further versions like v2.5,v2.6. But we have to keep each version forward compatible. Highlight the changes in the release note if it's not. 13 | 14 | ### Rules 15 | 16 | Everyone is welcomed to help us improve Tars on GitHub. Please read the following rules before you do anything. 17 | 18 | 1. Please fork the repository at first. 19 | 2. Branches like release/x.x is the master branch of each version. Do not send cross-version PR. 20 | 3. Please make sure your release is well updated to prevent further conflict. 21 | 4. Please checkout feature release from specific release branch, and follow the branch naming rule: feature/`{user_name}`/`{feature_name}`. For example, `feature/franklee/correct_error_message_on_property_table_missing` 22 | 5. Please checkout a hotfix branch if it's a hotfix. The naming rule for hotfix branch is: hotfix/`{user_name}`/`{bug_name}`. For example, `hotfix/franklee/fix_wrong_typing_on_servant_status_enum_define` 23 | 6. Please fully test your coding on a feature branch or hotfix branch. 24 | 7. Merge your feature branch and hotfix branch on your local release branch after you have done your work 25 | 8. Submit Pull Request to the release branch of Tars remote repository. Don't forget to write the necessary note. 26 | 27 | Git Flow Diagram: 28 | 29 | ![Tars Framework Git Flows](../assets/tars_framework_git_flows.jpg) 30 | 31 | ### Attention 32 | 33 | 1. Remote repository means repositories under TarsCloud organization like `TarsCloud/TarsFramework` in this document 34 | 2. Remote branch means branches in the remote repository 35 | 3. Local repository is the repository you forked to your own repositories. (Not the repository in your computer) 36 | 4. Local branch is the branch in your local repository. 37 | 5. Please merge the latest release branch to master. Thus we could easily set up a new version branch. 38 | 6. Only checkout from the master branch if you are set up a new version branch. 39 | 7. Merge old version branch to master is prohibited. 40 | -------------------------------------------------------------------------------- /demo/tarscpp/README.md: -------------------------------------------------------------------------------- 1 | Tars C++ Demo 2 | 3 | Name | About 4 | ------------------|---------------- 5 | [tars_cpp_http_demo.md](tars_cpp_http_demo.md) |Tars C++ Http 6 | [tars_cpp_quickstart.md](tars_cpp_quickstart.md) |Tars C++ Quick Start 7 | [tars_push.md](tars_push.md) |Tars C++ push 8 | [tars_co.md](tars_co.md) |Tars C++ Co 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /demo/tarscpp/tars_co.md: -------------------------------------------------------------------------------- 1 | # Tars Coroutine 2 | 3 | Waiting 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /demo/tarsgo.md: -------------------------------------------------------------------------------- 1 | # TarsGo 2 | 3 | | Dir | Feature | 4 | | :--- | :--- | 5 | | [ContextTestServer](https://github.com/TarsCloud/TarsGo/tree/master/_examples/ContextTestServer) | Server uses context | 6 | | [EchoClientServer](https://github.com/TarsCloud/TarsGo/tree/master/_examples/EchoClientServer) | tars client | 7 | | [EchoTestServer](https://github.com/TarsCloud/TarsGo/tree/master/_examples/EchoTestServer) | tars server | 8 | | [ZipkinTraceClient](https://github.com/TarsCloud/TarsGo/tree/master/_examples/ZipkinTraceClient) | zipkin tracks client by call chain | 9 | | [ZipkinTraceServer](https://github.com/TarsCloud/TarsGo/tree/master/_examples/ZipkinTraceServer) | zipkin tracks server by call chain | 10 | 11 | -------------------------------------------------------------------------------- /demo/tarsjava.md: -------------------------------------------------------------------------------- 1 | # TarsJava 2 | 3 | | Dir | Feature | 4 | | :--- | :--- | 5 | | [quickstart-client](https://github.com/TarsCloud/TarsJava/tree/master/examples/quickstart-client) | client development example | 6 | | [quickstart-server](https://github.com/TarsCloud/TarsJava/tree/master/examples/quickstart-server) | server develpment example | 7 | | [stress-server](https://github.com/TarsCloud/TarsJava/tree/master/examples/stress-server) | code of tars-java pressure testing| 8 | | [tars-spring-boot-server](https://github.com/TarsCloud/TarsJava/tree/master/examples/tars-spring-boot-server) | spring boot server example | 9 | | [tars-spring-cloud-client](https://github.com/TarsCloud/TarsJava/tree/master/examples/tars-spring-cloud-client) | spring cloud client example | 10 | | [tars-spring-cloud-server](https://github.com/TarsCloud/TarsJava/tree/master/examples/tars-spring-cloud-server) | spring cloud server example | 11 | | [tars-spring-server](https://github.com/TarsCloud/TarsJava/tree/master/examples/tars-spring-server) | spring server example | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /demo/tarsphp/README.md: -------------------------------------------------------------------------------- 1 | # TarsPHP 2 | 3 | 如果你想要快速的体验tars-server,请进入examples目录,里面有详尽的多种服务的部署guideline和开发guideline: 4 | 5 | * [搭建HttpServer ](da-jian-httpserver.md) 6 | * [搭建TimerServer ](da-jian-timerserver.md) 7 | * [搭建TcpServer ](da-jian-tcpserver.md) 8 | * [搭建WebSocketServer ](da-jian-websocketserver.md) 9 | * [弹幕活动实战](tan-mu-huo-dong-shi-zhan.md) 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/tarsphp/da-jian-timerserver.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'https://github.com/TarsPHP/TarsPHP/tree/master/examples/tars-timer-server' 3 | --- 4 | 5 | # 搭建TimerServer 6 | 7 | ## 服务部署guideline 8 | 9 | 1. 进入运维管理 => 模板管理 10 | 11 | 平台会提供一份新的针对php的模板,命名为tars.tarsphp.default, !!!!!!!必须首先修改其中php的执行路径!!!!!!! 12 | 13 | 模板相关修改: a.新建一个tars.tarsphp.timer服务模板,相比tars.tarsphp.default加一个 isTimer=1 。PHP服务选择tars.tarsphp.timer模板。 b.或者使用tars.tarsphp.default模板,在编辑服务下面的私有模板里面加入下面内容: 14 | 15 | ```markup 16 | 17 | 18 | 19 | isTimer=1 20 | 21 | 22 | 23 | ``` 24 | 25 | 1. 在平台上进入运维管理=>部署服务,填写对应的应用名和服务名称,注意,这个与下文中tars文件夹中的tars.proto.php 需要完全一致。 26 | 2. 选择服务类型为tars\_php 27 | 3. 选择模板为刚刚建立的timer服务模板,默认不启用set 28 | 4. 选择可用端口,填写服务器内网ip 29 | 5. 端口类型为TCP !!!!协议类型TIMER服务必须选择非TARS!!!!!! 30 | 6. 线程数对应SWOOLE的进程数,即为timer目录下面能启动的定时服务的数量 31 | 7. 最大连接数和队列最大长度、队列超时时间,对php服务不生效 32 | 8. 点击添加和提交即可,接下来请进入开发guidline 33 | 34 | ## 开发Guidline 35 | 36 | 1. 定时任务示例: 37 | 38 | ./src/timer/TenSecondsTimer.php 39 | 40 | ```php 41 | interval = 10000; //单位为毫秒 48 | } 49 | public function execute() { 50 | // 你的业务代码 51 | } 52 | } 53 | ``` 54 | 55 | 1. tars文件夹下面新建tars.proto.php文件, 里面需要包含对你服务本身的说明: 56 | 57 | ```php 58 | 'PHPTest', 61 | 'serverName' => 'PHPTimerServer', 62 | 'objName' => 'obj', 63 | ); 64 | ``` 65 | 66 | 这个名称要与在tars平台上面的名称完全一一对应。 67 | 68 | 2. 注意事项!!!! timer目录下的每个php文件都会和一个worker进程绑定,所以worker的数量一定要不小于定时任务的数量。 可以在tars管理平台 Servant管理 里面修改线程数(对于php来说就是swoole的worker数)。 69 | 70 | -------------------------------------------------------------------------------- /demo/tarsphp/tan-mu-huo-dong-shi-zhan.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'https://github.com/TarsPHP/TarsPHP/tree/master/examples/TarsActDemo' 3 | --- 4 | 5 | # 弹幕活动实战 6 | 7 | ## 这是什么 8 | 9 | 这是一个用Tars部署的弹幕活动项目,其中包含3个服务。 涵盖了Http,Tcp服务,使用了Mysql,Redis存储,包含了用户登录、session校验、用户信息获取、弹幕创建、弹幕获取等功能。已经涵盖了平常业务开发的很多方面。 10 | 11 | QD.ActHttpServer.obj是一个http服务,对外提供固定端口,这是业务服务,调用后端的User和Comment服务完成业务。 QD.ActCommentServer.CommentObj 是一个tcp服务,主要提供评论的写入和获取,存储在Redis中。 QD.UserService.UserObj 是一个tcp,主要提供用户信息获取,用户登录,用户Session校验。相关数据保存在Mysql中。 12 | 13 | index.html是前端页面,连接http服务,实现弹幕展示。 act.tars.local.conf是nginx配置 user\_info.sql是QD.UserServer服务的用户信息表 14 | 15 | ## 如何部署 16 | 17 | 1.需要在tars平台上创建db配置,在tars平台上,找到QD.UserService 点击服务配置,添加配置,文件名db.json,内容: 18 | 19 | ```javascript 20 | [ 21 | { 22 | "host": "mysql.tarsActDemo.local //这是是你的mysql地址", 23 | "port": 3306, 24 | "username": "root", 25 | "password": "password", 26 | "db": "tars_test", 27 | "charset": "utf-8", 28 | "instanceName": "default" 29 | } 30 | ] 31 | ``` 32 | 33 | 2.导入user\_info.sql到你的mysql中。 34 | 35 | 3.修改QD.ActCommentServer中src/ENVConf.php 中的redis 配置,设置你们自己的redis ip、port 36 | 37 | 4.依次cd 到各个服务的 src 目录,执行 composer install,安装composer 依赖 38 | 39 | 5.依次cd 到各个服务的 src 目录,执行 composer run-script deploy 打包代码 40 | 41 | 6.部署三个服务,QD.ActHttpServer是http服务,需要固定一个端口,选 非tars服务,其他两个是tcp 服务,端口随意,选 tars服务。 \(注意部署的时候在平台上配置的ServantName要和我上面写的全称一样,如果你需要修改,请同步修改tars.proto.php,actComment.proto.php和userInfo.proto.php,并从新生成protocol中代码\) 7.配置你的nginx,proxy\_pass 修改为你的 QD.ActHttpServer服务的ip地址和端口 42 | 43 | 8.拷贝index.html 到你的/data/website/tarsact/中 44 | 45 | 9.打开act.tars.local看一下是否可以访问 46 | 47 | 10.输入一个用户名 yong密码123456执行以下登录 48 | 49 | 11.发个弹幕试试 50 | 51 | 12.刷新一下,你发的弹幕出来了吗?恭喜你 O\(∩\_∩\)O哈哈~ 52 | 53 | ## 多servant支持 54 | 55 | 1. tars-server 0.3 以上版本支持多servant,可以实现tars 和 http 协议混合部署 56 | 2. QD.UserService服务已经实现了tars和http协议混合部署的范例,按照上面的说明可以先部署好tars协议 57 | 3. 在管理界面找到QD.UserService服务,点击管理servant,点击添加。 58 | 4. obj名称 HttpObj,线程数随意,绑定地址 tcp -h {你的ip} -t 60000 -p {http服务端口} -e 0 选择非tars 59 | 5. 保存后重启服务,尝试访问 [http://{你的ip}:{http服务端口}/user/index](http://{你的ip}:{http服务端口}/user/index) 可以返还 hello word 60 | 6. 可以访问 尝试访问 [http://{你的ip}:{http服务端口}/user/getUsersInfoByIds?ids=8001等](http://{你的ip}:{http服务端口}/user/getUsersInfoByIds?ids=8001等) 测试你的服务逻辑 61 | 7. 通常tars协议提供给业务调用,http协议用于测试。 业务逻辑建议统一封装到service层,http 和tars 做两个入口 62 | 63 | ## 其他 64 | 65 | 1. 没有登出功能,如果你需要登出 可以清一下cookie 66 | 2. 页面有点丑,大家将就看看 67 | 3. tars文件在每个服务的tars目录 68 | 69 | -------------------------------------------------------------------------------- /dev/tars-auth.md: -------------------------------------------------------------------------------- 1 | # Authentication 2 | 3 | Tars is a powerful RPC framework. You only need to get the tars protocol file of the callee, and then you can use the tars framework to code and request the service of the callee. At the same time, it brings some security risks. If our service interface is sensitive, we don't want sensitive data to be accessed at will. In this way, we need an authentication access mechanism detailed to the service. Tars provides such a mechanism. You only need to set the account password. The tars framework automatically completes password verification at the network layer and is completely transparent to the business layer. If the client cannot provide the correct account password, the connection will be kicked directly. 4 | 5 | At present, only C + + supports authentication, and Java will support it soon. 6 | 7 | You can find demo: cpp/examples/AuthDemo. 8 | 9 | 10 | ## How to use 11 | 12 | The use of tar authentication is very simple. You don't need to modify one line of code, just change the configuration file. Just follow these three steps: 13 | 14 | ### Modify the endpoint of the server and enable the authentication mechanism 15 | 16 | In the tars service platform, select the service to enable authentication, edit the service, modify the endpoint, add -e 1, -e indicate whether authentication is enabled. If it is 0 by default, it is not enabled. If it is 1, it is enabled 17 | 18 | ![](../assets/tars_auth_endpoint_en.png) 19 | 20 | ### Modify the configuration file of the server to add the account password 21 | 22 | Note that the server can have multiple adapters(ip port), and each adapter requiring authentication has its own account password. As shown in the figure, set the account Bert and password 123456 for test.oko.bertobjadapter 23 | 24 | ![](../assets/tars_auth_server_en.png) 25 | 26 | Due to incomplete screenshots, the actual private template content is as follows: 27 | 28 | ```text 29 | 30 | 31 | 32 | 33 | accesskey=bert 34 | secretkey=123456 35 | 36 | 37 | 38 | 39 | ``` 40 | 41 | Now, restart the service on the web platform. 42 | 43 | ### Modify the configuration file of the caller to add the account password 44 | 45 | Note that the client can access multiple objs. Each obj that needs authentication has its own account password. As shown in the figure, set the account bert for test.oko.bertobj, password 123456: 46 | 47 | ![](../assets/tars_auth_client_en.png) 48 | 49 | Due to incomplete screenshots, the actual private template content is as follows: 50 | 51 | 52 | ```text 53 | 54 | 55 | 56 | 57 | accesskey=bert 58 | secretkey=123456 59 | 60 | 61 | 62 | 63 | ``` 64 | 65 | Now restart the caller on the web platform. 66 | 67 | In this way, your service can only be accessed through the account password. 68 | 69 | -------------------------------------------------------------------------------- /dev/tars-monitor.md: -------------------------------------------------------------------------------- 1 | # Contents 2 | > * Overview 3 | > * Service monitoring principle 4 | 5 | # 1. Overview 6 | 7 | For all business services based on the Tars(C++), Tars Node can provide real-time monitoring. The general service exits abnormally, and the phenomenon of zombie is actively monitored by the Tars Node, which makes the service run more reliable. 8 | 9 | # 2. Service monitoring principle 10 | 11 | ## 2.1. Overview of service monitoring principles 12 | 13 | The Tars Node service will open a monitoring thread to be responsible for timing (interval time can be configured) to poll and monitor of the running status of all services managed by the Tars Node, and to report the running status of the service to the master. If a service meets the relevant trigger conditions, Tars Node takes corresponding measures to manage the service, so that the running status of the service is in real time under the monitoring of Tars Node. 14 | 15 | The above monitoring thread mainly includes the following key features: 16 | 17 | 1.The frequency(in seconds) of monitoring thread going to poll the service. 18 | 19 | 2.Timeout period (in seconds) for business service heartbeat reporting. If the process of processing a service under a node is time consuming, the user can consider increasing this value. 20 | 21 | 3.The frequency (in seconds) that the Tars Node reports the running status of the service to the master. 22 | 23 | 4.Tars Node has two methods to report the running status of the service to the master: single report and batch report. The batch report mode is selected by default. If the Tars Node manages a large number of services, you can choose the batch method to improve efficiency. 24 | 25 | ## 2.2. Service monitoring strategy 26 | 27 | The monitoring thread considers the judgment strategy of several important monitoring points in the process of monitoring the service. 28 | 29 | ### 2.2.1. A strategy for judging that a service process does not exist 30 | 31 | At present, the method for detecting whether the service process exists by the Tars Node is to send a NULL signal to the process of the specified ID through the kill function of the Linux system to determine whether the process exists. 32 | 33 | ### 2.2.2. A strategy for judging that service has heartbeat timeout 34 | 35 | The heartbeat timeout period of the service is configured in the Node. This configuration applies to the heartbeat timeout period of all services managed by the Tars Node. 36 | 37 | Each business service reports a heartbeat time to the Tars Node every 10 seconds. The Tars Node checks whether the heartbeat time of each business service has timed out under a certain monitoring frequency. 38 | 39 | Tars Node also checks if the heartbeat time of all BindAdapters in each business service times out. 40 | 41 | ### 2.2.3. A strategy for judging that service is allowed to start 42 | 43 | Considering various fault conditions and disaster tolerance characteristics, Tars Node will only send a start command to the service that meets the start condition. 44 | 45 | The strategies involved here are: 46 | 47 | 1.A business service whose current state is in a transition state does not allow restarting, that is, a service in a state of "Activating", "Deactivating", "Destroying", "Loading", "Patching", "BatchPatching", and the like. 48 | 49 | 2.The business service may be stopped through the O&M interface, that is, the service is manually stopped. At this time, the "internal working status" of the service is set to false. In this case, the Tars Node monitoring thread is not allowed to start the service. 50 | 51 | 3.Some services may indeed have systemic problems that prevent them from starting successfully. In order to prevent frequent restarts of these services, the Tars Node adopts a"service restart penalty time" strategy for these services: that is, each time the service is restarted, the number of restarts and the restart time will be recorded, and the maximum restart time is N times in X seconds. After N times, the service still cannot be restarted, and then try to restart the service at a frequency of Y seconds. 52 | 53 | The default value in the current framework is: within 60 seconds, the service is started up to 10 times. And after 10 times of startup failure, it is retried every 600 seconds. -------------------------------------------------------------------------------- /dev/tars-protobuf.md: -------------------------------------------------------------------------------- 1 | # protobuf Support 2 | 3 | ## Tars supports protobuf service description file 4 | 5 | If you know about tars, many of your existing businesses have adopted protobuf protocol; if you want to migrate these businesses to tars, you need to manually translate proto files into tars files, which is very troublesome and error prone. Now, tars uses the plug-in mechanism of protoc, which provides direct support for proto files, and can generate tar RPC related code, making migration smooth and easy. 6 | 7 | ### Usage method 8 | 9 | #### 1. prepare proto 10 | 11 | There are no restrictions on the syntax of proto files. You can use proto 2 or proto 3. But please note that ,you must add**option cc\_generic\_services=false;** 12 | 13 | Because our goal is not to use the Pb RPC interface generated by protoc, but to use the tar plug-in to take over and generate an RPC interface that conforms to the tar framework. An example of a proto file is as follows: 14 | 15 | ```text 16 | syntax = "proto2"; 17 | 18 | option cc_generic_services=false; 19 | 20 | package TestApp; 21 | 22 | message PbRequest { 23 | required int32 a = 1; 24 | required int32 b = 2; 25 | } 26 | 27 | message PbResponse { 28 | required int32 c = 1; 29 | } 30 | 31 | service Hello { 32 | rpc add(PbRequest) returns (PbResponse) { 33 | } 34 | } 35 | ``` 36 | 37 | #### 2. make 38 | 39 | Because the statements that call the tars pb plug-in are already built into the framework makefile.tars file. Since the file name generated by protoc by default has the suffix.pb.h, the tars plug-in also follows this naming rule. The generated file suffix is .tars.h 40 | 41 | 42 | -------------------------------------------------------------------------------- /dev/tars-resource.md: -------------------------------------------------------------------------------- 1 | # Tars 资源对接能力使用指引 2 | 3 | TARS管理平台提供了由平台自动安装TARS Node的能力。当用户上线服务,或扩容服务之时,若相应IP未安装TARS Node,管理平台可通过ssh登录相应机器并安装TARS Node。 系统将对外提供“install\_tars\_node”和 “uninstall\_tars\_node”两个接口用于安装和卸载tars\_node,具体可参见接口API文档. 4 | 5 | ## **Tars Node安装包准备** 6 | 7 | TARS Node 二进制包准备,用户需要从开发框架代码中,拷贝TARS Node的二进制包,并生成相应的tarsnode.tar.gz包,放在管理平台的files目录下。注意:一定要放在files目录下,且名称为tarsnode.tar.gz。 8 | 9 | 其中:需修改conf下的配置文件tarsnode.conf。需将localip,endpoint中的ip地址换成 {{machine\_ip}} 这个特殊标志,管理平台执行安装时,会将 {{machine\_ip}} 置换成待安装tarsnode的机器ip。 10 | 11 | ## **设置配置文件** 12 | 13 | 资源管理相关的有两个对接配置文件,/config/resourceConf.js 和 /config/sshConf.json 其中,resouceConf文件,可配置两个字段 1)、enableAutoInstall: 若此值为true,则系统将在上线和扩容的时候,自动登录机器并安装Tars Node。 2)、getMachineConf: 由用户提供的获取机器信息的url,入参为ip,出参必须为:​{ “data”: { “ip”: “127.0.0.1”, “port”: “3306”, “username”: “user”, “password”: “123456” } } 其中,data对象包含机器的ip,ssh端口,用户名和登录密码。 14 | 15 | 若不配置此接口,或此接口查询不到相应IP的机器信息,Tars管理平台允许配置sshConf.json文件,由用户提前准备好机器信息并填入,管理平台会到此配置文件下读取相应的机器信息。此文件也可直接修改,无需重启服务。 16 | 17 | -------------------------------------------------------------------------------- /dev/tars.js/nodetools-cli.md: -------------------------------------------------------------------------------- 1 | # Scaffolding and automatic publishing tools for tars nodejs 2 | This tool provides Tars Nodejs scaffolding, automatic packaging and distribution functions. 3 | With this tool, you can develop and publish a tars service in three or four steps. 4 | ## 1. Install 5 | `npm install -g @tars/nodetools-cli` 6 | ## 2. Usage 7 | ### Create a service 8 | Refer to tars's [Hello World documentation](https://github.com/TarsCloud/TarsDocs/tree/master/hello-world) to create a tars service. 9 | Notice to select the correct protocol type. Select `tars protocol for, tars rpc service and `non-tars protocol 'for http service. 10 | 11 | ### Init Project 12 | `nodetools init` 13 | Set options as needed, where application, server, and obj, must be consistent with the steps in creating the service. 14 | 15 | - language:javascript、typescript 16 | - protocal:http、tars 17 | - Http framework:koa、express、Nodejs native http module 18 | 19 | 20 | ### Develop 21 | Under the directory generated by the initialization project, the http protocol service can be directly `npm run dev` to start the service and develop business logic. 22 | 23 | The tars protocol service first needs to write a protocol file, convert it into js/ts code, configure the corresponding `imp object `as prompted in the code, and then start the service with `npm run dev`. 24 | 25 | ### Packaging and publishing 26 | 27 | This tool provides the function of automatic packaging and publishing of tars nodejs services. Enter the address of the tars platform and the token, created in the tars user Center according to the prompts to automatically package and publish the service. 28 | Among them, token can be saved or not saved in package.json according to the actual situation, and non-sensitive projects or environments can be saved. 29 | 30 | For http protocol service, after the initialization of the project, you can directly run `npm run upload` to publish the service to the Tars platform. The test output can be seen by accessing the `/ hello` path in the browser. 31 | 32 | For the tars protocol service, you need to convert the tars protocol file first, implement the business logic, and then run `npm run upload` to publish to the Tars platform. 33 | 34 | For projects not created by the scaffolding of this tool, you can run `nodetools upload` in the root directory to package and publish automatically, or you can edit the script in package.json to use this tool. -------------------------------------------------------------------------------- /dev/tars.js/tars-dyeing.md: -------------------------------------------------------------------------------- 1 | # @ tars / dyeing 2 | 3 | The TARS dyeing basic module provides methods for obtaining and judging `staining objects`. 4 | 5 | __Users: You should not use this module directly, but use other modules that meet the `staining standards` to obtain` staining objects`__ 6 | 7 | __Module developer: Get `TARS stained objects` You should use this module's `gen()` method to get` colored objects`__ 8 | 9 | ## Dyeing (Introduction) 10 | 11 | Coloring is a state passed on the interface's invocation chain (server <==> client) to identify a specific request processing process. 12 | 13 | This state consists of a flag and additional information `KEY` _ (optional) _. 14 | 15 | Services on the call chain can set (originate) and read (receive) this state, and perform corresponding processing (such as outputting specific logs and characteristics). 16 | 17 | In the system, dyeing consists of this module and its corresponding convention. 18 | 19 | ## Standard (Convention) 20 | 21 | If the module uses a dyeing system, it is necessary to comply with the following conventions (At the same time, we will refer to the modules that meet the conventions as the modules that meet the `staining standards`): 22 | 23 | 1. Provide the `getDyeingObj()` method and return `Dyeing Object`. 24 | 2. Use the @ tars/dyeing.gen method to generate a dyeing object. 25 | 3. Use the @ tars/dyeing.is() method to determine whether the dyeing object is valid. 26 | 27 | ## Module method 28 | 29 | ### TarsDyeing.gen (dyeing [, key, args]) 30 | 31 | By calling this method, you can get `colored objects`: 32 | 33 | __dyeing__: Do you need dyeing 34 | __key__: Coloring additional information `KEY` (optional) 35 | __args__: additional parameters of the program (optional) 36 | 37 | `key` is passed to the next service through the call chain, while `args` is only valid in the current dyed object (it is not passed). 38 | 39 | __Please note: The cause of the staining is different from the cause of the staining (thing). This module only cares about the stained objects, not the cause of the staining.__ 40 | 41 | ### TarsDyeing.is(obj) 42 | 43 | Call this method to determine whether an object passed in is a `colored object`: 44 | 45 | If an empty object is passed in, the method will also return `false` 46 | 47 | ## Dyeing Object Properties 48 | 49 | ### dyeingObj.dyeing 50 | 51 | Whether coloring is required, this is `Boolean` 52 | 53 | ### dyeingObj.key 54 | 55 | Additional information passed by the dye, this is `String` and is optional and may not exist 56 | 57 | ### dyeingObj.args 58 | 59 | Additional information about the dyed object itself, which should not be passed between services by business code (only used as a local parameter). 60 | 61 | This object is not limited in type and is also optional -------------------------------------------------------------------------------- /dev/tars.js/tars-notify.md: -------------------------------------------------------------------------------- 1 | # @ tars / notify 2 | 3 | Report business (framework) messages (alarms) to the `TARS` platform. 4 | 5 | ## report (message [, id]) 6 | 7 | Report the message to the platform and view it on the web management page. 8 | 9 | * _message_: message content (__required__) 10 | * _id_: service thread (process) ID, *default value is process.pid* 11 | 12 | ## notify (message [, level, id]) 13 | 14 | Report notification information to the platform. 15 | 16 | * _message_: notification content (__required__) 17 | * _level_: Level of notification content, LEVEL enumeration, *The default value is LEVEL.NOTIFYNORMAL* 18 | * _id_: service thread (process) ID, *default value is process.pid* 19 | 20 | There are 3 options in the `LEVEL` enumeration: 21 | 22 | * _LEVEL.NOTIFYNORMAL_: Normal (default) 23 | * _LEVEL.NOTIFYWARN_: warning 24 | * _LEVEL.NOTIFYERROR_: error 25 | 26 | The platform alerts the reported anomalies every 10 minutes. -------------------------------------------------------------------------------- /dev/tars.js/tars2node.md: -------------------------------------------------------------------------------- 1 | # Tars2Node 2 | 3 | `tars2node` can convert the Tars IDL definition file to the version used by the JavaScript language, combined with the [@tars/stream](https://www.npmjs.com/package/@tars/stream) module to perform codec operations. 4 | 5 | If you have Tars RPC requirements, you can call it in conjunction with the [@tars/rpc](https://www.npmjs.com/package/@tars/rpc) module. 6 | 7 | ## Usage 8 | 9 | Just use the `tars2node` precompiler in the build directory (Linux platform). 10 | 11 | ```bash 12 | tars2node [OPTIONS] tarsfile 13 | ``` 14 | 15 | ## options 16 | 17 | Options | Functions | 18 | | ------------- | ------------- | 19 | | --stream-path = [DIRECTORY] | Specify the codec module name, the default is @tars/stream. | 20 | | --rpc-path = [DIRECTORY] | Specify the RPC module name. The default is @tars/rpc. | 21 | | --allow-reserved-namespace | Whether to allow `tars` as a namespace (because this namespace is mainly used for tars file definitions for framework services). | 22 | | --dir = [DIRECTORY] | Output directory for generated files. | 23 | | --relative | Limits all `.tars` files to look in the current directory. | 24 | | --tarsBase = [DIRECTORY] | Specify the search directory for `.tars` files. | 25 | | --r | Convert nested `.tars` files. | 26 | | --r-minimal | Reduce dependent files and remove unnecessary members. | 27 | | --r-reserved | Members to keep when thinning dependent files. | 28 | | --client | Generate the calling class code for the client. | 29 | | --server | Generate server-side framework code. | 30 | | --ts | Turning on this option will only generate TypeScript (.ts) code. | 31 | | --dts | Append a TypeScript description file (.d.ts) when generating. | 32 | | --long-type = [number | string | bigint] | Optionally use \ to express the \ type, with a default value of \. | 33 | | --string-binary-encoding | When you encounter character encoding problems or need to access the original data, turn on this option to use \ to store \. | 34 | | --enum-reverse-mappings | Output code \ supports reverse mapping of enum values ​​to enum names. | 35 | | --optimize = [0 \| s] | Optimize the output code size. The default is 0 (that is, not optimized). | 36 | 37 | ## Examples 38 | 39 | ```bash 40 | tars2node Protocol.tars 41 | ``` 42 | 43 | The above command will convert the constants, enumerations, and structures defined in the Protocol.tars file to generate ProtocolTars.js for encoding and decoding. 44 | For usage, please refer to the [@tars/stream](https://www.npmjs.com/package/@tars/stream) module documentation. 45 | 46 | ```bash 47 | tars2node Protocol.tars --client 48 | ``` 49 | 50 | The above command will convert the data types such as `constant`,` enumeration value`, `structure` defined in the file, and convert the` interface` description section into a Tars RPC client interface file, and finally generate `ProtocolProxy.js` for Used by the caller. 51 | For usage, please refer to [@tars/rpc](https://www.npmjs.com/package/@tars/rpc) module documentation. 52 | 53 | ```bash 54 | tars2node Protocol.tars --server 55 | ``` 56 | 57 | The above command will convert data types such as `constant`,` enumeration value`, `struct` defined in the file, and convert the` interface` description section into a Tars RPC server interface file, and finally generate `Protocol.js` and `ProtocolImp.js` is used by the service provider. 58 | Developers do not need to change `Protocol.js`, they only need to continue to improve the specific functions in the` ProtocolImp.js` implementation file to provide services as Tars RPC server. 59 | For usage, please refer to [@tars/rpc](https://www.npmjs.com/package/@tars/rpc) module documentation. 60 | 61 | ## Compile from source 62 | 63 | 1. Install build-essential for the corresponding platform 64 | 2. Install [CMake](https://cmake.org/) 65 | 66 | linux & mac: 67 | ``` 68 | cd build 69 | cmake .. 70 | make -j4 71 | ``` 72 | 73 | windows: 74 | ``` 75 | cd build 76 | cmake .. 77 | cmake --build . --config Release 78 | ``` -------------------------------------------------------------------------------- /dev/tarscpp/README.md: -------------------------------------------------------------------------------- 1 | # TarsCPP 2 | 3 | -------------------------------------------------------------------------------- /dev/tarscpp/tars-http1.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # HTTP Support 5 | 6 | Tars has built-in support for HTTP and RPC encapsulation for the protocol library, making it almost transparent to business development and very convenient to use. Because of reusing tar RPC, it also has the characteristics of synchronization, asynchrony and timeout, and can use tar stat to report call quality. 7 | 8 | This article briefly introduces the methods and steps of using HTTP, including synchronous call and asynchronous call. See examples/HttpDemo for example code. 9 | 10 | **注意tarscpp>=2.3.0版本才支持** 11 | 12 | ## http server 13 | 14 | see demo: examples/HttpDemo/HttpServer 15 | 16 | Custom protocol, using HTTP. For details, [please refer to the HTTP server documentation](tars-http.md) 17 | 18 | ``` 19 | 20 | void HttpServer::initialize() 21 | { 22 | addServant(ServerConfig::Application + "." + ServerConfig::ServerName + ".HttpObj"); 23 | addServantProtocol(ServerConfig::Application + "." + ServerConfig::ServerName + ".HttpObj", &TC_NetWorkBuffer::parseHttp); 24 | } 25 | 26 | ``` 27 | ``` 28 | int HttpImp::doRequest(JceCurrentPtr current, vector &buffer) 29 | { 30 | TC_HttpRequest request; 31 | vector v = current->getRequestBuffer(); 32 | string sBuf; 33 | sBuf.assign(&v[0],v.size()); 34 | request.decode(sBuf); 35 | TC_HttpResponse rsp; 36 | string s="hello"; 37 | rsp.setResponse(s.c_str(),s.size()); 38 | rsp.encode(buffer); 39 | 40 | return 0; 41 | } 42 | ``` 43 | ## http rpc 44 | 45 | ### Get Servant Proxy, Set Protocol 46 | 47 | ```text 48 | CommunicatorPtr& comm = Application::getCommunicator(); 49 | ServantPrx prx = comm->stringToProxy("test.server.yourobj"); 50 | 51 | // set protocol 52 | prx->tars_set_protocol(ServantProxy::PROTOCOL_HTTP1, 10); 53 | ``` 54 | 55 | ### About connection reuse 56 | 57 | Although HTTP supports long and short connections, HTTP cannot be connected for reuse, that is, only one package (request and response) can run in parallel on one connection, so tars RPC specially supports serial mode 58 | 59 | For example: 60 | ``` 61 | prx->tars_connection_serial(10) 62 | ``` 63 | 64 | It is equivalent to starting 10 HTTP connections and completing HTTP requests on the connection. Do not enable this parameter for normal RPCs of tar!!! 65 | 66 | Here, a function is used to enable the support of prx for HTTP. The second parameter 10 is the number of serial connections 67 | 68 | ``` 69 | prx->tars_set_protocol(ServantProxy::PROTOCOL_HTTP1, 10); 70 | ``` 71 | 72 | In fact, this statement is equivalent to: 73 | 74 | ``` 75 | ProxyProtocol proto; 76 | proto.requestFunc = tars::http1Request; 77 | proto.responseExFunc = tars::http1Response; 78 | prx->tars_set_protocol(proto); 79 | prx->tars_connection_serial(10); 80 | 81 | ``` 82 | 83 | ### Sync Call 84 | 85 | ```text 86 | shared_ptr rsp; 87 | shared_ptr req = std::make_shared(); 88 | req->setPostRequest("http://domain.com/hello", string("helloworld-") + TC_Common::tostr(i), true); 89 | //set http header, for example: keep-alive 90 | req->setHeader("Connection", "keep-alive"); 91 | 92 | prx->http_call("hello", req, rsp); 93 | ``` 94 | 95 | Note: the first parameter of http_call here has no actual function, but is used for monitoring. That is to say, the function name is "hello" in the interface statistics of web management platform 96 | 97 | ### Async Call 98 | 99 | ```text 100 | // callback 101 | class MyHttpCb : public HttpCallback 102 | { 103 | public: 104 | virtual int onHttpResponse(const shared_ptr &rsp) 105 | { 106 | return 0; 107 | } 108 | virtual int onHttpResponseException(int expCode) 109 | { 110 | return 0; 111 | } 112 | }; 113 | 114 | shared_ptr req = std::make_shared(); 115 | 116 | string buff = string("helloworld-") + TC_Common::tostr(i); 117 | req->setPostRequest("http://domain.com/hello", buff, true); 118 | 119 | prx->http_call_async("hello", req, p); 120 | 121 | ``` 122 | 123 | Note: the first parameter of http_call_async here has no actual function, but is used for monitoring. That is to say, the function name is "hello" in the interface statistics of web management platform 124 | -------------------------------------------------------------------------------- /dev/tarscpp/tars-performance.md: -------------------------------------------------------------------------------- 1 | # performance data 2 | 3 | The configuration of our test machine is shown in the figure below. We have three machines with the same configuration, two of which are clients and one is server:: 4 | 5 | ![](../../assets/tars_performance_en.png) 6 | 7 | The machine is configured as follows 8 | 9 | | Software | Software requirements | 10 | | :--- | :--- | 11 | | system kernel | Linux 3.10.94 x86\_64 x86\_64 GNU/Linux | 12 | | cpu info | 3.30Ghz cpu\*8 | 13 | | memory| 16GB | 14 | | Network | Gigabit Ethernet | 15 | | Hard disk | 7200rpm Mechanical hard disk | 16 | 17 | 18 | In the first test, we tested the general performance of the machine. We deployed two network threads and five business threads on the client machine, and sent the business data of the normal size. In the second test, we tested the ultimate performance of the tars. We opened 50 processes on two machines as the client respectively. Each process has 16 threads, and each thread sends 4 bytes Small business data package, the test results are as follows: 19 | 20 | | Lang | Client Machines| Process num | Thread num | package size(B) | TPS(w/s) | Avg cost\(ms\) | cpu| In traffic\(Mb/s\) | Out traffic\(Mb/s\) | In packets\(/s\) | Out packets\(/s\) | 21 | | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | 22 | | c++ | 1 | 1 | 1 | 4 | 0.7 | 0.13 | 3% | 8M      |  7M | 7214   |  7220 | 23 | | c++ | 1 | 1 | 1 | 1024 | 0.52 | 0.17 | 3% | 53M     |  50M | 5677   |  5666 | 24 | | c++ | 2 | 1 | 10 | 4 | 11.39 | 0.17 | 28% | 139.729M | 92.389M | 127,267 | 127,923 | 25 | | c++ | 2 | 1 | 10 | 1024 | 6.73 | 0.29 | 19% | 644.135M | 616.395M | 95,424 | 95,823 | 26 | | c++ | 2 | 2 | 10 | 4 | 20.05 | 0.20 | 63% | 238.542M | 158.658M | 220,434 | 221,658 | 27 | | c++ | 2 | 2 | 10 | 1024 | 10.03 | 0.38 | 38% | 972.232M | 930.256M | 141,841 | 142,388 | 28 | | c++ | 2 | 5 | 10 | 4 | 27.22 | 0.37 | 84% | 327.972M | 215.173M | 306,896 | 300,099 | 29 | | c++ | 2 | 5 | 10 | 1024 | 10.02 | 0.96 | 48% | 974.102M | 932.277M | 132,091 | 133,574 | 30 | | c++ | 2 | 50 | 16 | 4 | 41 | 3.88 | 92% | 463.815M | 313.112M | 422,732 | 431,050 | 31 | | java | 1 | 1 | 1 | 4 | 0.7 | 0.13 | 5% | 8.424M      |  6.041M | 7773   |  7793 | 32 | | java | 1 | 1 | 1 | 1024 | 0.52 | 0.17 | 8% | 61.866M | 59.951M | 6674   |  6700 | 33 | | java | 2 | 1 | 10 | 4 | 9.83 | 0.18 | 34% | 155.719M | 106.310M | 156,681 | 148,201 | 34 | | java | 2 | 1 | 10 | 1024 | 7.82 | 0.27 | 26% | 694.184M | 669.369M | 103,564 | 104,158 | 35 | | java | 2 | 2 | 10 | 4 | 20.42 | 0.20 | 57% | 254.149M | 183.307M | 252,928 | 259,064 | 36 | | java | 2 | 2 | 10 | 1024 | 10.03 | 0.38 | 41% | 964.790M | 930.363M | 141,965 | 143,004 | 37 | | java | 2 | 5 | 10 | 4 | 26.34 | 0.34 | 77% | 244.887M | 186.358M | 243,527 | 254,967 | 38 | | java | 2 | 5 | 10 | 1024 | 10.11 | 0.97 | 48% | 967.217M | 939.408M | 132,421 | 135,919 | 39 | | java | 2 | 50 | 16 | 4 | 38 | 4.27 | 82% | 438.999M | 329.996M | 413,046 | 426,961 | 40 | 41 | **The test results are only for reference. The actual results will be affected by different test conditions and measurement methods** 42 | 43 | -------------------------------------------------------------------------------- /dev/tarscpp/tars-protobuf.md: -------------------------------------------------------------------------------- 1 | # tars supports syntax of protobuf service 2 | 3 | Maybe there are a lots of businesses use by the protocol of protobuf that you have worked when you know tars. 4 | If you want to use tars for your businesses code, you must translate proto files into tars which is very troublesome and error prone. 5 | Pleasant is that tars provides direct support for proto files by using plugin mechanism of protoc. 6 | This mechanism can generate code about tars rpc automatically which makes you migration smooth and worry free. 7 | 8 | 9 | ## Instructions 10 | 11 | 12 | ### 1. write your proto files 13 | The syntax of the proto file is not limited, so you can use proto2 or proto3. 14 | But you must add **option cc_generic_services=false;** to your proto files. 15 | Because using the pb rpc interface generated by protoc it not our goal. 16 | Our goal is that taking over with the tars plugin to generate a rpc interface which conforms to the tars framework. 17 | An example of a proto file: 18 | 19 | 20 | ```cpp 21 | syntax = "proto2"; 22 | 23 | option cc_generic_services=false; 24 | 25 | package TestApp; 26 | 27 | message PbRequest { 28 | required int32 a = 1; 29 | required int32 b = 2; 30 | } 31 | 32 | message PbResponse { 33 | required int32 c = 1; 34 | } 35 | 36 | service Hello { 37 | rpc add(PbRequest) returns (PbResponse) { 38 | } 39 | } 40 | ``` 41 | 42 | 43 | ### 2. make 44 | Because of the statement that calls the tars pb plugin is already built into the makefile.tars, you just need to execute make. 45 | Tars plugin follows the rule that the file with a .pb.h suffix generated by protoc, so its generated file has a .tars.h suffix. 46 | 47 | 48 | -------------------------------------------------------------------------------- /dev/tarsgo/pb2tarsgo.md: -------------------------------------------------------------------------------- 1 | # pb2tarsgo 2 | 3 | ## Usage 4 | 5 | ```text 6 | go get github.com/TarsCloud/TarsGo/tars 7 | go get github.com/golang/protobuf/{proto,protoc-gen-go} 8 | install protoc 9 | ``` 10 | 11 | * Add tarsrpc plugin for protoc-gen-go 12 | 13 | ```text 14 | cd $GOPATH/src/github.com/golang/protobuf/protoc-gen-go && cp -r $GOPATH/src/github.com/TarsCloud/TarsGo/tars/tools/pb2tarsgo/protoc-gen-go/{link_tarsrpc.go, tarsrpc} . 15 | go build . 16 | cp protoc-gen-go $GOPATH/bin 17 | export PATH=$PATH:$GOPATH/bin 18 | ``` 19 | 20 | ## example 21 | 22 | * proto file 23 | 24 | ```text 25 | syntax = "proto3"; 26 | package helloworld; 27 | 28 | // The greeting service definition. 29 | service Greeter { 30 | // Sends a greeting 31 | rpc SayHello (HelloRequest) returns (HelloReply) {} 32 | } 33 | 34 | // The request message containing the user's name. 35 | message HelloRequest { 36 | string name = 1; 37 | } 38 | 39 | // The response message containing the greetings 40 | message HelloReply { 41 | string message = 1; 42 | } 43 | ``` 44 | 45 | * generate the code 46 | 47 | ```text 48 | protoc --go_out=plugins=tarsrpc:. helloworld.proto 49 | ``` 50 | 51 | * server 52 | 53 | ```text 54 | package main 55 | 56 | import ( 57 | "github.com/TarsCloud/TarsGo/tars" 58 | "helloworld" 59 | ) 60 | 61 | type GreeterImp struct { 62 | } 63 | 64 | func (imp *GreeterImp) SayHello(input helloworld.HelloRequest)(output helloworld.HelloReply, err error) { 65 | output.Message = "hello" + input.GetName() 66 | return output, nil 67 | } 68 | 69 | func main() { //Init servant 70 | 71 | imp := new(GreeterImp) //New Imp 72 | app := new(helloworld.Greeter) //New init the A JCE 73 | cfg := tars.GetServerConfig() //Get Config File Object 74 | app.AddServant(imp, cfg.App+"."+cfg.Server+".GreeterTestObj") //Register Servant 75 | tars.Run() 76 | } 77 | 78 | ``` 79 | 80 | * client 81 | 82 | ```text 83 | package main 84 | 85 | import ( 86 | "fmt" 87 | "github.com/TarsCloud/TarsGo/tars" 88 | "helloworld" 89 | ) 90 | 91 | func main() { 92 | comm := tars.NewCommunicator() 93 | obj := fmt.Sprintf("StressTest.HelloPbServer.GreeterTestObj@tcp -h 127.0.0.1 -p 10014 -t 60000") 94 | app := new(helloworld.Greeter) 95 | comm.StringToProxy(obj, app) 96 | input := helloworld.HelloRequest{Name: "sandyskies"} 97 | output, err := app.SayHello(input) 98 | if err != nil { 99 | fmt.Println("err: ", err) 100 | } 101 | fmt.Println("result is:", output.Message) 102 | } 103 | ``` 104 | 105 | -------------------------------------------------------------------------------- /dev/tarsgo/performance.md: -------------------------------------------------------------------------------- 1 | # Performance 2 | 3 | ## Bench environment 4 | 5 | * Bench Machine type: 4 core /8 thread CPU 3.3Ghz,16G memory 6 | * Bench Logic: The client carries a certain amount of data to the server, and the server returns it to the client as it is. 7 | * Server single process, multiple clients initiate bench. 8 | 9 | ## Bench result 10 | 11 | | framwork | TPS(10 byte) | TPS(128 byte) | TPS(256 byte) | 12 | | -------------- | ------------ | ------------- | ------------- | 13 | | TARS(C++) | 617163 | 390686 | 280637 | 14 | | TARS(JAVA) | 430725 | 384113 | 279531 | 15 | | TARS(NODEJS) | 158888 | 158139 | 157334 | 16 | | TARS(GO) | 596795 | 386024 | 276458 | 17 | | TARS(PHP) | 168745 | 169953 | 168617 | 18 | | Spring Cloud | 160114 | 157010 | 156830 | 19 | | gRPC(C++) | 89351 | 86132 | 81630 | 20 | | gRPC(GO) | 106345 | 100599 | 99684 | 21 | 22 | -------------------------------------------------------------------------------- /dev/tarsgo/spec.md: -------------------------------------------------------------------------------- 1 | # 目录 2 | > * [介绍](#main-chapter-1) 3 | > * [cmake规范](#main-chapter-2) 4 | 5 | # 介绍 6 | 7 | 阅读本文之前, 请必须阅读[基础概念](../../base/tars-concept.md) 8 | 9 | 本文介绍使用cmake来管理代码(tarsgo >= 1.1.3) 10 | 11 | 另外go版本请使用>=1.13以上版本, 并完成tarsgo的下载 12 | 13 | ## 2. cmake规范 14 | 15 | ### 2.1. cmake使用 16 | 17 | 使用Tars实现的服务,可以使用cmake来管理go的代码编译 18 | 19 | TARS框架提供了一个基础的tars-tools.cmake ($GOPATH/src/github.com/TarsCloud/TarsGo/cmake/tars-tools.cmake), 业务服务的CMakeLists.txt引用该文件即可. 20 | 21 | TARS框架也提供了脚本\($GOPATH/src/github.com/TarsCloud/TarsGo/tars/tools/cmake\_tars\_server.sh\)可以自动生成空的服务框架和CMakeLists.txt 22 | 23 | 业务服务CMakeLists.txt示例如下: 24 | 25 | ``` 26 | execute_process(COMMAND go env GOPATH OUTPUT_VARIABLE GOPATH) 27 | 28 | string(REGEX REPLACE "\n$" "" GOPATH "${GOPATH}") 29 | 30 | include(${GOPATH}/src/github.com/TarsCloud/TarsGo/cmake/tars-tools.cmake) 31 | 32 | cmake_minimum_required(VERSION 2.8) 33 | 34 | project(DemoServer Go) # select GO compile 35 | 36 | gen_server(Demo DemoServer) 37 | 38 | # go mod init 39 | # mkdir build 40 | # cd build 41 | # cmake .. 42 | # make 43 | 44 | ``` 45 | 46 | 如果源码下某子目录需要也能独立编译成可执行程序, 则该子目录添加对应的CMakeLists.txt如下(参考生成代码后的Client目录): 47 | ``` 48 | cmake_minimum_required(VERSION 2.8) 49 | 50 | project(Client Go) 51 | 52 | gen_server(Base Client) 53 | 54 | ``` 55 | 56 | 编译服务: 57 | ``` 58 | mkdir build 59 | cd build 60 | cmake .. 61 | make -j4 62 | ``` 63 | 64 | ### 2.2. 打包和上传服务 65 | 66 | 你可以一键打包和上传服务: 67 | ``` 68 | make HelloServer-tar 69 | make HelloServer-upload 70 | ``` 71 | 72 | 上传服务需要正确设置 73 | ``` 74 | cd build 75 | cmake .. -DTARS_WEB_HOST=http://xxx.xxx.xxx.xxx:3000 76 | ``` 77 | 78 | 这里TARS_WEB_HOST是你web平台地址 79 | 80 | 参考[基础概念](../../base/tars-concept.md) 81 | 82 | **注意, 你也可以并行用GoLand这类IDE工具来管理代码** 83 | -------------------------------------------------------------------------------- /dev/tarsjava/README.md: -------------------------------------------------------------------------------- 1 | # TarsJava 2 | 3 | -------------------------------------------------------------------------------- /dev/tarsjava/images/Logback-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/Logback-config.png -------------------------------------------------------------------------------- /dev/tarsjava/images/docker-hello-world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/docker-hello-world.png -------------------------------------------------------------------------------- /dev/tarsjava/images/eureka-tars-java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/eureka-tars-java.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-deployment-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-deployment-client.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-deployment-http.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-deployment-http.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-deployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-deployment.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-en.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-http-call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-http-call.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-pubjar-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-pubjar-client.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-pubjar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-pubjar.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-publication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-publication.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-state-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-state-client.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-state.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-state.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-tarstest-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-tarstest-client.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-tarstest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-tarstest.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-test-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-test-client.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-test.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-testclient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-testclient.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-testserver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-testserver.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-uploadjar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-uploadjar.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-uploadjarclient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-uploadjarclient.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-uploadtars-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-uploadtars-client.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tars-uploadtars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tars-uploadtars.png -------------------------------------------------------------------------------- /dev/tarsjava/images/tarsjavastart-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsjava/images/tarsjavastart-info.png -------------------------------------------------------------------------------- /dev/tarsjava/stress-testing.md: -------------------------------------------------------------------------------- 1 | [Jump To GitHub](https://github.com/TarsCloud/TarsJava/tree/master/examples/stress-server) -------------------------------------------------------------------------------- /dev/tarsjava/tars-java-start.md: -------------------------------------------------------------------------------- 1 | # TarsJava scaffolding tool 2 | This tool provides TarsJava scaffolding. 3 | 4 | With this tool, you can generate TarsJava scaffolding for the server and client, and quickly start the development of the Tars service. 5 | 6 | ## 1. Environmental requirements 7 | - JDK1.8 or above 8 | 9 | ## 2. Installation and usage 10 | ### Installation 11 | 12 | Directly copy tars-java-tools-1.0.0.jar in the jar folder to the project directory and use it, or compile it yourself as follows: 13 | 14 | - Clone the project: `git clone https://github.com/TarsCloud/TarsJavaStart.git` 15 | 16 | Environmental requirements 17 | 18 | - JDK1.8 or above 19 | - Maven 3.5 or above 20 | 21 | - Spring Boot 2.1.3 or above 22 | 23 | - Execute maven packaging in the project root directory: `mvn package` 24 | 25 | - Enter the target directory and copy the generated jar package to the project directory 26 | 27 | ### Scaffolding generation 28 | 29 | Run the following command in the project directory: 30 | 31 | ```text 32 | java -jar tars-java-start-1.0.0.jar --springboot.version=2.0.3 --maven.group=com.tencent.tars --maven.artifact=test-server --maven.name=TestServer --packagename=com.tencent.tars.server --jdk.version=1.8 --type=server 33 | ``` 34 | 35 | The parameters are as follows: 36 | 37 | - springboot.version: SpringBoot version, default is 2.0.3 38 | - maven.group: maven groupId, default is com.tencent.tars 39 | - maven.artifact: maven artifactId, default is test-server 40 | - maven.name: maven Name, default is TestServer 41 | - packagename: package name, default is com.tencent.tars.server 42 | - jdk.version: jdk version, default is 1.8 43 | - type: provide server and client options, default is server 44 | 45 | After the command is executed, relevant information will be displayed. When 'Generating Complete!' appears, it means the generation is successful. 46 | 47 | ![tarsjavastart-info](images/tarsjavastart-info.png) 48 | 49 | 50 | 51 | ### Development and publishing 52 | 53 | For server and client development, please refer to Tars-Spring-Boot Service Development in [Tars Service Tutorials](https://github.com/TarsCloud/TarsDocs_en/blob/master/dev/tarsjava/tars-tutorials.md). For publishing, please refer to the publishing process in [Quick Start To Tars](https://github.com/TarsCloud/TarsDocs_en/blob/master/dev/tarsjava/tars-quick-start.md). 54 | 55 | -------------------------------------------------------------------------------- /dev/tarsjava/tarsspring-shi-yong-shuo-ming.md: -------------------------------------------------------------------------------- 1 | # Tars-Spring introduction 2 | 3 | ## Functional description 4 | 5 | Tars supports the use of Spring to configure servant, which needs to depend on the tars-spring.jar package, as well as the spring 4 and above. You can use your servant as a Spring bean, and you can use the function of Spring freely. Finally, you only need to tell Tars which bean is servant through the label provided by the Tars. 6 | 7 | ## Dependency configuration 8 | 9 | Using this function requires adding a dependency jar package and adding the following configuration in pom.xml: 10 | 11 | ```xml 12 | 13 | com.tencent.tars 14 | tars-spring 15 | 1.6.1 16 | 17 | ``` 18 | 19 | ## Service exposure configuration 20 | 21 | Using the spring configuration mode, you need to change the tars original configuration file servants.xml to servants-spring.xml under the resources directory.If all two configuration files exist, the spring mode will not be enabled if the servant.xml will be read first. 22 | 23 | ### Servant configuration 24 | 25 | In the Spring mode, servants-spring.xml is spring configuration file. The Tars's XSD file needs to be introduced first in the configuration file as follow: 26 | 27 | ```xml 28 | 29 | 35 | 36 | ``` 37 | 38 | Multiple spring tags are defined in Tars. When configuring servant, you need to define servant as a bean, and then define it as servant by the Tars tag. 39 | 40 | ```xml 41 | 42 | 43 | ``` 44 | 45 | The servant tag specifies the name of the servant through the name. Ref specifies the corresponding bean name, and interface specifies the corresponding interface name. Of course, you can also get bean by adding a @Component tag and then bean is obtained by spring automatic scanning, as well as configuring a corresponding bean name: 46 | 47 | ```xml 48 | 49 | 50 | ``` 51 | 52 | ### Listener configuration 53 | 54 | The configuration of listener is the same as that of the servant configuration, and you need to define your Listener as bean, and then the corresponding bean is specified as Listener through the Tars tag. 55 | 56 | ```xml 57 | 58 | 59 | ``` 60 | ## 1.3.0 Version update Guide 61 | 62 | If you need new functions like tars-spring, you need to upgrade the tars to the 1.3.0 version and the above version. As the change is relatively large, the version update guide is as follows: 63 | 1. The management platform needs to be recompiled and upgraded. 64 | 2. Tars-node needs to be upgraded to a new version. 65 | 3. Modifying the classpath configuration item of the tars.tarsjava.default template in the template management to the following code: 66 | > classpath=${basepath}/conf:${basepath}/WEB-INF/classes:${basepath}/WEB-INF/lib 67 | 4. When building a tars-java project, servants.xml needs to be placed under the resources directory. 68 | -------------------------------------------------------------------------------- /dev/tarsphp/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsphp/.DS_Store -------------------------------------------------------------------------------- /dev/tarsphp/Advanced/swoft.md: -------------------------------------------------------------------------------- 1 | 2 | # Introduction 3 | swoft in tars 4 | * Support Packing code 5 | * Support tars register 6 | 7 | # Related 8 | 9 | * SwoftInTars (https://github.com/dpp2009/swoftInTars) 10 | * SWOFT (https://github.com/swoft-cloud/swoft)   11 | * TARSPHP (https://github.com/TarsPHP) 12 | * TARSPHP DOCKER (https://github.com/tangramor/docker-tars) 13 | 14 | 15 | # Use 16 | 17 | * Clone (https://github.com/dpp2009/swoftInTars) 18 | * Install `composer install` 19 | * Packing `composer run-script deploy` 20 | * Upload tars tgz to tars web 21 | 22 | # Configuration description 23 | 24 | * server name write correct in ./tars/tars.proto.php (appName&serverName) & ./src/.env (PNAME) 25 | * swoft's prot do not use tarsweb's port 26 | 27 | 28 | # resta 29 | * use docker-tars,pcre may not open。run php --ri swoole,check pcre => enabled。(If pcre not open,run yum install pcre-devel,rebuild swoole) 30 | -------------------------------------------------------------------------------- /dev/tarsphp/Advanced/thinkphp.md: -------------------------------------------------------------------------------- 1 | 2 | # Introduction 3 | thinkphp in tars 4 | * Support Packing code 5 | * Support tars register 6 | 7 | # Related 8 | 9 | * thinkphpInTars (https://github.com/dpp2009/thinkphpInTars) 10 | * think-swoole (https://github.com/top-think/think-swoole)   11 | * TARSPHP (https://github.com/TarsPHP) 12 | 13 | 14 | # Use 15 | 16 | * Clone (https://github.com/dpp2009/thinkphpInTars) 17 | * Install `composer install` 18 | * Packing `composer run-script deploy` 19 | * Upload tars tgz to tars web 20 | 21 | # Configuration description 22 | 23 | * server name write correct in ./tars/tars.proto.php 24 | * Do not use tarsweb's port ,follow thinkphp's way 25 | -------------------------------------------------------------------------------- /dev/tarsphp/Environment/docker.md: -------------------------------------------------------------------------------- 1 | # Quickly install and run docker-tars 2 | 3 | run commends following: 4 | 5 | ``` 6 | mkdir -p /data/tars/mysql_data 7 | mkdir -p /data/tars/tars_data 8 | docker run --name mysql -e MYSQL_ROOT_PASSWORD=(your DB password) -d -p 3306:3306 -v /data/tars/mysql_data:/var/lib/mysql mysql:5.6 --innodb_use_native_aio=0 9 | docker run -d -it --name tars --link mysql --env MOUNT_DATA=false --env DBIP=mysql --env DBPort=3306 --env DBUser=root --env DBPassword=(DB password) -p 3000:3000 -v /data/tars/tars_data:/data tarscloud/tars:php 10 | ``` 11 | 12 | * Refer to tars-docker: https://github.com/tangramor/docker-tars. 13 | * Run mysql container and then run tars container. 14 | -------------------------------------------------------------------------------- /dev/tarsphp/Environment/php.md: -------------------------------------------------------------------------------- 1 | ## Install dependency environment of tarsphp 2 | php7 + swoole2+ is recommended. 3 | 4 | ## Install php 5 | Project: https://github.com/php/php-src 6 | 7 | ## Install swoole 8 | Project: https://github.com/swoole/swoole-src 9 | Install via compile: https://wiki.swoole.com/wiki/page/6.html 10 | Install via PECL: 11 | pecl install swoole 12 | 13 | ## Install tarsphp extension 14 | Project: https://github.com/TarsPHP/tars-extension 15 | 16 | Download & Unzip: https://github.com/TarsPHP/tars-extension/archive/master.zip 17 | cd tars-extension 18 | sudo phpize 19 | sudo ./configure 20 | sudo make 21 | sudo make install 22 | add extension = phptars.so in php.ini 23 | 24 | ## TarsPHP Development 25 | ### [Quick run tars-http-server] (../ QuickStart / tars-http-server.md) 26 | 27 | ### Development and packaging 28 | The steps of development is same with a litter different between each languages: 29 | 1. Write tars file xx.tars; 30 | 2. Generate client or server code based on xx.tars by tars conversion tool (statement client or server in configuration, pay attention to the naming convention); 31 | 3. develope the logic code (fill in the blanks); 32 | 4. Package; 33 | 5. Add application information (consistent with the definition of tars) , then upload and publish the package publish through the web management interface. 34 | 6. Package will upload to `/data/tars/patchs/tars.upload/` 35 | 36 | ### Publish 37 | Code will be published while packaging, and also can be restarted or closed through operation platform. 38 | 39 | Package will be uploaded to `/usr/local/app/tars/tarsnode/` in server -- application name + service name, service name PHPTest, service name PHPHttpServer will unzip the code and place it in PHPTest.PHPHttpServer. 40 | 41 | Bin, conf, and data folders are placed in each package directory. 42 | -bin: the decompressed program files, and start command file -- tars_start.sh -- and close command file -- tars_stop.sh -- which automatically generates by tars.(you can start/stop service by these two files instead of operation platform). 43 | -conf: the service template configuration, the complete configuration used by service will integrate this file and the configuration which filled in operation platform while publishing. 44 | -data: the cache file of the service information, and the process id file etc. 45 | 46 | ### Log View 47 | 48 | Log path is `/usr/local/app/tars/app_log/`, such as `/usr/local/app/tars/app_log/PHPTest/PHPHttpServer/PHPTest.PHPHttpServer.log` 49 | 50 | Log path of the service is `/usr/local/app/tars/app_log/{service application name}/{service service name}/`, for example, `/usr/local/app/tars/app_log/Test/HelloServer/` 51 | 52 | Path pf service executable is `/usr/local/app/tars/tarsnode/data/{service application name}.{service service name}/bin/`, for example: `/usr/local/app/tars/tarsnode/data/Test.HelloServer/bin/` 53 | 54 | Path of service template configuration file is `/usr/local/app/tars/tarsnode/data/{service application name}.{service service name}/conf/`, for example: `/usr/local/app/tars/tarsnode/data/Test.HelloServer/conf/` 55 | 56 | Path of service cache information file is `/usr/local/app/tars/tarsnode/data/{service application name}.{service service name}/data/`, for example: `/usr/local/app/tars/tarsnode/data/Test.HelloServer/data/` -------------------------------------------------------------------------------- /dev/tarsphp/Framework/introduce.md: -------------------------------------------------------------------------------- 1 | # TARSPHP Framework module 2 | 3 | ## tars-client 4 | 5 | **Tars-client** provides PHP capabilities for calling the tars service, including: 6 | 7 | * Invoke the remote service instance 8 | * Stat monitor report 9 | * Automatic routing module 10 | 11 | [Detailed description](./tars-client.md) 12 | 13 | ## tars-server 14 | 15 | **Tars-server** provides the underlying server framework and supports the following features: 16 | 17 | - High performance service based on swoole1.x/2.x 18 | - Support two protocol modes: tup protocol and tars stream protocol 19 | - Support three kind servers: http, tcp and timer 20 | - Integration of reporting, monitoring and logging 21 | - Tars platform release support 22 | 23 | [Detailed description](./tars-server.md) 24 | 25 | ## tars-config 26 | 27 | Ability module to pull configuration files from the tars platform's configuration service. 28 | 29 | [Detailed description](./tars-config.md) 30 | 31 | ## tars-deploy 32 | 33 | Module of packaging **tars-server** business code. 34 | 35 | [Detailed description](./tars-deploy.md) 36 | 37 | ## tars-extension 38 | 39 | Tars underlying php extension code. 40 | 41 | [Detailed description](./tars-extension.md) 42 | 43 | ## tars-log 44 | 45 | Module for remote log writing 46 | 47 | [Detailed description](./tars-log.md) 48 | 49 | ## tars-monitor 50 | 51 | Function modules for stat monitor report and feature monitor report. 52 | 53 | [Detailed description](./tars-monitor.md) 54 | 55 | ## tars-registry 56 | 57 | Function module for automatic routing. 58 | 59 | [Detailed description](./tars-registry.md) 60 | 61 | ## tars-report 62 | 63 | Keepalive reporting module 64 | 65 | [Detailed description](./tars-report.md) 66 | 67 | ## tars-utils 68 | 69 | Module for parsing configuration files. 70 | 71 | [Detailed description](./tars-utils.md) 72 | 73 | ## tars2php 74 | 75 | Automatic code generation tool, can automatically generate server and client code. 76 | 77 | [Detailed description](./tars2php.md) -------------------------------------------------------------------------------- /dev/tarsphp/Framework/tars-client.md: -------------------------------------------------------------------------------- 1 | # tars-client document 2 | 3 | ## Introduction 4 | 5 | **Tars-client** is the client that PHP calls tars service. Mainly include the master control routing network transceiver capability and reporting capability. 6 | 7 | The **tests** directory provides a test case for the tars service named **App.Server.Servant** 8 | 9 | ## Instruction 10 | 11 | Refer to the test cases provided. 12 | 13 | `Tars-client` side calls the tars service. When instantiating, it needs to pass in the instance of **\Tars\client\CommunicatorConfig** and set the necessary configuration information. Mainly contains the following 14 | 15 | - Service address 16 | - Automatic routing 17 | - When there are multiple machines providing services, the service can be discovered through the master automatic routing method 18 | - Designated service address 19 | - This method is used for grayscale or when you need to obtain services from a specific address 20 | - Network transmission 21 | - Contains three modes: socket, swoole sync, swoole coroutine 22 | - Report service name 23 | - Specify the name of the report module. The main control addressing is **tarsproxy** by default, which can be filled in according to the business when specifying the service address 24 | - Encoding format 25 | 26 | ### Service address 27 | 28 | Combine test case `testServant.php` to introduce code specifications for different service addressing. 29 | 30 | Set related configuration through **\Tars\client\CommunicatorConfig** class. Test case gives sample code for two addressing modes. 31 | 32 | 1. Master routing 33 | 34 | Once the locator is specified, tars can automatically grab the service address based on the service name. The format of the locator configuration is as follows 35 | 36 | ```php 37 | $config = new \Tars\client\CommunicatorConfig(); 38 | $config->setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"); 39 | ``` 40 | 41 | The tars route master is also a tars service, the service name is **tars.tarsregistry.QueryObj**, the transmission protocol is **tcp**, the service address is **172.16.0.161**, and the port is **17890**. In actual development, please **fill in according to the actual situation of the service** 42 | 43 | After the above-mentioned main control service is determined, the reported module name and encoding format may be specified as required. The default reporting module name is **tarsproxy**. In order to facilitate business tracking, it is recommended to specify the reporting module name again. 44 | 45 | ```php 46 | $config->setModuleName("App.Server"); 47 | $config->setCharsetName("UTF-8"); 48 | ``` 49 | 50 | 2. Specify IP 51 | 52 | Specify the server's address. This method needs to specify the IP and port of the service, the code is as follows 53 | 54 | ```php 55 | $route['sIp'] = "127.0.0.1"; 56 | $route['iPort'] = 8080; 57 | $routeInfo[] = $route; 58 | $config = new \Tars\client\CommunicatorConfig(); 59 | $config->setRouteInfo($routeInfo); 60 | ``` 61 | 62 | Other uses are the same as automatic routing. 63 | 64 | ### Network transmission mode 65 | 66 | 1. Socket synchronization mode 67 | 68 | Rely on the sockets extension to send and receive TCP and UDP packets. 69 | 70 | 2. Swoole synchronization mode 71 | 72 | Use `Swoole\Client` to send and receive TCP and UDP packets. 73 | 74 | 3. Swoole coroutine mode 75 | 76 | Use `Swoole\Couroutine\Client` to send and receive TCP and UDP packets. -------------------------------------------------------------------------------- /dev/tarsphp/Framework/tars-config.md: -------------------------------------------------------------------------------- 1 | # tars-config document 2 | 3 | ## Introduction 4 | 5 | **Tars-config** is used to obtain the configuration delivered from the tars management platform. The usual usage scenario is to obtain the business configuration, such as mysql, redis address, port and other information 6 | 7 | ## Instructions 8 | 9 | ```php 10 | setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"); //The tars master address is configured here 15 | $config->setModuleName("tedtest"); //The module name is used to display and report 16 | $config->setCharsetName("UTF-8"); 17 | 18 | $conigServant = new \Tars\config\ConfigServant($config); 19 | $result = $conigServant->loadConfig("PHPTest",'helloTars','hhh.txt',$configtext); //The parameters are appName (servant name first part), server name (servant name second part), file name, and the last one is a reference parameter, which is the output configuration file content. 20 | var_dump($configtext); 21 | 22 | $config->setSocketMode(2); //set socket model 1:socket, 2:swoole tcp client, 3:swoole coroutine client 23 | $conigServant = new \Tars\config\ConfigServant($config); 24 | $result = $conigServant->loadConfig("PHPTest",'helloTars','hhh.txt',$configtext); 25 | var_dump($configtext); 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /dev/tarsphp/Framework/tars-deploy.md: -------------------------------------------------------------------------------- 1 | # tars-deploy document 2 | 3 | ## Introduction 4 | 5 | **Tars-deploy** is used to package the project and facilitate the distribution of tool components on the tars management platform. 6 | 7 | ## Instructions 8 | 9 | 1. Dependence 10 | - Phar extension 11 | 2. Make sure the `./tars/tars.proto.php` file under the project exists and contains the following 12 | 13 | ```php 14 | return array( 15 | 'appName' => 'APPNAME', //app name. e.g tars of tars.tarsconfig 16 | 'serverName' => 'SERVERNAME', //server name. e.g tarsconfig of tars.tarsconfig 17 | //... 18 | ); 19 | ``` 20 | 21 | 3. Introduce **tars-deploy** to the project's composer.json 22 | 23 | 4. Add the following to the project composer.json 24 | 25 | ```json 26 | "scripts": { 27 | "deploy": "\\Tars\\deploy\\Deploy::run" 28 | } 29 | ``` 30 | 31 | 5. Execute the command `composer run-script deploy` in the project directory to generate a compressed package of the project to be uploaded 32 | -------------------------------------------------------------------------------- /dev/tarsphp/Framework/tars-log.md: -------------------------------------------------------------------------------- 1 | # tars-log document 2 | 3 | ## Introduction 4 | `tars-log` is a logging module for` phptars`, which is used to print log contents to local or remote logs 5 | 6 | ## Instructions 7 | 8 | ### Install 9 | Install with `composer` 10 | `composer install phptars/tars-log` 11 | 12 | ### Configuration 13 | 14 | It can be configured one by one, or it can be configured uniformly through the configuration file issued by the platform. 15 | - Configure a parameter individually 16 | ```php 17 | $config = new \Tars\client\CommunicatorConfig(); 18 | $config->setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"); 19 | $config->setModuleName("tedtest"); 20 | $config->setCharsetName("UTF-8"); 21 | $config->setLogLevel("INFO"); //`INFO`,`DEBUG`,`WARN`,`ERROR` default:INFO 22 | $config->setSocketMode(2); //socket mode: 1: socket, 2: swoole tcp client, 3: swoole coroutine tcp client 23 | ``` 24 | - Configuration file initialization 25 | ```php 26 | $config = new \Tars\client\CommunicatorConfig(); 27 | $sFilePath = '{project}/src/conf'; //Configuration file path 28 | $config->init($sFilePath); 29 | ``` 30 | 31 | ### Output log 32 | There are two ways to output logs. One is to directly call the logger of `LogServant` to output the remote log, and the other is to combine the monolog to output the remote log. 33 | 34 | - ` LogServant` 35 | 36 | ```php 37 | $logServant = new \Tars\log\LogServant($config); 38 | $appName = "App"; 39 | $serverName = "server"; 40 | $file = "test.log"; 41 | $format = "%Y%m%d"; 42 | $buffer = ["hahahahaha"]; 43 | $result = $logServant->logger($appName,$serverName,$file,$format,$buffer); 44 | ``` 45 | 46 | - `monolog` 47 | 48 | ```php 49 | $logger = new \Monolog\Logger("tars_logger"); 50 | //remote log 51 | $tarsHandler = new \Tars\log\handler\TarsHandler($config); 52 | //local log 53 | $streamHandler = new \Monolog\Handler\StreamHandler(ENVConf::$logPath . "/" . __CLASS__ . ".log"); 54 | 55 | $logger->pushHandler($tarsHandler); 56 | $logger->pushHandler($streamHandler); 57 | 58 | $array = [ 59 | "key1" => "value1", 60 | "key2" => "value2", 61 | "key3" => "value3" 62 | ]; 63 | $logger->debug("add a debug message", $array); 64 | $logger->info("add a info message", $array); 65 | $logger->notice("add a notice message", $array); 66 | $logger->warning("add a warning message", $array); 67 | $logger->error("add a error message", $array); 68 | $logger->critical("add a critical message", $array); 69 | $logger->emergency("add a emergency message", $array); 70 | ``` 71 | 72 | ### With ELK 73 | Remote logs are distinguished by application and service. They are located in `/usr/local/app/tars/remote_app_log/{App}/{ServerName}`. In actual business, you can synchronize remote logs to `filebeat` or` logstash`. ElasticSearch`. 74 | 75 | In addition, `monolog` itself provides ` ElasticSearchHandler`, which can easily output logs directly to `ElasticSearch`. 76 | 77 | The `ruflin/elastica` package needs to be introduced into composer before use. 78 | > Note: Until the update of this article, the release of `ruflin/elastica` only supports elasticsearch: 6. * version. If you want to use elasticsearch: 7. *, you can use the ` elasticsearch/elasticsearch` package to encapsulate the handler yourself 79 | 80 | The sample code: 81 | 82 | ```php 83 | $logger = new \Monolog\Logger("elk_logger"); 84 | $client = new \Elastica\Client([ 85 | 'host' => '127.0.0.1', 86 | 'port' => 9200 87 | ]); 88 | $elkHanlder = new Monolog\Handler\ElasticSearchHandler($client, [ 89 | 'index' => 'monolog_index_test', 90 | 'type' => 'record' 91 | ]); 92 | 93 | $logger->pushHandler($elkHanlder); 94 | 95 | $logger->error("this is a test msg from monolog"); 96 | ``` -------------------------------------------------------------------------------- /dev/tarsphp/Framework/tars-monitor.md: -------------------------------------------------------------------------------- 1 | # tars-monitor documentation 2 | 3 | ## Introduction 4 | `tars-monitor` is the ` phptars` service and feature monitoring report module 5 | 6 | It consists of two sub-modules: 7 | * Service monitoring 8 | * Feature monitoring 9 | 10 | ## Instructions 11 | 12 | ### Installation 13 | 14 | Install with composer 15 | `composer install phptars/tars-monitor` 16 | 17 | ### Usage 18 | 19 | #### Service monitoring report 20 | 21 | * locator is the reporting address, usually issued by the server 22 | * socketMode is set to 1 to report using socket mode 23 | socketMode is set to 2 to report using swoole tcp client (requires swoole support) 24 | socketMode is set to 3 to report using swoole tcp coroutine client coroutine method (requires support of swoole2.0 or above) 25 | 26 | #### Timely reporting (default) 27 | > The use of regular reporting requires swoole_table support. By calling addStat to temporarily store the reporting information, the task process of the tars-server will collect for a period of time (the reporting interval is issued by the server, generally 60s). 28 | 29 | ```php 30 | $locator = "tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"; 31 | $socketMode = 1; 32 | $statfWrapper = new \Tars\monitor\StatFWrapper($locator, $socketMode); 33 | $statfWrapper->addStat ("PHPTest.helloTars.obj", "test", "172.16.0.116", 51003,200,0,0); 34 | $statfWrapper->addStat ("PHPTest.helloTars.obj", "test", "172.16.0.116", 51003,200,0,0); 35 | $statfWrapper->addStat ("PHPTest.helloTars.obj", "test", "172.16.0.116", 51003,200,0,0); 36 | ``` 37 | 38 | Reported data can use multiple storage methods. The cache provides the implementation of `swoole_table` and ` redis`. Users can also implement `contract/StoreCacheInterface` by themselves. For the configuration storage method, please refer to [examples](https://github.com/TarsPHP/TarsPHP/tree/master/examples) `tars-http-server` configuration for` src / services.php`. 39 | 40 | ```php 41 | return array ( 42 | 'namespaceName' => 'HttpServer \\', 43 | 'monitorStoreConf' => [ 44 | 'className' => Tars \ monitor \ cache \ SwooleTableStoreCache :: class, 45 | 'config' => [] 46 | ] 47 | ); 48 | ``` 49 | 50 | `monitorStoreConf` is the configuration of the storage method, ` className` is the implementation class, and `config` is the corresponding configuration. For example, when using the redis storage method, you need to configure the redis host, port, and key prefix in the config. 51 | When `monitorStoreConf` is not configured, ` SwooleTableStoreCache` is used for storage by default. 52 | 53 | 54 | #### Single report 55 | > At the same time, `tars-monitor` also provides a single report interface` monitorStat`, that is, each tars request call will be reported once. 56 | 57 | ```php 58 | $locator = "tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"; 59 | $socketMode = 1; 60 | $statfWrapper = new \Tars\monitor\StatFWrapper($locator,$socketMode); 61 | $statfWrapper->monitorStat("PHPTest.helloTars.obj","test","172.16.0.116",51003,200,0,0); 62 | ``` 63 | 64 | 65 | 66 | #### Feature monitoring 67 | 68 | Parameters are similar to service monitoring 69 | 70 | ```php 71 | $statfWrapper = new \Tars\monitor\PropertyFWrapper("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890",1); 72 | $statfWrapper->monitorProperty("127.0.0.1","userdefined",'Sum',2); 73 | $statfWrapper->monitorProperty("127.0.0.1","userdefined",'Count',2); 74 | $statfWrapper->monitorProperty("127.0.0.1","userdefined",'Count',1); 75 | ``` 76 | 77 | 78 | 79 | ### Monitor View 80 | After the data is reported, the user can view the reported data in the Service Monitoring / Feature Monitoring tab. 81 | 82 | ## Other 83 | Because other modules have integrated this module, __so in general, the service script does not need to use this module explicitly. __ -------------------------------------------------------------------------------- /dev/tarsphp/Framework/tars-registry.md: -------------------------------------------------------------------------------- 1 | # tars-registry documentation 2 | 3 | ## Introduction 4 | The tarsregistry service of the tars platform provides a service discovery function. 5 | This module provides the main control addressing capability (service discovery) for php. 6 | 7 | ## Instructions 8 | 9 | ```php 10 | //find server address from tarsregistry 11 | $wrapper = new \Tars\registry\QueryFWrapper("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890",1,60000); 12 | $result = $wrapper->findObjectById("PHPTest.PHPServer.obj"); 13 | var_dump($result); 14 | 15 | //find server address from memory firstly. find from registry then. 16 | \Tars\registry\RouteTable::getInstance(); 17 | $result = \Tars\registry\RouteTable::getRouteInfo("PHPTest.PHPServer.obj"); 18 | echo "result:\n"; 19 | var_dump($result); 20 | ``` 21 | 22 | ## Other 23 | 24 | Because other modules have integrated this module, __so in general, the service script does not need to use this module explicitly. __ 25 | -------------------------------------------------------------------------------- /dev/tarsphp/Framework/tars-report.md: -------------------------------------------------------------------------------- 1 | # tars-report documentation 2 | 3 | ## Introduction 4 | `tars-report` is the ` phptars` heartbeat report (keep alive) module 5 | The tarsphp framework will report the service alive status when the master process starts (main process alive & management process alive). 6 | When the first worker process is started, a timer will be started to periodically report the survival status. 7 | 8 | ## Instructions 9 | 10 | ```php 11 | $serverInfo = new ServerInfo(); 12 | $serverInfo->adapter = 'PHPTest.test.objAdapter'; 13 | $serverInfo->application = 'PHPTest'; 14 | $serverInfo->serverName = 'test'; 15 | $serverInfo->pid = $masterPid; 16 | 17 | $serverF = new ServerFSync($host, $port, $objName); 18 | $serverF->keepAlive($serverInfo); //main server keeps alive 19 | 20 | $adminServerInfo = new ServerInfo(); 21 | $adminServerInfo->adapter = 'AdminAdapter'; 22 | $adminServerInfo->application = 'PHPTest'; 23 | $adminServerInfo->serverName = 'test'; 24 | $adminServerInfo->pid = $masterPid; 25 | $serverF->keepAlive($adminServerInfo);//admin server keeps alive 26 | ``` 27 | 28 | ## Other 29 | 30 | Because other modules have integrated this module, __so in general, the service script does not need to use this module explicitly. __ 31 | 32 | -------------------------------------------------------------------------------- /dev/tarsphp/Framework/tars-utils.md: -------------------------------------------------------------------------------- 1 | # tars-utils documentation 2 | 3 | ## Introduction 4 | `tars-utils` is an auxiliary library for phptars, which mainly provides the following functions: 5 | * Configuration file analysis and cache (swoole table) 6 | * Master address resolution 7 | * Node report configuration analysis 8 | 9 | ## Instructions 10 | ### Configuration file parsing 11 | 12 | Take [QDPHP.TARSServer.config.conf]() as an example, parse the `conf` file into an array 13 | 14 | ### Geocoding 15 | ```php 16 | $locatorString = "tars.tarsregistry.QueryObj@tcp -h 127.0.0.1 -p 17890:tcp -h 127.0.0.1 -p 17890"; 17 | 18 | $locatorInfo = \Tars\Utils::getLocatorInfo($locatorString); 19 | ``` 20 | The results are as follows: 21 | ```php 22 | [ 23 | 'locatorName' => 'tars.tarsregistry.QueryObj', 24 | 'routeInfo' => [ 25 | [ 26 | 'sHost' => '127.0.0.1', 27 | 'sProtocol' => 'tcp', 28 | 'iPort' => 17890, 29 | 'iTimeout' => '', 30 | 'bIp' => '', 31 | 'sIp' => '' 32 | ], 33 | [ 34 | 'sHost' => '127.0.0.1', 35 | 'sProtocol' => 'tcp', 36 | 'iPort' => 17890, 37 | 'iTimeout' => '', 38 | 'bIp' => '', 39 | 'sIp' => '' 40 | ] 41 | ] 42 | ] 43 | ``` 44 | 45 | ### Node report configuration analysis 46 | ```php 47 | $locatorString = "tars.tarsnode.ServerObj@tcp -h 127.0.0.1 -p 2345 -t 10000"; 48 | 49 | $nodeInfo = \Tars\Utils::parseNodeInfo($locatorString); 50 | ``` 51 | 52 | The results are as follows: 53 | ```php 54 | [ 55 | 'objName' => 'tars.tarsnode.ServerObj', 56 | 'mode' => 'tcp', 57 | 'host' => '127.0.0.1', 58 | 'port' => 2345, 59 | 'timeout' => 1, 60 | 'sIp' => '', 61 | 'iPort' => 2345 62 | ] 63 | ``` -------------------------------------------------------------------------------- /dev/tarsphp/Question/changelog.md: -------------------------------------------------------------------------------- 1 | # changelog 2 | -------------------------------------------------------------------------------- /dev/tarsphp/Question/debug.md: -------------------------------------------------------------------------------- 1 | # How to debug? 2 | It is currently recommended to debug via var_dump function. The var_dump will output to the service log. Please refer to the logging section in php scaffolding. 3 | -------------------------------------------------------------------------------- /dev/tarsphp/Question/index.md: -------------------------------------------------------------------------------- 1 | # Frequently Asked Questions 2 | 3 | ## Does this framework have to be bundled with swoole? 4 | Tars-server must be bundled with swoole. But if you only use the tars-client, you won't need to. 5 | 6 | ## What is the difference between the client and server? 7 | They have different responsibilities and different project structures. Client is just a caller, server is a service provider. 8 | 9 | ## Is it possible to use only tars-php as a client without swoole? 10 | Yes, you can. Only tars-server is bundled with swoole and tars-client is not restricted. 11 | 12 | ## Must monitoring data be stored in the swoole_table? 13 | Users can implement the `Tars\monitor\contract\StoreCacheInterface` to implement other storage methods, as shown in [the sample code](!https://github.com/TarsPHP/TarsPHP/tree/master/examples/tars-http-server). 14 | 15 | ## Error when generating code automatically 16 | Some users executed the command `php ../src/vendor/phptars/tars2php/src/rc/tars2php.php ./t ./ ./tars.proto.php` incorrectly: 17 | >mkdir: cannot create directory ‘../src/servant/Common’: No such file or directory 18 | 19 | This is a directory permission issue. You can manually create *../src/servant*, or modify directory permissions. 20 | 21 | ## Where is the manual startup script? 22 | In the *./bin* directory under the service root. 23 | 24 | ## After the manual script was executed, the setting state was not active. 25 | Please try to restart the service on the platform to avoid manual script restart. For users that want to automate the release flow, you can restart the service by calling the http restart api. 26 | 27 | ## How to deploy multiple registries? 28 | Deploy the two registers and the conf file will be automatically updated after the business service is restarted. 29 | 30 | ## When deploying TarsPHP on multiple machines, is the installation of the second machine exactly the same as the first, or does the second machine require only partial service installation? 31 | On the second machine, you only need to install the core base service and tarsnode, while others, such as mysql, do not need to be installed. 32 | 33 | ## Error when downloading composer packages 34 | ``` 35 | composer require phptars/tars-server 36 | ``` 37 | Some users have encountered the above command execution failure. For this problem, first make sure that the local composer is ok. Then judge the specific reason according to the message of failure. The problem once occurred was that the domestic source was not synchronized, resulting in inconsistent versions. After switching sources, the problem was solved. 38 | 39 | ## The configuration center sends tcp requests to the service. How to use it in the http server? 40 | The push of the configuration center is not available for the http server. For the http server, you can specify the configuration file, which will be pulled when starting or stopping. 41 | 42 | ## Is the tarslog compatiable with ELK? 43 | The tarslog component can implement log output to elk by adding ElasticSearchHandler, with an interface reserved. 44 | 45 | ## The tars runs in the windows, publishing service failed. 46 | If you encountered the problem like `pid is not digit`,it is because the method of fetching pid in the windows is difference with it in the linux,and the startup script needs to be modified with powershell to be compatible, For example: 47 | `ps -eopid,cmd | grep "$bin"| grep "tarsnode" | grep -v "grep"|grep -v "sh" |awk '{print $1}'` 48 | 49 | ## Does the dispatch_mode have to be 2 in the configuration file? 50 | The dispatch mode 2 means that the data sent by a request will only be processed by one worker. This configuration can be adjusted as needed, as detailed in [the swoole documentation](!https://wiki.swoole.com/wiki/page/277.html). 51 | 52 | ## Missing tars extension 53 | Problems like the following are caused by not installing the tars extension. Please refer to php environment setup for installation. 54 | >PHP Fatal error: Class 'TARS_Struct' not found in /usr/local/app/tars/tarsnode/data/PHPTest.PHPServer/bin/src/vendor/phptars/tars-report/src/ServerInfo.php on line 5 55 | 56 | >Fatal error: Uncaught Error: Class 'TUPAPI' not found in D:\www\tars-client\tests\vendor\phptars\tars-registry\src\client\TUPAPIWrapperRegistry.php:369 57 | -------------------------------------------------------------------------------- /dev/tarsphp/Question/outsource.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarsCloud/TarsDocs_en/dca76035c6bd3d581a229317db6a478e59bdeac9/dev/tarsphp/Question/outsource.md -------------------------------------------------------------------------------- /dev/tarsphp/QuickStart/introduce.md: -------------------------------------------------------------------------------- 1 | # Quick Start 2 | 3 | If you want to experience tars-server quickly, please enter the examples directory, which contains detailed deployment and development guides for multiple services 4 | * [Build HttpServer](./tars-http-server.md) 5 | * [Build TimerServer](./tars-timer-server.md) 6 | * [Build TcpServer](./tars-tcp-server.md) 7 | * [Build WebSocket Server](./tars-websocket-server.md) 8 | * [An domo code of an bullet activity](./tars-act-demo.md) 9 | -------------------------------------------------------------------------------- /dev/tarsphp/QuickStart/tars-act-demo.md: -------------------------------------------------------------------------------- 1 | # What is this 2 | 3 | This is a bullet activity project deployed with Tars, which contains 3 services. 4 | Covers Http, Tcp services, uses Mysql, Redis storage, including user login, session verification, user information acquisition, bullet creation, bullet acquisition and other functions. Many aspects of normal business development have been covered. 5 | 6 | QD.ActHttpServer.obj is an http service that provides a fixed port to the outside. This is a business service. It calls the back-end User and Comment services to complete the business. 7 | QD.ActCommentServer.CommentObj is a tcp service, which mainly provides the writing and obtaining of comments and is stored in Redis. 8 | QD.UserService.UserObj is a TCP, which mainly provides user information acquisition, user login, and user session verification. Relevant data is saved in Mysql. 9 | 10 | index.html is a front-end page that connects to the http service to achieve a barrage display. 11 | act.tars.local.conf is the nginx configuration 12 | user_info.sql is the user information table for QD.UserServer service 13 | 14 | 15 | # How to deploy 16 | 17 | 1. Need to create the db configuration on the tars platform. On the tars platform, find QD.UserService and click on service configuration, add configuration, file name db.json, content: 18 | 19 | ~~~json 20 | [ 21 | { 22 | "host": "mysql.tarsActDemo.local", //This is your mysql address 23 | "port": 3306, 24 | "username": "root", 25 | "password": "password", 26 | "db": "tars_test", 27 | "charset": "utf-8", 28 | "instanceName": "default" 29 | } 30 | ] 31 | ~~~ 32 | 33 | 2. Import user_info.sql into your mysql. 34 | 35 | 3. Modify the redis configuration in src/ENVConf.php in QD.ActCommentServer and set your own redis ip and port 36 | 37 | 4. In turn cd to the src directory of each service, execute composer install, and install composer dependencies 38 | 39 | 5. In turn cd to the src directory of each service and execute composer run-script deploy to package the code 40 | 41 | 6. Deploy three services, QD.ActHttpServer is an http service, you need to fix a port, choose non-tars service, the other two are tcp services, the port is arbitrary, choose tars service. 42 | (Note that the ServantName configured on the platform during deployment must be the same as the full name I wrote above. If you need to modify it, please modify tars.proto.php, actComment.proto.php and userInfo.proto.php and generate a new protocol (Medium code) 43 | 7. Configure your nginx and proxy_pass to the IP address and port of your QD.ActHttpServer service 44 | 45 | 8. Copy index.html to your /data/website/tarsact/ 46 | 47 | 9. Open act.tars.local to see if it is accessible 48 | 49 | 10. Enter a username yong password 123456 and perform the following login 50 | 51 | 11. Try a barrage 52 | 53 | 12. Refresh, has the barrage you sent out? Congratulations O(∩_∩)O 54 | 55 | 56 | # Multiple servant support 57 | 1. Tars-server 0.3 or higher supports multiple servants, which can achieve mixed deployment of tars and http protocols 58 | 2. The QD.UserService service has implemented an example of mixed deployment of tars and http protocols. According to the instructions above, you can deploy the tars protocol first. 59 | 3. Find the QD.UserService service in the management interface, click Manage servant, and click Add. 60 | 4. obj name HttpObj, arbitrary number of threads, binding address tcp -h {your ip} -t 60000 -p {http service port} -e 0 Select non-tars 61 | 5. Restart the service after saving, try to visit http://{your ip}:{http service port}/user/index to return hello word 62 | 6. Can access Try to access http://{your ip}:{http service port}/user/ getUsersInfoByIds?ids=8001, Test your service logic 63 | 7. Usually the tars protocol is provided for business calls, and the http protocol is used for testing. The business logic is recommended to be encapsulated into the service layer uniformly, with http and tars as two entrances 64 | 65 | # Other 66 | 67 | 1. There is no logout function, if you need to logout, you can clear the cookie 68 | 2. The page is a bit ugly 69 | 3. tars file in the tars directory of each service -------------------------------------------------------------------------------- /dev/tarsphp/QuickStart/tars-timer-server.md: -------------------------------------------------------------------------------- 1 | # TARS-TIMER-SERVER Description 2 | 3 | ## Service Deployment Guideline 4 | 5 | 1. Enter Operations Management => Template Management 6 | 7 | The platform will provide a new template for PHP, named tars.tarsphp.default, !!!!!!! You must first modify the PHP execution path !!!!!!! 8 |   9 | Template related modifications: 10 |      a. Create a new tars.tarsphp.timer service template, compared to tars.tarsphp.default and add an isTimer = 1. The PHP service selects the tars.tarsphp.timer template. 11 |      b. Or use the tars.tarsphp.default template and add the following to the private template under the editing service: 12 | 13 | ```xml 14 | 15 | 16 | 17 | isTimer=1 18 | 19 | 20 | 21 | ``` 22 | 23 | 24 | 2. Enter Operations Management => Deployment Services on the platform, fill in the corresponding application name and service name, note: that this is the same as tars.proto.php in the tars folder below 25 | Need to be completely consistent. 26 | 27 | 3. Select the service type as tars_php 28 | 29 | 4. Select the template as the timer service template just created, set is not enabled by default 30 | 31 | 5. Select an available port and fill in the server's intranet IP 32 | 33 | 6. The port type is TCP 34 | !!!! Protocol type TIMER service must choose non-TARS !!!!!! 35 | 36 | 7. The number of threads corresponds to the number of SWOOLE processes, that is, the number of timer services that can be started under the timer directory 37 | 38 | 8. The maximum number of connections, the maximum queue length, and the queue timeout period are not effective for the PHP service. 39 | 40 | 9. Click Add and Submit, then please enter the development guidline 41 | 42 | ## Develop Guidline 43 | 44 | 1. Example of a scheduled task: 45 | ./src/timer/TenSecondsTimer.php 46 | 47 | ```php 48 | interval = 10000; //Unit is millisecond 55 | } 56 | public function execute() { 57 | // Your business code 58 | } 59 | } 60 | ``` 61 | 62 | 2. Create a new tars.proto.php file under the tars folder, which needs to include a description of your service itself: 63 | ```php 64 | 'PHPTest', 67 | 'serverName' => 'PHPTimerServer', 68 | 'objName' => 'obj', 69 | ); 70 | ``` 71 | This name must correspond exactly to the name on the tars platform. 72 | 73 | 3. Attention !!!! 74 |    Each php file in the timer directory is bound to a worker process, so the number of workers must be not less than the number of timer tasks. 75 |    You can modify the number of threads in the tars management platform Servant management (for php, it is the number of swoole workers). -------------------------------------------------------------------------------- /dev/tarsphp/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | TARS is a name based high-performance RPC framework using the TARS binary protocol. TARS achieved semi-autonomous operation by providing an operation platform which integrated service scheduling and monitoring. 4 | 5 | Main benefits of TARS: 6 | 7 | * Languages agnostic: C++ / JAVA / PHP / NodeJS / Go / Python etc. 8 | 9 | * High availability: provides service discovery, disaster tolerance, fault tolerance and intelligent scheduling. 10 | 11 | * Agile development: provides automated code generation,fast service build and continuous integration tools. 12 | 13 | * Highly efficient operation: support business non-destructive iteration,visual service management and multi-dimensional monitoring with TARS operation platform. 14 | 15 | TARS is one of Linux Open Source Foundation project now after years of iteration inside Tencent, and will continues to advance in the industry. 16 | 17 | Used By: 18 | * china literature 19 | * iFLYTEK 20 | * DTmobile 21 | * huya.com 22 | * qimingxinxi 23 | * sinotrans 24 | * essence securities 25 | * water resources department of Guangdong province 26 | * longtugame 27 | * 51zhaoyou 28 | * reintion 29 | * limixuexi 30 | and more 31 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/README.md: -------------------------------------------------------------------------------- 1 | # TarsPHP 2 | 3 | TARSPHP作为TARS在PHP语言的解决方案, 设计的时候主要考虑如下三个方面: 4 | 5 | * 功能完善: 对标现有C++、JAVA、NodeJS体系功能 6 | * 灵活: 论灵活, 谁与PHP争锋? 7 | * 轻量: 用最轻量的设计, 点到即止, 即插即用 8 | * 高效: 插上SWOOLE协程的翅膀, 不得不飞 9 | 10 | ## 功能完善 11 | 12 | TARSPHP主要实现了如下功能模块: 13 | 14 | * TARS-CLIENT 15 | * TARS-SERVER 16 | * TARS-EXT扩展 17 | * TARS2PHP工具 18 | 19 | 从宏观上来讲, 使用TARSPHP你可以做这些事: 20 | 21 | * 启动一个HTTP服务, QPS达到万级 22 | * 启动一个二进制协议的TCP服务, QPS达到十几万级 23 | * 启动一个定时服务, 其中可以统一管理一定数量的定时服务\(与worker数量相等\) 24 | * 启动一个Websocket服务, 与浏览器进行ws协议的交互 25 | * 调用其他支持TARS协议的服务\(不限语言\) 26 | 27 | 从细分模块上来讲, 你可以: 28 | 29 | * 向TARS的本地和远程目录写日志 30 | * 向TARS监控上报调用监控以获得图表展示 31 | * 将TARS服务打包发布 32 | * 拉取TARS平台的配置 33 | * 拉取其他服务的地址 34 | * 解析TARS平台的配置文件 35 | 36 | ## 灵活 37 | 38 | 从灵活性上来讲, TARSPHP做了很多优化。 以TARS-CLIENT为例, 它的使用者既可以是后台系统, 比如Laravel。 也可以是SWOOLE同步的客户端, 更可以是SWOOLE协程的客户端。 这三种情况, 兼顾了不同的应用场景, 使用者是需要按需配置即可。 39 | 40 | 除此之外, TARS-LOG模块, 既支持本地的日志, 也支持远程的日志, 使用者也可以灵活的选择。 41 | 42 | ## 轻量 43 | 44 | 为了最大程度的提高性能, 并支持其他现有成熟框架的扩展, 我们并没有实现非常繁重的框架逻辑。而只是给出了实现的guideline, 让开发者可以自行根据自己的情况进行定制。 45 | 46 | 比如现有社区中, 基于TARSPHP, 已有如下扩展的案例: 47 | 48 | * [与Kong结合](https://tangramor.gitlab.io/tars-docker-guide/3.TARS-PHP-HTTP服务端与客户端开发/) 49 | * [与ThinkPHP结合](yu-thinkphp-jie-he-shi-yong.md) 50 | * [与SWOFT结合](yu-swoft-jie-he-shi-yong.md) 51 | * [与Laravel结合](yu-laravel-jie-he-shi-yong.md) 52 | * [与Yii2结合](yu-yii2-jie-he-shi-yong.md) 53 | 54 | 后续我们也会尝试接入更多的框架, 从而更好的服务开发者。 55 | 56 | ## 高效 57 | 58 | 在性能方面, TARSPHP也一直在追求极致: 59 | 60 | * 使用SWOOLE作为服务容器 61 | * 使用PHP扩展进行二进制流的打包和解包 62 | * 对服务端的路由配置进行预热, 减少路由时间 63 | * 对寻址信息进行本地缓存, 降低耗时 64 | * 对日志写入、监控上报、服务保活上报进行异步化处理,绝不阻塞 65 | 66 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/shi-yong-shi-jian.md: -------------------------------------------------------------------------------- 1 | # 使用实践 2 | 3 | ## Tars 使用相关 4 | 5 | ### tars协议 6 | 7 | tars协议采用接口描述语言(Interface description language,缩写IDL)来实现,它是一种二进制、可扩展、代码自动生成、支持多平台的协议,使得在不同平台上运行的对象和用不同语言编写的程序可以用PRC远程调用的方式相互通信交流, 主要应用在后台服务之间的网络传输协议,以及对象的序列化和反序列化等方面。 8 | 9 | 协议支持的类型分两种,基本类型和复杂类型。 10 | 11 | 基本类型包括:void、bool、byte、short、int、long、float、double、string、unsigned byte、unsigned short、unsigned int; 12 | 13 | 复杂类型包括:enum、const、struct、vector、map,以及struct、vector、map的嵌套。 14 | 15 | ### 开发和打包 16 | 17 | 不同语言在开发上存在差异,但基本思路一致: 18 | 19 | 1. 编写tars文件xx.tars; 比如 20 | 21 | ```text 22 | module MTT 23 | { 24 | enum MYE1 25 | { 26 | EM_CAT, 27 | EM_DOG, 28 | }; 29 | struct A 30 | { 31 | 0 require int b; 32 | }; 33 | struct HelloWorld 34 | { 35 | 0 require int nId; 36 | 1 require string sMsg; 37 | 2 require vector vNews; 38 | ///4 optional string sNew="client new"; 39 | 5 require map mAddr; 40 | 6 require A a; 41 | }; 42 | 43 | struct HelloPerson 44 | { 45 | 0 require int nId; 46 | 1 require string sName; 47 | 2 optional vector vFavor; 48 | 3 optional MYE1 ePet; 49 | ///4 optional byte aPetAge[5]; 50 | 5 optional map mAddr; 51 | 6 optional string sPhone; 52 | 7 optional bool bMan; 53 | 9 optional HelloWorld shello; 54 | }; 55 | 56 | interface Hello 57 | { 58 | int testHello(string s,vector vsh,out string r); 59 | int testPerson(HelloPerson stPersonIn,out HelloWorld stPersonOut); 60 | }; 61 | }; 62 | ``` 63 | 64 | 1. 利用tars官方转换工具根据tars文件内容生成客户端或服务端代码\(在配置文件中指定生成客户端还是服务端,注意命名规范\); 65 | 2. 完善代码逻辑(完形填空); 66 | 3. 打包代码; 67 | 4. 通过web管理界面添加应用信息(与tars定义保持一致)并上传以上步骤最终的打包代码并发布。 68 | 5. 代码打包文件上传位置/data/tars/patchs/tars.upload/ 69 | 70 | ### 发布 71 | 72 | 代码打包同时会执行发布过程,还可以在服务管理列表中重启或关闭处理。 73 | 74 | 打包程序上传后,会放置在应用服务器的/usr/local/app/tars/tarsnode/data目录下,——应用名+服务名,服务名PHPTest,服务名PHPHttpServer则会将代码解压放置在PHPTest.PHPHttpServer目录下 75 | 76 | 每个完整的目录下会放置bin、conf、data文件夹,基本作用为: 77 | 78 | * bin目录——放置解压后的程序文件,tars同时自动生成对应的启动命令文件和关闭命令文件 tars\_start.sh、tars\_stop.sh (也可以跳过web管理界面直接使用此文件开启/关闭服务) 79 | * conf目录下,则存放此应用相关的服务模版配置文件——结合应用发布填写的配置项生成的最终配置文件; 80 | * data目录下放置服务的缓存信息文件,以及进程id文件等 81 | 82 | ### 日志查看 83 | 84 | 日志目录位置 /usr/local/app/tars/app\_log/,在此目录下的应用名称目录下找到对应的日志文件,如 /usr/local/app/tars/app\_log/PHPTest/PHPHttpServer/PHPTest.PHPHttpServer.log 85 | 86 | 服务打的日志路径在/usr/local/app/tars/app\_log/服务的应用名/服务的服务名/目录下,例如:/usr/local/app/tars/app\_log/Test/HelloServer/ 87 | 88 | 服务的可执行文件在/usr/local/app/tars/tarsnode/data/服务的应用名.服务的服务名/bin/下,例如:/usr/local/app/tars/tarsnode/data/Test.HelloServer/bin/ 89 | 90 | 服务的模版配置文件在/usr/local/app/tars/tarsnode/data/服务的应用名.服务的服务名/conf/下,例如:/usr/local/app/tars/tarsnode/data/Test.HelloServer/conf/ 91 | 92 | 服务的缓存信息文件在/usr/local/app/tars/tarsnode/data/服务的应用名.服务的服务名/data/下,例如:/usr/local/app/tars/tarsnode/data/Test.HelloServer/data/ 93 | 94 | ## Tars PHP 开发相关 95 | 96 | ### PHP服务模版配置 97 | 98 | 每个Tars服务启动运行时,必须指定一个模版配置文件,在Tars web管理系统中部署的服务的模版配置由node进行组织生成,若不是在web管理系统上,则需要自己创建一个模版文件。具体[https://github.com/Tencent/Tars/blob/master/docs/tars\_template.md](https://github.com/Tencent/Tars/blob/master/docs/tars_template.md) 99 | 100 | 对php开发,首先在web管理界面中->运维管理->模板管理,找到tars.tarsphp.default模板,根据实际php安装位置修改,如: 101 | 102 | ```text 103 | php=/usr/bin/php/bin/php 104 | ``` 105 | 106 | 同时,将tars.tarsphp.default内容复制,新建tcp、http、timer版本的模板 相比较将tars.tarsphp.default,http模板,差异为: 107 | 108 | http模板在server节点增加: 109 | 110 | ```text 111 | protocolName=http 112 | type=http 113 | ``` 114 | 115 | TCP模板在server节点增加: 116 | 117 | ```text 118 | package_length_type=N 119 | open_length_check=1 120 | package_length_offset=0 121 | package_body_offset=0 122 | package_max_length=2000000 123 | protocolName=tars 124 | type=tcp 125 | ``` 126 | 127 | timer模板在server节点增加: 128 | 129 | ```text 130 | protocolName=http 131 | type=http 132 | isTimer=1 133 | ``` 134 | 135 | 注: 136 | 137 | * 父模板名均选择tars.default即可 138 | * 文档中protocolName、type的说明缺失,实际使用中发现会报错,保险起见按照以上说明配置 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-client.md: -------------------------------------------------------------------------------- 1 | # tars-client 2 | 3 | ## tars-client 4 | 5 | ### 简介 6 | 7 | 主要包含主控寻址网络收发能力、上报能力 8 | 9 | tests目录提供了一个tars服务的测试用例。服务名为 **App.Server.Servant** 10 | 11 | ### 使用说明 12 | 13 | 参照提供的测试用例。 14 | tars-client端调用tars服务,在实例化时需要传入 **\Tars\client\CommunicatorConfig** 的实例,设定必要的配置信息。主要包含以下内容 15 | 16 | * 服务地址 17 | * 主控寻址 18 | * 有多台机器提供服务时,可以通过主控自动寻址方式发现服务 19 | * 指定服务地址 20 | * 灰度或者需要从特定地址获取服务时,采用此方式 21 | * 网络传输 22 | * 包含三种模式:socket、swoole sync、swoole coroutine 23 | * 上报名 24 | * 指定上报模块名称。主控寻址默认为 **tarsproxy** ,指定服务地址时可以根据业务自行填写 25 | * 编码格式 26 | 27 | #### 服务寻址方式 28 | 29 | 结合测试用例testServant.php介绍不同服务寻址的代码规范。 30 | 通过 **\Tars\client\CommunicatorConfig** 类设定相关配置。测试用例给出了两种寻址方式的示例代码 31 | 1、主控寻址 32 | 一旦指定locator,tars可以根据服务名自动抓取服务地址。locator配置的格式如下 33 | 34 | ```text 35 | $config = new \Tars\client\CommunicatorConfig(); 36 | $config->setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"); 37 | ``` 38 | 39 | tars主控本身也是一个tars服务,服务名为 **tars.tarsregistry.QueryObj** ,传输协议为tcp,服务地址为 172.16.0.161,端口为 17890 。实际开发中请 **根据服务实际情况填写** 40 | 41 | 上述主控服务确定后,可以根据需要指定上报的模块名及编码格式。默认的上报模块名为 **tarsproxy** ,为了便于跟踪业务,建议重新指定上报模块名 42 | 43 | ```text 44 | $config->setModuleName("App.Server"); 45 | $config->setCharsetName("UTF-8"); 46 | ``` 47 | 48 | 2、指定ip 指定服务方的地址。这种方式需要指定服务的ip、port,代码如下。 49 | 50 | ```text 51 | $route['sIp'] = "127.0.0.1"; 52 | $route['iPort'] = 8080; 53 | $routeInfo[] = $route; 54 | $config = new \Tars\client\CommunicatorConfig(); 55 | $config->setRouteInfo($routeInfo); 56 | ``` 57 | 58 | 其他用法同自动寻址相同 59 | 60 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-config.md: -------------------------------------------------------------------------------- 1 | # tars-config 2 | 3 | ## tars-config使用说明 4 | 5 | ### 简介 6 | 7 | tars-config用来获取从tars管理平台下发的配置。通常使用在下发环境对应的业务配置,例如mysql,redis地址,端口等信息 8 | 9 | ### 使用说明 10 | 11 | ```text 12 | setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"); //这里配置的是tars主控地址 17 | $config->setModuleName("tedtest"); //主调名字用于显示再主调上报中。 18 | $config->setCharsetName("UTF-8"); //字符集 19 | 20 | $conigServant = new \Tars\config\ConfigServant($config); 21 | $result = $conigServant->loadConfig("PHPTest",'helloTars','hhh.txt',$configtext); //参数分别为 appName(servant name 第一部分),server name(servant name第二部分),文件名,最后一个是引用传参,是输出的配置文件内容。 22 | var_dump($configtext); 23 | 24 | $config->setSocketMode(2); //设置socket model为2 swoole tcp client,1为socket,3为swoole 协程 client 25 | $conigServant = new \Tars\config\ConfigServant($config); 26 | $result = $conigServant->loadConfig("PHPTest",'helloTars','hhh.txt',$configtext); 27 | var_dump($configtext); 28 | ``` 29 | 30 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-log.md: -------------------------------------------------------------------------------- 1 | # tars-log 2 | 3 | ## tars-log 4 | 5 | `tars-log` 是 `phptars` 远程日志模块 6 | 7 | ### 安装 8 | 9 | 使用`composer`进行安装 `composer install phptars/tars-log` 10 | 11 | ### 使用 12 | 13 | #### 配置 14 | 15 | 实例化CommunicatorConfig,可以逐个参数进行配置,也可以通过平台下发的配置文件统一配置 16 | 17 | * 单独配置某个参数 18 | 19 | ```text 20 | $config = new \Tars\client\CommunicatorConfig(); 21 | $config->setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"); 22 | $config->setModuleName("tedtest"); 23 | $config->setCharsetName("UTF-8"); 24 | $config->setLogLevel("INFO"); //日志级别:`INFO`、`DEBUG`、`WARN`、`ERROR` 默认INFO 25 | $config->setSocketMode(2); //远程日志连接方式:1:socket,2:swoole tcp client 3: swoole coroutine tcp client 26 | ``` 27 | 28 | * 配置文件初始化参数 29 | 30 | ```text 31 | $config = new \Tars\client\CommunicatorConfig(); 32 | $sFilePath = '项目地址/src/conf'; //配置文件下发路径 33 | $config->init($sFilePath); 34 | ``` 35 | 36 | #### 输出日志 37 | 38 | 输出日志提供两种方式,一种直接调用`LogServant`的`logger`方式输出远程日志,另一种结合`monolog`输出远程日志\(推荐\) 39 | 40 | * 调用`LogServant`的`logger`方式 41 | 42 | ```text 43 | $logServant = new \Tars\log\LogServant($config); 44 | $appName = "App"; //应用名称 45 | $serverName = "server"; //服务名称 46 | $file = "test.log"; //文件名称 47 | $format = "%Y%m%d"; //日志时间格式 48 | $buffer = ["hahahahaha"]; //日志内容,数组,每个元素为一条日志 49 | $result = $logServant->logger($appName,$serverName,$file,$format,$buffer); 50 | ``` 51 | 52 | * 结合`monolog`方式\(推荐\) 53 | 54 | ```text 55 | $logger = new \Monolog\Logger("tars_logger"); 56 | //remote log 57 | $tarsHandler = new \Tars\log\handler\TarsHandler($config); 58 | //local log 这里可以根据业务需要添加其他handler,比如StreamHandler、ElasticSearchHandler 等 59 | $streamHandler = new \Monolog\Handler\StreamHandler(ENVConf::$logPath . "/" . __CLASS__ . ".log"); 60 | 61 | $logger->pushHandler($tarsHandler); 62 | $logger->pushHandler($streamHandler); 63 | 64 | $array = [ 65 | "key1" => "value1", 66 | "key2" => "value2", 67 | "key3" => "value3" 68 | ]; 69 | $logger->debug("add a debug message", $array); 70 | $logger->info("add a info message", $array); 71 | $logger->notice("add a notice message", $array); 72 | $logger->warning("add a warning message", $array); 73 | $logger->error("add a error message", $array); 74 | $logger->critical("add a critical message", $array); 75 | $logger->emergency("add a emergency message", $array); 76 | ``` 77 | 78 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-monitor.md: -------------------------------------------------------------------------------- 1 | # tars-monitor 2 | 3 | ## tars-monitor 4 | 5 | `tars-monitor` 是 `phptars` 服务与特性监控上报模块 6 | 7 | 它由两个子模块组成: 8 | 9 | * 服务监控 10 | * 特性监控 11 | 12 | ### 使用方式 13 | 14 | #### 安装 15 | 16 | 使用composer进行安装 `composer install phptars/tars-monitor` 17 | 18 | #### 调用 19 | 20 | **服务监控上报** 21 | 22 | * locator 为上报地址,一般由服务器下发 23 | * socketMode 设置为 1 使用 socket 方式进行上报 socketMode 设置为 2 使用 swoole tcp client方式进行上报(需要swoole支持) socketMode 设置为 3 使用 swoole tcp coroutine client协程方式进行上报(需要swoole2.0以上支持) 24 | 25 | **定时上报\(默认\)** 26 | 27 | > 使用定时上报需要 swoole\_table支持,通过调用addStat将上报信息暂存,tars-server的task进程会搜集一段时间内(上报时间间隔由服务器下发,一般为60s)统一打包上报,可以减少上报请求 28 | 29 | ```text 30 | $locator = "tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"; 31 | $socketMode = 1; 32 | $statfWrapper = new \Tars\monitor\StatFWrapper($locator,$socketMode); 33 | $statfWrapper->addStat("PHPTest.helloTars.obj","test","172.16.0.116",51003,200,0,0); 34 | $statfWrapper->addStat("PHPTest.helloTars.obj","test","172.16.0.116",51003,200,0,0); 35 | $statfWrapper->addStat("PHPTest.helloTars.obj","test","172.16.0.116",51003,200,0,0); 36 | ``` 37 | 38 | 上报数据可使用多种存储方式,cache中提供了`swoole_table`与`redis`的实现方式,用户也可以自己实现`contract/StoreCacheInterface`,配置存储方式参考demo `tars-http-server` 中`src/services.php` 的配置。 39 | 40 | ```text 41 | return array( 42 | 'namespaceName' => 'HttpServer\\', 43 | 'monitorStoreConf' => [ 44 | 'className' => Tars\monitor\cache\SwooleTableStoreCache::class, 45 | 'config' => [] 46 | ] 47 | ); 48 | ``` 49 | 50 | `monitorStoreConf` 为存储方式的配置,其中`className`为实现类,`config` 为对应的配置,如使用redis存储方式时,config中需要配置redis的host、port、以及key的前缀等。 未配置`monitorStoreConf`时默认使用`SwooleTableStoreCache`进行存储。 51 | 52 | **单次上报** 53 | 54 | > 同时`tars-monitor`也提供了单次上报的接口`monitorStat`,即每次tars请求调用均会进行一次上报,该方式不建议使用 55 | 56 | ```text 57 | $locator = "tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890"; 58 | $socketMode = 1; 59 | $statfWrapper = new \Tars\monitor\StatFWrapper($locator,$socketMode); 60 | $statfWrapper->monitorStat("PHPTest.helloTars.obj","test","172.16.0.116",51003,200,0,0); 61 | ``` 62 | 63 | **特性监控** 64 | 65 | 参数与服务监控类似 66 | 67 | ```text 68 | $statfWrapper = new \Tars\monitor\PropertyFWrapper("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890",1); 69 | $statfWrapper->monitorProperty("127.0.0.1","userdefined",'Sum',2); 70 | $statfWrapper->monitorProperty("127.0.0.1","userdefined",'Count',2); 71 | $statfWrapper->monitorProperty("127.0.0.1","userdefined",'Count',1); 72 | ``` 73 | 74 | #### 监控查看 75 | 76 | 数据上报后,用户可在服务监控/特性监控选项卡中查看上报的数据。 77 | 78 | ### 其他 79 | 80 | 因为其他模块已经集成了本模块, **所以一般情况下,服务脚本无需显式使用此模块。** 81 | 82 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-ping-tai-zhen-dui-php-xiu-gai-shuo-ming.md: -------------------------------------------------------------------------------- 1 | # Tars 平台针对 PHP 修改说明 2 | 3 | 与默认模板tars.default相比,php新增了tars.tarsphp.default, 主要添加了如下部分: 4 | 5 | ```text 6 | 7 | ... 8 | 9 | 10 | ... 11 | php=/data/env/runtime/php-7.1.7/bin/php 12 | buffer_output_size=12582912 13 | open_tcp_nodelay=1 14 | open_eof_check=0 15 | open_eof_split=0 16 | task_worker_num=1 17 | dispatch_mode=2 18 | daemonize=1 19 | ... 20 | 21 | 22 | ... 23 | 24 | ``` 25 | 26 | * 支持自定义php执行文件(/tars/application/server< php >),默认/usr/bin/php。 27 | * 支持自定义tars\_php框架启动文件配置(/tars/application/server< entrance >),默认项目目录下的src/index.php。 28 | * tars平台生成的启动脚本会以entrance为入口文件来执行启停脚本。 29 | 30 | 在tars-server模块中,三个不同的http、timer、tcp server都需要使用不同的模块,请务必进行新的模板的添加和修改工作!! 31 | 32 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-registry.md: -------------------------------------------------------------------------------- 1 | # tars-registry 2 | 3 | ### 主控寻址的模块 4 | 5 | ### 1、模块说明 6 | 7 | ```text 8 | tars平台的tarsregistry服务提供服务发现的功能。 9 | 本模块为php提供主控寻址的能力(服务发现)。 10 | ``` 11 | 12 | ### 2、文件说明: 13 | 14 | ```text 15 | ├── composer.json 16 | ├── src 17 | │ ├── client //请求主控服务的client代码 18 | │ │ ├── Code.php 19 | │ │ ├── CodeRegistry.php 20 | │ │ ├── CommunicatorConfig.php 21 | │ │ ├── CommunicatorFactory.php 22 | │ │ ├── Communicator.php 23 | │ │ ├── CommunicatorRegistry.php 24 | │ │ ├── Consts.php 25 | │ │ ├── RequestPacket.php 26 | │ │ ├── RequestPacketRegistry.php 27 | │ │ ├── ResponsePacket.php 28 | │ │ ├── ResponsePacketRegistry.php 29 | │ │ ├── TUPAPIWrapper.php 30 | │ │ └── TUPAPIWrapperRegistry.php 31 | │ ├── EndpointF.php //struct EndpointF 的php类 32 | │ ├── QueryFServant.php //直接请求主控服务 33 | │ ├── QueryFWrapper.php //优先从内存寻找服务地址,其次从主控寻址 34 | │ ├── RouteTable.php //在swoole table里保存服务地址 35 | │ └── tars //协议文件 36 | │ ├── EndpointF.tars 37 | │ └── QueryF.tars 38 | └── tests 39 | └── demo.php 40 | 41 | ``` 42 | 43 | ### 3、使用示例: 44 | 45 | ```text 46 | //从tarsregistry服务寻找服务地址 47 | $wrapper = new \Tars\registry\QueryFWrapper("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890",1,60000); 48 | $result = $wrapper->findObjectById("PHPTest.PHPServer.obj"); 49 | var_dump($result); 50 | 51 | //优先从内存寻找服务地址,其次从主控寻址 52 | \Tars\registry\RouteTable::getInstance(); 53 | $result = \Tars\registry\RouteTable::getRouteInfo("PHPTest.PHPServer.obj"); 54 | echo "result:\n"; 55 | var_dump($result); 56 | ``` 57 | 58 | ### 4. Changelog 59 | 60 | #### v0.1.7 \(2019-03-20\) 61 | 62 | * 主控寻址缓存接口化,方便自定义缓存方式,默认使用swoole table 63 | 64 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-report.md: -------------------------------------------------------------------------------- 1 | # tars-report 2 | 3 | 进行keepAlive上报的组件 4 | 5 | 1、组件说明 6 | 7 | ```text 8 | tarsphp框架在master进程启动的时候会上报服务存活状态(主进程存活&管理进程存活)。 9 | 在第一个worker进程启动的时候,会开启一个timer来定时上报存活状态。 10 | ``` 11 | 12 | 2、文件说明: 13 | 14 | ```text 15 | ├── composer.json 16 | ├── src 17 | │ ├── NodeF.tars //协议文件 18 | │ ├── ServerFAsync.php // 异步上报 19 | │ ├── ServerFSync.php // 同步上报 20 | │ └── ServerInfo.php //ServerInfo 21 | ``` 22 | 23 | 3、使用实例\(假如服务为 PHPTest.test.obj\): 24 | 25 | ```text 26 | $serverInfo = new ServerInfo(); 27 | $serverInfo->adapter = 'PHPTest.test.objAdapter'; 28 | $serverInfo->application = 'PHPTest'; 29 | $serverInfo->serverName = 'test'; 30 | $serverInfo->pid = $masterPid; 31 | 32 | $serverF = new ServerFSync($host, $port, $objName); 33 | $serverF->keepAlive($serverInfo); //主进程存活 34 | 35 | $adminServerInfo = new ServerInfo(); 36 | $adminServerInfo->adapter = 'AdminAdapter'; 37 | $adminServerInfo->application = 'PHPTest'; 38 | $adminServerInfo->serverName = 'test'; 39 | $adminServerInfo->pid = $masterPid; 40 | $serverF->keepAlive($adminServerInfo);//管理进程存活 41 | ``` 42 | 43 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-server.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: '包名:phptars/tars-server 是TARS—PHP-SERVER的底层依赖。' 3 | --- 4 | 5 | # tars-server 6 | 7 | ## 如何使用 8 | 9 | TARS-SERVER使用composer进行包管理,开发者只需要根据相应的版本,进行composer install即可。 10 | 11 | 具体的使用方式,请参考对应php/examples下面的http-server、timer-server和tcp-server。 12 | 13 | ## 框架说明 14 | 15 | TARS-SERVER是以SWOOLE为底层的网络收发实现的,框架主要包含如下的目录: 16 | 17 | * cmd: 负责框架的启动和停止命令的实现,现在支持start、stop和restart命令 18 | * core: 框架的核心实现 19 | * protocol: 负责进行协议处理 20 | 21 | ### cmd层 22 | 23 | 针对cmd层,现在包含如下几个文件: 24 | 25 | 1. Command.php: 负责在服务启动的时候,指定配置文件和启动命令 26 | 2. CommandBase 规定了一个Command所必须的实现,所有的诸如START,都是CommandBase的子类。其中提供了getProcess方法,来获取当前启动的服务进程。 27 | 3. Restart 重启命令,只是调用停止后,再调用启动 28 | 4. Start 启动命令,会首先解析平台下发的配置,然后引入业务所必须的services.php文件。 接下来监测进程是否已经启动,从而避免重复启动; 最后将配置和预先定义的SwooleTable传入Server,进行服务的初始化和启动过程。 29 | 5. Stop 现在的服务停止方式比较暴力,会根据服务的名称拉出所有的进程,然后kill掉。后续会引入reload的方式进行服务的代码重新加载。 30 | 31 | ### core核心层 32 | 33 | 核心层主要由Event、Server、Request和Response组成。 34 | 35 | 1. Server.php 负责服务的启动前的初始化工作,包括: 36 | 37 | * 判断是tcp还是http类型,从而注册对应的回调,启动对应的server 38 | * 判断如果是timer,会启动对对应目录的timer扫描 39 | * 将swoole的配置透传 40 | * 注册通用的回调函数 41 | * 传递server的swooletable 42 | * 指定整个框架的启动文件,并强制require 43 | * 指定框架的协议处理方式,是tars还是http 44 | 45 | 在完成服务的启动之后,首先会进入onMasterStart: 46 | 47 | * 写入进程的名称 48 | * 将pid写入文件中 49 | * 进行服务的初始化上报 50 | 51 | onManagerStart: 52 | 53 | * 重命名进程 54 | 55 | 其次是onWorkerStart: 56 | 57 | * 如果是tcp类型,需要先将interface中的注释转化为php的数据,方便路由的时候处理 58 | * 如果是http的类型,需要指定对应的namespacename 59 | * 设置对应的worker的名称 60 | * 如果是timer,需要启动对应的timer 61 | * 在workerId=0的时候\(保证只触发一次\),将服务的保活上报任务投递到TASK里面 62 | 63 | onTask: 将服务的APPName serverName servantName进行上报。 64 | 65 | 分别需要关注onReceive和onRequest两个回调。 66 | 67 | 对于tcp的server,关注onReceive: 68 | 69 | * 初始化Request对象,将sw对象,传入超全局变量$\_SERVER 70 | * 设置protocol为TARSProtocol 71 | * 进行协议处理,并回包 72 | * 清除全局变量 73 | 74 | 对于http的server,关注onRequest: 75 | 76 | * 处理cookie、get、post请参数 77 | * 初始化Request对象,将sw对象,传入超全局变量$\_SERVER 78 | * 进行协议处理,并回包 79 | * 清除全局变量 80 | 81 | 1. Event.php onReceive方法: 82 | 83 | * tcp协议的请求,先会进入TARSProtocol的route方法,进行路由 84 | * 完成路由后,进行实际的函数调用 85 | * 打包回包 86 | * 发送回包 87 | 88 | onRequest方法: 89 | 90 | * 提供一个默认的探测接口 91 | * 进行基本的路由协议解析 92 | * 调用对应的controller方法 93 | * 发送回包 94 | 95 | 1. Request.php 储存一些必要的请求数据; 设置和去掉全局变量 96 | 2. Response.php 负责回包的一些工作 97 | 98 | ### 服务启动流程 99 | 100 | 整个服务启动由cmd下的Start发起, 之后调用Server对象的创建, 然后依次进行swoole的初始化工作, 完成启动服务之后,只需要处理onReceive或者onRequest的监听即可 101 | 102 | ## 框架依赖 103 | 104 | 框架依赖以下几个包: 105 | 106 | * phptars/tars-client: 进行tars服务的调用 107 | * phptars/tars-report: 负责服务本身运行状态的上报 108 | * phptars/tars-config: 负责对于平台上传的配置的拉取 109 | 110 | ## Changelog 111 | 112 | ### v0.3.1\(2019-06-21\) 113 | 114 | * 支持多个servant 115 | * 使用swoole addListener 做底层支持 116 | * 支持一个服务部署多个obj,分别使用tars 或 http 协议 117 | * services.php 格式调整,返回以objName 为key 的二维数组。 118 | * protocolName, serverType, isTimer 不在从私有模板中读取,需要在services.php中指定 119 | * 修复多servant对webSocket的支持 120 | 121 | ### v0.2.4\(2019-03-20\) 122 | 123 | * 按照psr规则格式化代码 124 | * 修复代码中的bug 125 | * 支持自定义主控缓存 126 | * 开放获取swoole对象的方法 127 | 128 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/tars-utils.md: -------------------------------------------------------------------------------- 1 | # tars-utils 2 | 3 | ## tars-utils 4 | 5 | `tars-utils` 是 phptars的辅助类库,主要提供如下几个功能: 6 | 7 | * 配置文件解析并缓存\(swoole table\) 8 | * 主控地址解析 9 | * node上报配置解析 10 | 11 | ### @parseFile\($configPath\) 12 | 13 | 配置文件解析,以`QDPHP.TARSServer.config.conf` 为例,将`conf` 文件解析成 数组形式 14 | 15 | ### @getLocatorInfo\($locatorString\) 16 | 17 | 地址解析,示例: 18 | 19 | ```text 20 | $locatorString = "tars.tarsregistry.QueryObj@tcp -h 127.0.0.1 -p 17890:tcp -h 127.0.0.1 -p 17890"; 21 | 22 | $locatorInfo = \Tars\Utils::getLocatorInfo($locatorString); 23 | ``` 24 | 25 | 得到结果如下: 26 | 27 | ```text 28 | [ 29 | 'locatorName' => 'tars.tarsregistry.QueryObj', 30 | 'routeInfo' => [ 31 | [ 32 | 'sHost' => '127.0.0.1', 33 | 'sProtocol' => 'tcp', 34 | 'iPort' => 17890, 35 | 'iTimeout' => '', 36 | 'bIp' => '', 37 | 'sIp' => '' 38 | ], 39 | [ 40 | 'sHost' => '127.0.0.1', 41 | 'sProtocol' => 'tcp', 42 | 'iPort' => 17890, 43 | 'iTimeout' => '', 44 | 'bIp' => '', 45 | 'sIp' => '' 46 | ] 47 | ] 48 | ] 49 | ``` 50 | 51 | ### @parseNodeInfo\($nodeInfo\) 52 | 53 | node上报配置解析,示例: 54 | 55 | ```text 56 | $locatorString = "tars.tarsnode.ServerObj@tcp -h 127.0.0.1 -p 2345 -t 10000"; 57 | 58 | $nodeInfo = \Tars\Utils::parseNodeInfo($locatorString); 59 | ``` 60 | 61 | 得到结果如下: 62 | 63 | ```text 64 | [ 65 | 'objName' => 'tars.tarsnode.ServerObj', 66 | 'mode' => 'tcp', 67 | 'host' => '127.0.0.1', 68 | 'port' => 2345, 69 | 'timeout' => 1, 70 | 'sIp' => '', 71 | 'iPort' => 2345 72 | ] 73 | ``` 74 | 75 | ## Changelog 76 | 77 | #### v0.3.0\(2019-06-21\) 78 | 79 | * 支持多个servant 80 | 81 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/yu-swoft-jie-he-shi-yong.md: -------------------------------------------------------------------------------- 1 | # 与Swoft结合使用 2 | 3 | 4 | 5 | ## 简介 6 | 7 | 让swoft框架欢快的跑在tars里面 8 | 9 | * 支持打包发布 10 | * 支持服务存活上报(服务注册) 11 | 12 | ## 相关项目 13 | 14 | * SwoftInTars \([https://github.com/dpp2009/swoftInTars](https://github.com/dpp2009/swoftInTars)\) 15 | * SWOFT \([https://github.com/swoft-cloud/swoft](https://github.com/swoft-cloud/swoft)\) 16 | * TARSPHP \([https://github.com/TarsPHP](https://github.com/TarsPHP)\) 17 | * TARSPHP DOCKER \([https://github.com/tangramor/docker-tars](https://github.com/tangramor/docker-tars)\) 18 | 19 | ## 使用 20 | 21 | * Clone 项目 \([https://github.com/dpp2009/swoftInTars](https://github.com/dpp2009/swoftInTars)\) 22 | * 安装依赖 `composer install` 23 | * 打包 `composer run-script deploy` 24 | * 将打包完成的文件上传tars平台 25 | 26 | ## 配置说明 27 | 28 | * 服务名需要在 ./tars/tars.proto.php (appName&serverName) 和 ./src/.env (PNAME) 里面正确配置 29 | * swoft的端口号不使用tars平台下发的端口号(因为swoft可以支持多端口多协议) 30 | 31 | ## 重启问题 32 | 33 | * 使用docker-tars,pcre可能没开启。运行php --ri swoole,看是否存在pcre => enabled。不存在运行yum install pcre-devel,再重新编译swoole!! 34 | 35 | -------------------------------------------------------------------------------- /dev/tarsphp/backup/yu-thinkphp-jie-he-shi-yong.md: -------------------------------------------------------------------------------- 1 | # 与thinkphp结合使用 2 | 3 | 4 | 5 | ## 简介 6 | 7 | 让thinkphp框架欢快的跑在tars里面 8 | 9 | * 支持打包发布 10 | * 支持服务存活上报(服务注册) 11 | 12 | ## 相关项目 13 | 14 | * thinkphpInTars \([https://github.com/dpp2009/thinkphpInTars](https://github.com/dpp2009/thinkphpInTars)\) 15 | * think-swoole \([https://github.com/top-think/think-swoole](https://github.com/top-think/think-swoole)\) 16 | * TARSPHP \([https://github.com/TarsPHP](https://github.com/TarsPHP)\) 17 | 18 | ## 使用 19 | 20 | * Clone 项目 \([https://github.com/dpp2009/thinkphpInTars](https://github.com/dpp2009/thinkphpInTars)\) 21 | * 安装依赖 `composer install` 22 | * 打包 `composer run-script deploy` 23 | * 将打包完成的文件上传tars平台 24 | 25 | ## 配置说明 26 | 27 | * 服务名需要在 ./tars/tars.proto.php 里面正确配置 28 | * 不使用tars平台下发的端口号,按照thinkphp的方式配置 29 | 30 | -------------------------------------------------------------------------------- /env/README.md: -------------------------------------------------------------------------------- 1 | # Development Environment Setup 2 | > * [Intro](#chapter-1) 3 | > * [Development Mode](#chapter-1) 4 | 5 | # 1 Intro 6 | 7 | Because tars supports multilingual development services, different development languages and environments are different, but the overall development pattern is similar. 8 | 9 | # 2 Development Mode 10 | 11 | No matter what language, the development mode of service is generally as follows: 12 | - A set of custom syntax definition and communication protocol between services 13 | - Each language of tars provides a set of Lib library, which can quickly realize services based on the above communication protocols 14 | - Each language service can call each other, and the protocol is same 15 | - Services can be packaged and published to the tars framework for management 16 | - All services can be managed on the web platform 17 | 18 | 19 | -------------------------------------------------------------------------------- /env/tars.js.md: -------------------------------------------------------------------------------- 1 | # Tars.js 2 | 3 | >= Node.js v10 4 | 5 | Tars nodejs is not dependent on other environments, so you can install corresponding modules as needed during development 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /env/tarscpp.md: -------------------------------------------------------------------------------- 1 | # TarsCpp 2 | > * [Intro](#chapter-1) 3 | > * [Dependent environment](#chapter-2) 4 | > * [Construction of development environment](#chapter-3) 5 | 6 | # 1 Intro 7 | 8 | This section mainly introduces the development environment required for the development and compilation of the tars CPP service based on Centos7. 9 | 10 | **Note: if Tars has been compiled and deployed on the machine before, the development environment of tars CPP will work automatically** 11 | 12 | # 2 Dependent environment 13 | 14 | | Software | Software requirements | 15 | | :--- | :--- | 16 | | linux kernel: | >=2.6.18 | 17 | | gcc version: | >=4.8、glibc-devel | 18 | | bison version: | >=2.5| 19 | | flex version: | >=2.5 | 20 | | cmake version: | >=3.2| 21 | | mysql version: | >=5.6| 22 | 23 | 24 | ## 2.1. Download and install build package dependency 25 | 26 | Source compilation needs to be installed: gcc, glibc, bison, flex, cmake 27 | 28 | for example,in Centos7: 29 | ``` 30 | yum install glibc-devel gcc gcc-c++ bison flex cmake 31 | ``` 32 | 33 | # 3 Construction of development environment 34 | 35 | ```text 36 | git clone https://github.com/TarsCloud/TarsCpp.git --recursive 37 | cd TarsCpp 38 | cmake . 39 | make 40 | make install 41 | ``` 42 | 43 | At this point, the compilation environment of tars CPP has been completed, and the next step is to implement the tars service of CPP. 44 | 45 | if you want open ssl & http2 support: 46 | 47 | ``` 48 | cmake .. -DTARS_SSL=ON -DTARS_HTTP2=ON 49 | make 50 | make install 51 | ``` 52 | 53 | close support: 54 | ``` 55 | cmake .. -DTARS_SSL=OFF -DTARS_HTTP2=OFF 56 | make 57 | make install 58 | ``` 59 | 60 | Note that the demo services of examples are not compiled by default. If you want to compile these demo services, please: 61 | ``` 62 | cmake .. -DONLY_LIB=OFF 63 | ``` 64 | -------------------------------------------------------------------------------- /env/tarsgo.md: -------------------------------------------------------------------------------- 1 | # TarsGo Development Environment Setup 2 | 3 | ## Content 4 | 5 | > * [Environment Dependence](#Environment-Dependence) 6 | > * [Installation](#Installation) 7 | 8 | ## Environment Dependence 9 | 10 | Require Go `1.13.x` or above,see https://golang.org/doc/install 11 | 12 | ## Installation 13 | 14 | Install go (for example go install path: `/usr/local/go`), and configure `GOROOT`, `GOPATH`. For example, in Linux: 15 | 16 | ```sh 17 | export GOROOT=/usr/local/go 18 | export GOPATH=/root/gocode 19 | export PATH=$PATH:$GOROOT/bin:$GOPATH/bin 20 | ``` 21 | 22 | If you are in China, you can set up go proxy: 23 | 24 | ```sh 25 | go env -w GOPROXY=https://goproxy.cn 26 | ``` 27 | 28 | Set Go Modules to `auto`: 29 | 30 | ```sh 31 | go env -w GO111MODULE=auto 32 | ``` 33 | 34 | Enter `GOPATH` and get TarsGo 35 | 36 | ```sh 37 | cd $GOPATH 38 | go get -u github.com/TarsCloud/TarsGo/tars 39 | ``` 40 | 41 | And TarsGo is downloaded to path: `$GOPATH/src/github.com/TarsCloud/TarsGo/`. 42 | 43 | If you cannot find source code of TarsGo in this path, please check the above steps. 44 | 45 | After TarsGo is downloaded, install `tars2go`: 46 | 47 | ```sh 48 | go install $GOPATH/src/github.com/TarsCloud/TarsGo/tars/tools/tars2go 49 | ``` 50 | -------------------------------------------------------------------------------- /env/tarsjava.md: -------------------------------------------------------------------------------- 1 | # TarsJava 2 | > * [Environmental Dependency](#chapter-1) 3 | > * [Build Project](#chapter-1) 4 | > * [Config Dependency](#chapter-1) 5 | 6 | # Environmental Dependency 7 | 8 | >= JDK 1.8 9 | 10 | >= Maven 2.2.1 11 | 12 | # Build Project 13 | 14 | Create a maven web project through ide or Maven. Take eclipse as an example,File -> New -> Project -> Maven Project -> maven-archetype-webapp 15 | 16 | Then enter the groupid and artifactid. After the generation, you can import them through eclipse. The directory structure is as follows: 17 | 18 | ```text 19 | ├── pom.xml 20 | └── src 21 | ├── main 22 | │ ├── java 23 | │ │ └── tars 24 | │ │ └── test 25 | │ │ ├── HelloServant.java 26 | │ │ └── HelloServantImpl.java 27 | │ ├── resources 28 | │ │ └── servants.xml 29 | │ └── webapp 30 | └── test 31 | ├── java 32 | │ └── tars 33 | │ └── test 34 | │ └── TarsTest.java 35 | └── resources 36 | ``` 37 | 38 | # Config Dependency 39 | 40 | Add dependent jar package in pom.xml in the build project. 41 | 42 | * Framework dependency configuration 43 | 44 | ```text 45 | 46 | com.tencent.tars 47 | tars-server 48 | 1.6.1 49 | jar 50 | 51 | ``` 52 | 53 | * Plugin dependency configuration 54 | 55 | ```text 56 | 57 | com.tencent.tars 58 | tars-maven-plugin 59 | 1.6.1 60 | 61 | 62 | 63 | ${basedir}/src/main/resources/hello.tars 64 | 65 | UTF-8 66 | true 67 | ${basedir}/src/main/java 68 | UTF-8 69 | com.qq.tars.quickstart.server. 70 | 71 | 72 | 73 | ``` 74 | 75 | -------------------------------------------------------------------------------- /env/tarsphp.md: -------------------------------------------------------------------------------- 1 | # TarsPHP 2 | > * [Intro](#chapter-1) 3 | > * [Install PHP](#chapter-2) 4 | > * [Install swoole](#chapter-3) 5 | > * [Install tarsphp extension](#chapter-4) 6 | 7 | 8 | # Intro 9 | 10 | Proposed installation: php7+swoole2 11 | 12 | # Install PHP 13 | 14 | ```text 15 | https://github.com/php/php-src 16 | ``` 17 | 18 | # Install swoole 19 | 20 | ```text 21 | swoole: https://github.com/swoole/swoole-src 22 | install: https://wiki.swoole.com/wiki/page/6.html 23 | PECL Auto click download and installation 24 | pecl install swoole 25 | ``` 26 | 27 | PHP needs to install the extension,Please in [https://github.com/TarsPHP/tars-extension](https://github.com/TarsPHP/tars-extension) compiler and add extension into php.ini, see follows: 28 | 29 | # Install tarsphp extension 30 | 31 | project: [https://github.com/TarsPHP/tars-extension](https://github.com/TarsPHP/tars-extension) 32 | 33 | ```text 34 | git clone https://github.com/TarsPHP/tars-extension.git 35 | cd tars-extension 36 | sudo phpize 37 | sudo ./configure 38 | sudo make 39 | sudo make install 40 | ``` 41 | 42 | In php.ini add: extension=phptars.so 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /installation/docker-install.md: -------------------------------------------------------------------------------- 1 | # Docker Installation 2 | 3 | ## Directory 4 | 5 | > * [Intro]() 6 | > * [How to Install Docker]() 7 | 8 | ## 1 Intro 9 | 10 | Because the use of docker will be involved in the following chapters, this section briefly introduces how to install the docker environment in Centos. 11 | 12 | For more information about docker, please visit the official website of docker. 13 | 14 | If you do not deploy the tars environment with docker, ignore this step 15 | 16 | 17 | ## 2 How to Install Docker 18 | 19 | **This article only introduces the installation of docker environment in CentOS** 20 | 21 | Install Docker in Centos: 22 | 23 | ```bash 24 | sudo su 25 | yum install -y yum-utils device-mapper-persistent-data lvm2 26 | yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 27 | yum install -y docker-ce 28 | systemctl start docker 29 | systemctl enable docker 30 | ``` 31 | 32 | After installation, check the docker version: 33 | 34 | ```sh docker version``` 35 | 36 | -------------------------------------------------------------------------------- /installation/k8s-docker-1.md: -------------------------------------------------------------------------------- 1 | 2 | # Directory 3 | > * [Intro](#chapter-1) 4 | > * [Deploy In K8S](#chapter-2) 5 | 6 | # 1 Intro 7 | 8 | This page introduces a scheme of deploying tars on K8. The main steps are as follows: 9 | - Container framework services, using docker: tarscloud/framework 10 | - The tarsnode node is also containerized, using the docker: tarscloud/tars-node 11 | - The tars framework and tarsnode nodes are deployed on k8s as pods, and the container that the pod runs as a virtual machine 12 | - Publish services to these containers through tars Web 13 | 14 | This way of release and disaster recovery still depends on the ability of tars, k8s is only a container management platform 15 | 16 | ## 2 Deploy In K8S 17 | 18 | First install helm(you can learn helm by yourself). In short, helm is a tool for deploying services to k8s. 19 | 20 | Here is a way to install helm. Please refer to helm website for other information: 21 | ``` 22 | #download helm : helm (https://helm.sh/docs/using_helm/#installing-helm) 23 | #Tiller is the server side of helm, which will be deployed on the framework to complete the work of deploying other dockers to k8s 24 | #The tiller who creates the helm is bound to the cluster admin, and has the administrative authority of the whole cluster 25 | kubectl -n kube-system create serviceaccount tiller 26 | kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller 27 | 28 | #install tiller 29 | helm init --service-account tiller --tiller-image sapcc/tiller:v2.14.3 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts 30 | 31 | #check helm is installed succuess 32 | helm version 33 | kubectl -n kube-system rollout status deploy/tiller-deploy 34 | 35 | ``` 36 | 37 | Now use helm to install the tars framework, and replace the ```tars-test``` with the desired namespacee 38 | ``` 39 | helm repo add tars-stable https://tarscloud.github.io/TarsDocker/charts/stable 40 | 41 | kubectl create namespace tars-test 42 | 43 | #Deploy tars (two main framework and five node machines) 44 | helm install tars-stable/tars --name tars-test --namespace tars-test \ 45 | --set tars.namespace=tars-test,tars.replicas=2,tarsnode.replicas=5,tars.host=domain.com,tars.port=6080,tars.data=/data/shared/tars-data,mysql.data=/data/shared/mysql-data,mysql.rebuild=false 46 | 47 | 48 | ``` 49 | 50 | Access url of web is ```http://$namespace.$host.$port```, this example is ```http://tars-test.domain.com:6080``` 51 | 52 | Note: 53 | - tars.data & mysql.data It needs to be on a shared disk (such as NFS), otherwise the pod drift data will be lost 54 | - mysql.rebuild set false, Otherwise, the pod drift of MySQL will cause the data to be cleared 55 | - mysql, tars, tars-node All the pods of are in the form of statefullset 56 | -------------------------------------------------------------------------------- /question/Install_faq-en.md: -------------------------------------------------------------------------------- 1 | ## 1. You can't deploy service on IP `127.0.0.1` for the following reasons: 2 | 3 | 1. each service has at least one obj to serve foreign clients; 4 | 5 | 2. each service has a obj for administration, it binds to ip `127.0.0.1` and the same port which servant obj binds to. 6 | 7 | ## 2. Tars consists of RPC framework, basic services, web management system, etc. 8 | 9 | The RPC framework supports C++ , Java, Go, Php, Nodejs. Each language has its related baselib, idl generate-code tools, and implementation of client's and server's code, all can run on linux/mac/windows. 10 | 11 | ## 3. The software and tools that Tars depends must be prepared before deploy Tars, see [Install.md](https://github.com/TarsCloud/TarsDocs_en/blob/master/installation/source.md). 12 | 13 | ## 4. The steps of deploying Tars must follow the specified order described in [Install.md](https://github.com/TarsCloud/TarsDocs_en/blob/master/installation/source.md) 14 | 15 | ## 5. After executing of tars_start.sh, please execute command `ps -ef|grep tars` to check that the core service processes of Tars are alive, ie, tarsregistry, tarsAdminRegistry, tarsnode, tarsconfig and tarspatch. 16 | 17 | ## 6. The paths in which services deployed as below: 18 | Log file path: `/usr/local/app/tars/app_log/${Application}/${ServiceName}/`, such as 19 | ``` 20 | /usr/local/app/tars/app_log/Test/HelloServer/ 21 | ``` 22 | 23 | Executable file path: `/usr/local/app/tars/tarsnode/data/${Application}.${ServiceName}/bin/`, such as 24 | ``` 25 | /usr/local/app/tars/tarsnode/data/Test.HelloServer/bin/ 26 | ``` 27 | 28 | Template config file path: `/usr/local/app/tars/tarsnode/data/${Application}.${ServiceName}/conf/`, such as 29 | ``` 30 | /usr/local/app/tars/tarsnode/data/Test.HelloServer/conf/ 31 | ``` 32 | 33 | Cache file path: `/usr/local/app/tars/tarsnode/data/${Application}.${ServiceName}/data/`, such as 34 | ``` 35 | /usr/local/app/tars/tarsnode/data/Test.HelloServer/data/ 36 | ``` 37 | 38 | ## 7. How to check logs 39 | For example, there will be a log file named `Test.HelloServer.log` in directory `/usr/local/app/tars/app_log/Test/HelloServer/`. If something failed, please check it. 40 | 41 | ## 8. When deploy java service, please select tars.tarsjava.default as template. 42 | 43 | ![tars](../assets/java_server_deploy_en.png) 44 | 45 | ## 9. Check query conditon if you have problem with monitor data. 46 | 47 | ![tars](../assets/stat_en.png) 48 | 49 | ## 10. Update old version to support IPv6 (v1.6.0 or later), database update script 50 | 51 | Execute the following update script,and make sure that the password od database is right 52 | ``` 53 | TarsFramework/sql/upgrade2IPv6.sh 54 | ``` 55 | 56 | ## 11. tarsnode can not run java server: cannot execute java 57 | 58 | Please restart tarsnode after install jdk 59 | 60 | ``` 61 | /usr/local/app/tars/tarsnode/util/start.sh 62 | ``` 63 | -------------------------------------------------------------------------------- /question/tarsbenchmark-question.md: -------------------------------------------------------------------------------- 1 | # TarsBenchmark FAQ 2 | 3 | ### What's the meaning of -s parameter 4 | 5 | 1.The rate unit is TPS(Transports Per Second) of a single target machine specified by -s. If there are n target machines, the total TPS = rate*n
6 | 2.If you do not specify -s parameter, tb will try its best to initiate the request to the target machine. 7 | 8 | ### How to achieve high performance of tb 9 | 10 | 1.The tool will create the same number of child processes by the source machine's cores, and the number of connections and flow will be divided equally among the child processes.
11 | 2.Through event-driven to avoid network IO blocking process, maximize CPU utilization, 12 | 13 | ### How to synchronize data synchronization between main process and child process ? 14 | 15 | Data sharing is achieved through a lock-free shared memory queue, and the statistical results are output in the main process 16 | -------------------------------------------------------------------------------- /question/tarscpp-question.md: -------------------------------------------------------------------------------- 1 | 2 | 1. How to build the Tars C++ development environment? 3 | > * Please reference tars_install.md 4 | 5 | 2. How to quickly implement an example of a Tars C++? 6 | > * For documentation, please refer to tars_cpp_quickstart.md, the relevant sample code, and the examples directory. 7 | 8 | 3. What is the tars/tup protocol? 9 | > * For specific information, please refer to tars_tup.md. 10 | 11 | 4. Does Tars C++ support custom protocols (such as: HTTP)? 12 | > * In addition to supporting tars/tup protocol, Tars C++ also supports business custom protocols. Please refer to tars_cpp_thirdprotocol.md for more details. 13 | 14 | 5. How does Tars C++ pull the business configuration file? 15 | > * Tars C++ supports obtaining the specified business configuration file by using the addConfig method. The specific usage of business configuration can be referred to tars_config.md. 16 | 17 | 6. How is the service running in the Tars framework monitored? 18 | > * For specific information, please refer to tars_server_monitor.md 19 | 20 | 7. How to create a Tars C++ communicator? 21 | > * If the service is based on the TAF framework, please get it directly from Applicatin and do not create it by yourself. For example: 22 | ``` 23 | Application::getCommunicator()->stringToProxy(ServerConfig::Notify); 24 | ``` 25 | > * If the service is not based on the TAF framework, just the TAF client, you can initialize communicator with new Communicator (CONF). For example: 26 | ``` 27 | TC_Config conf(“config.conf”); 28 | CommunicatorPtr c = new Communicator(conf); 29 | ``` 30 | 31 | 8. How to set the timeout time of the Tars C++ invoke? 32 | > * For more details, please refer to tars_cpp_user_guide.md 33 | 34 | 9. After the service is released but not running, how can we find out the reason? 35 | > * Whether the service configuration file is not properly obtained. For example, the configuration file name configured on the web platform is inconsistent with the configuration file name that was downloaded from the program add. 36 | > * When looking for a problem, first look at whether the "service current report" on web is prompted to be normal, for example: a configuration file has a configuration file that has not been downloaded successfully, and the service is downloaded when it is started. 37 | > * Look for the log log that you print for the service. Logs are usually in the /usr/local/app/tars/app_log/ application name/service name/directory. 38 | > * If there is still a problem, check the node log. 39 | 40 | 10. How does the core file be opened and where is it generated? 41 | > * The core file is opened when the tafnode startup script is added to the ulimite -c unlimited, and the current core file is generated under the /usr/local/app/tars/app_log directory. 42 | 43 | 11. Does the failure of master Registry affect the normal access of business services? 44 | > * Without affecting the normal access to business services, the bottom of the framework will cache the IP list of the backend services. 45 | 46 | 12. How does the communicator Communicator get ip:prot through ServerName? 47 | > * 1.When the agent is created, it does not ask the master to get the IP list. Instead, it triggers the request area to get the master IP list when calling the proxy's interface. 48 | > * 2.If there is IP list information behind obj, it is equivalent to direct connection. This will not ask for master registry. 49 | > * 3.If there is no IP list information behind obj, it is quite indirect and will ask for master registry. 50 | > * 4.The strategy for requesting master registry: if the local cache has a list of IP for the requested obj, use a local cache of IP lists, and also asynchronously request the master registry to get the latest IP list 51 | > * 5.The strategy of requesting master registry: if there is no IP list in the local cache that has no cache request obj, the request of the business will be put into the queue, and the master control is requested to get the IP list asynchronously, after getting the IP list, then the request of the service is taken out from the queue and the request is sent. 52 | > * 6.Instead of refreshing each time and refreshing at regular intervals (default 60s), the trigger for timing refresh is business request. 53 | -------------------------------------------------------------------------------- /question/tarsjava-question.md: -------------------------------------------------------------------------------- 1 | # TarsJava FAQ 2 | 3 | ### How to start and develop/debug tars 4 | 5 | > * 1. mvn tars:build -Dapp=TestApp -Dserver=HelloJavaServer -DjvmParams="-Xms1024m -Xmx1024m -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xdebug -Xrunjdwp:transport=dt\_socket,address=9000,server=y,suspend=n" 6 | > * 2. start service in target/tars/bin/tars\_start 7 | 8 | -------------------------------------------------------------------------------- /question/tarsnodejs-question.md: -------------------------------------------------------------------------------- 1 | # TarsNodejs FAQ 2 | 3 | ### When node.js applications developed egg framework in tars, they may fail in release or restart. Why? 4 | 5 | > * When egg doesn't use in single mode, it will open an independent worker process to listen to ports. When applications release or restart in tars, listening process won't be killed. So the port will be used and cannot be listened. The service cannot be started. 6 | > * Process management of Tars Nodejs, named node-agent, including Cluster sub-process, exception monitoring, process pull-up, monitoring and reporting, etc. Ordinary Nodejs programs naturally have the above features as long as they are released on the Tars platform, and there is no need to do their own process management. 7 | 8 | -------------------------------------------------------------------------------- /question/tarsphp-question.md: -------------------------------------------------------------------------------- 1 | # TarsPHP FAQ 2 | 3 | ### Q: Where can check service log? 4 | 5 | A: /usr/local/app/tars/app\_log/$APPNAME/$SERVERNAME/$APPNAME.$SERVERNAME.log. Don't forget to check php\_error. 6 | 7 | ### Q: Class 'TARS\_Struct' not found in /usr/local/app/tars/tarsnode/data/PHPTest.PHPHttpServer/bin/src/vendor/phptars/tars-report/src/ServerInfo.php on line 5 8 | 9 | A: Please check whether installed phptars. 10 | Command: php -m \| grep phptars 11 | Installation: please check script and documentation of auto and auto7 in /php/php\_extension. 12 | 13 | ### Q: The tcp service does not return packets correctly when http and tcp services are built. Why 14 | 15 | A: Check whether the status of the tcp service is normal, and check whether the service cannot be started due to the php\ _ error and the permission in the business log. Check whether the tcp service uses the correct template. For example, you cannot specify protocolName as http, because the tcp service must use the tars protocol for communication, and you must specify configuration parameters such as package\ _ length of swoole automatic parcel. Use tcpdump-iany-s0 port tcp service port-XNNnn to grab packets to see if the http service has properly sent packets to the tcp service. 16 | 17 | ### Q: Can I start php service without tars platform? 18 | 19 | A: Obviously, it is possible to go directly to the service directory: /usr/local/app/tars/tarsnode/data/PHPTest.PHPHttpServer/bin there will be two scripts tars\ _ stop.sh and tars\ _ start.sh, that can directly start and stop the service as long as they have permission. 20 | 21 | ### Q: Why part of methods to request tcp work, part cannot? 22 | 23 | A: Maybe you use format tool, which hurt server format. (eg. examples/Tars-tcp-server/src/servant/PHPtest/PHPServer/obj/TestTafServiceServant.php\). Please download the lastest version in GitHub, or re-build interface of server by tars2php. 24 | 25 | ### Q: How to deal with it cannot get parameters, and it shows 'illegalargumentException' after calling java service, . 26 | 27 | A: Java support for tup has not been released before. But now you need to recompile the two jar packages tars-core and maven-tars-plugin, and add the word true to the plugin configuration in the pom.xml of the project, so that you can support php to call the default tup protocol after generation. The regenerated interface file will be annotated: @ TarsMethodParameter, so that it can be parsed normally. 28 | 29 | ### Attention 30 | 31 | Make sure you install phptars extensions. If you use server, please install swoole extensions also. 32 | 33 | --------------------------------------------------------------------------------