Giter Site home page Giter Site logo

tarscloud / tars Goto Github PK

View Code? Open in Web Editor NEW
9.8K 669.0 2.1K 15.59 MB

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.

License: BSD 3-Clause "New" or "Revised" License

C++ 100.00%
rpc-framework high-performance high-availability microservice tars-foundation tars

tars's Introduction

TARS - A Linux Foundation Project

What is TARS?

TARS is a Linux Foundation project. It is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

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 development, deployment and testing service efficiently. 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.

Nowadays it's used by hundreds of bussiness in Tencent, services that developed base on TAF run on 16 thousands of machines.

See the detailed introduction SUMMARY.md.

Supported platforms

For now it supports OS as below:

  • Linux
  • Mac(>=2.1.0 support)
  • Windows (>= Windows 7)

Supported languages

For now it supports following languages:

  • C++
  • Java
  • Nodejs
  • PHP
  • Go

Version Management

Tars is composed of many modules, scattered in many warehouses, and the basic framework version and language version can develop independently. In view of this, from version 2.1.0, the Framework version tag is printed on the tarsframework warehouse, no longer reflected in the tars warehouse

In addition, each component will have its own version. When there is a version dependency specification, each component will have its own version

Installation

  1. If you are new to Tars, please read documentation installation.
  2. First deploy, please read documentation source.
  3. Install by docker, detail information: docker

Submodule

Directory Features
framework Source code implementation of C++ language framework basic service
cpp C++ language framework rpc source code implementation
java java language framework rpc source code implementation
go go language framework rpc source code implementation
nodejs nodejs language framework rpc source code implementation
php php language framework rpc source code implementation
tup source code implementation of tup group protocol in each language
web manage tars web source implementation

Developer's documentation

See docs.

License

The open-source protocol Tars used is BSD-3-Clause, see LICENSE.md.

Chinese Version

Read Chinese Version

tars's People

Contributors

bartdong avatar bobzhangyong avatar change93 avatar copyrenzhe avatar dpp2009 avatar etzhangsx avatar fr1ck avatar franklee0817 avatar helloopenworld avatar jerrylucky avatar katharineozil avatar lanffy avatar lawlietlee avatar lawlietli avatar loveyacper avatar marklightning avatar medns avatar meijing0114 avatar meiping avatar qiuxin avatar ruanshudong avatar sandyskies avatar souldancer avatar spacebody avatar sy-records avatar tarscloudbot avatar tokisakikurumi avatar wjx82850707 avatar yuansx avatar zerolocusta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tars's Issues

gradle的支持

请问下Android客户端中在gradle中怎么使用"tars-maven-plugin"插件?

What's the differences between Tars and MSEC?

Tencent MSEC:

It is a backend DEV &OPS engine, including RPC,name finding,load balance,monitoring,release and capacity management.

Tencent Tars:

Tars is a highly performance rpc framework based on naming service using tars protocol and provides a semi-automatic operation platform.

As I understand, the functionalities of Tars seem to be a subset of MSEC. Have I understood correctly?

stat上报监控问题

issue from 友缘@qq

comm.setProperty("stat", "tars.tarsstat.StatObj");
StatReport * pReport = comm.getStatReport();
if (pReport)
{
statPrx = pReport->getStatPrx();
}

               std::vector<tars::StatSampleMsg> vecMsg;
                tars::StatSampleMsg msg;
                msg.interfaceName = "test_stat";
                iRet = statPrx->reportSampleMsg(vecMsg);
                cout << "stat|iRet[" << i << "]:" << iRet << endl;

我客户端在通信器设置了stat,但并没有在管理页面上看到服务端被调用过的监控记录。上面是我测试通信器的统计上报,通过查看打印出来的日志和stat的日志,可以确认stat是可以连上的,还需要设置什么才能成功让我的客户端上报调用服务端的统计呢?

如何不通过指定端口和IP,实现TestHelloClient

HelloPrx prx;
comm.stringToProxy("TestApp.HelloServer.HelloObj@tcp -h 10.120.129.226 -p 20001" , prx);

这行代码如何改成不用指定端口和ip那种的,据说是可以通过调用tars的一个服务或者调度器,有这个功能的相关文档吗?
或者这个功能是可实现的吗?

web乱码

web管理界面部署后汉字乱码,使用utf-8编码,默认支持什么编码?

关于RegistryServer的高可用设计实现的疑问?

通过个人阅读tars的设计文档理解,RegistryServer作为服务注册发现的服务,client会通过其查询到业务server的可用ip列表,节点server也会通过心跳将业务server状态同步到RegistryServer。有以下疑问,还请熟悉tars的同学解答下:

  1. RegistryServer本身是无状态的吗,还是多个RegistryServer形成集群会通过paxos协议自动确定主从?
  2. 浏览代码看到其一些数据是存在DB中的,那么RegistryServer是否依赖DB集群实现读写的高可用(client会读RegistryServer、节点server会写RegistryServer)?
  3. 是否每一次client调用都会先去读RegistryServer获取可用ip列表,如果是的话RegistryServer服务的压力应该很大,直接读DB的压力如何缓解?

setProperty参数怎么设置?

issues from QQ群579079160 友缘

自己写的一段demo程序,需要在通信器里主动设置下tarsstat的地址
这个接口是setProperty,参数是怎样设置的?

部署申请失败,请问要改哪里的Java代码

数据库库MYSQL5.7.13patch_time插入非法值导致的”0000:00:00 00:00:00”,请问要改JAVA哪里的代码?

{"attached":{"uri":"/pages/server/api/deploy_server","url":"http://192.168.1.185:8080/pages/server/api/deploy_server","method":"POST","referer":"http://192.168.1.185:8080/server_deploy.html"},"ret_code":500,"sub_code":"","err_msg":"\n### Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '0000:00:00 00:00:00' for column 'patch_time' at row 1\n### The error may involve defaultParameterMap\n### The error occurred while setting parameters\n### SQL: INSERT INTO db_tars.t_server_conf ( application, server_name, node_group, node_name, base_path, exe_path, template_name, bak_flag, setting_state, present_state, process_id, patch_version, patch_time, patch_user, tars_version, posttime, lastuser, server_type, start_script_path, stop_script_path, monitor_script_path, enable_group, enable_set, set_name, set_area, set_group, ip_group_name, profile, config_center_port, async_thread_num, server_important_type, remote_log_reserve_time, remote_log_compress_time, remote_log_type ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )\n### Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '0000:00:00 00:00:00' for column 'patch_time' at row 1\n; SQL []; Data truncation: Incorrect datetime value: '0000:00:00 00:00:00' for column 'patch_time' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '0000:00:00 00:00:00' for column 'patch_time' at row 1"}

在搭建环境的时候碰到mysql错误

在搭建环境的时候碰到mysql错误,这个是什么原因呢?
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
2017-07-24 04:24:32 12342 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

脚本及Java 有关datatime 字段默认值兼容性问题

已有脚本默认值为:
t_server_conf表 patch_time、posttime字段的默认值为:'0000-00-00 00:00:00',
同时com.qq.tars.entity.ServerConf Java类里面的patchTime和posttime字段默认值也为'0000-00-00 00:00:00'

建议将这两个datatime类型脚本及Java 类的默认值修改成:'1000-01-01 00:00:00',这样针对5.7版本MySQL默认值就不需要做任何自定义调整,同时兼容5.6、5.7,更具备通用性

添加tarsstat服务上不去

感觉应该是很简单的一个点,按照文档操作,上传的tarsstat包实在build文件夹下找到的,点击发布
出现:服务发布失败:tars.tarsregistry.QueryObj|connect failed to 10.99.1.132:17890
怎么回事呢,上传的文件不对吗,应该上传哪个文件,或者还是别的地方出了问题

tars各个自带的服务都是做什么的,又是怎么保障他们的可靠性的?

tars自带的服务有哪些?除了页面看到的tarsconfig/tarslog/tarsnotify/tarspatch/tarsproperty/tarsqueryproperty/tarsquerystat/tarsstat,还有不在管理页面显示的tarsregistry/tarsnode/tarsAdminRegistry,还有其他的服务吗?他们各个服务的具体功能有文档说明吗?除了页面上显示的可以看到他们的状态信息,没显示的怎么方便看到他们的状态信息?又是怎么保障各个服务的高可靠性的?用户又是怎么知道当前的服务是稳定?比如用户重启了服务器后,只需要看下管理页面上的状态信息就能确保服务是正常的吗?如果类似tarsAdminRegistry或者其他服务down了,是否会其他tars服务,如果不影响,那么我看到的管理页面信息都显示正常,我又怎么知道有服务down了?

web-运维管理-部署服务-部署申请 有bug

部署申请点击提交时,弹窗提示“布署申请提交失败!请联系管理员”,后台插入数据库异常
`
org.springframework.dao.DataIntegrityViolationException:

Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '0000:00:00 00:00:00' for column 'patch_time' at row 1

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: INSERT INTO db_tars.t_server_conf ( application, server_name, node_group, node_name, base_path, exe_path, template_name, bak_flag, setting_state, present_state, process_id, patch_version, patch_time, patch_user, tars_version, posttime, lastuser, server_type, start_script_path, stop_script_path, monitor_script_path, enable_group, enable_set, set_name, set_area, set_group, ip_group_name, profile, config_center_port, async_thread_num, server_important_type, remote_log_reserve_time, remote_log_compress_time, remote_log_type ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '0000:00:00 00:00:00' for column 'patch_time' at row 1

`

框架基础服务打包出错求助

我按照安装文档Install.md进行安装配置到4.1节时,在/cpp/build/目录下执行make framework-tar报错,报错信息是make: *** No rule to make target `framework-tar'. Stop.求指教是什么问题?小白求教

用底层通用代码测试一个https请求,报错!底层是否支持ssl?

TC_HttpRequest stHttpReq;
stHttpReq.setGetRequest("https://api.bitfinex.com/v1/pubticker/btcusd");
TC_HttpResponse stHttpRep;
int iRet = stHttpReq.doRequest(stHttpRep, 3000);
if(iRet != 0)
{
cout << iRet << endl;
}

string r = stHttpRep.encode();
cout << r << endl;
cout << "***********************************" << endl;

TC_File::save2file("tmp.html", stHttpRep.getContent());
cout << "***********************************" << endl;
cout << stHttpRep.getContent().length() << endl;

错误信息:
HTTP/1.1 400 Bad Request
CF-RAY: -
Connection: close
Content-Length: 275
Content-Type: text/html
Date: Sat, 12 Aug 2017 11:09:34 GMT
Server: cloudflare-nginx

<title>400 The plain HTTP request was sent to HTTPS port</title>

400 Bad Request

The plain HTTP request was sent to HTTPS port
cloudflare-nginx

调度器调度的实现

issues from QQ群579079160 生生

  comm.stringToProxy("TestApp.HelloServer.HelloObj@tcp -h 10.120.129.226 

   -p 20001" , prx);

这行代码通过调度器调度的方式怎么写

tars接口一直获取不了spring容器里的bean

我这边一直获取不到,我看了日志,spring初始化的时候都是正常完成了,初始化完成后也能取到我设置内容,但通过tars接口就取不到了。请问通过tars接口能取到spring容器的bean吗。
@servant
public interface TestServant {
public String request(String requestXml);
}

public class TestServantImpl implements TestServant {

private ServiceUtils serviceUtils;

private String test;
public String request(String requestXml) {
	if (serviceUtils == null) {
		return "serviceUtils is null";
	} else {
		try {
			return serviceUtils.doInvoke(requestXml);
		} catch (Exception e) {
			return "exception";
		}
	}
}

public ServiceUtils getServiceUtils() {
	return serviceUtils;
}

public void setServiceUtils(ServiceUtils serviceUtils) {
	this.serviceUtils = serviceUtils;
}

public void init() {
	System.out.println("---------init servant----------");
	System.out.println("---------"+test+"----------");
	if(serviceUtils==null){
		System.out.println("---------serviceUtils is null----------");
	}else{
		System.out.println("---------serviceUtils is not null----------");
	}
}

public String getTest() {
	return test;
}

public void setTest(String test) {
	this.test = test;
}

}

<bean name="serviceUtils" class="com.rzt.business.atom.util.ServiceUtils">
	<property name="genericService" ref="genericService"></property>
</bean>
<bean name="testServantImpl" class="com.server.test.impl.TestServantImpl"  init-method="init">
	<property name="serviceUtils" ref="serviceUtils"></property>
	<property name="test" value="dddd"></property>
</bean>

下面是spring初始化时的部分日志,这里说明spring已经实例化了serviceUtils,但接口调用的时候serviceUtils 就为空了:
[LOG] [SYSTEM] [目录[commonConf]无可用的commonParam配置文件]
---------init servant----------
---------dddd----------
---------serviceUtils is not null----------
四月 17, 2017 4:37:30 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom

调用tars接口后返回的结果:
INFO tars-log | set tars-log default level=INFO
INFO tars-log | try to set tars-log.root from java system property (server.root)
INFO tars-log | set tars-log defaultRoot=\log
serviceUtils is null

tarsquerystat and tarsqueryproperty can not start

when start the tarsquery* service , it report to me the error:

exit: [TARS]ServantHelperManager::addServant tars.tarsquerystat.NoTarsObj not find adapter.(maybe not conf in the web)

i try to find some problem, and check every config. but got nothing. i follow the doc to install doc.

如何快速迭代更新tars

据我所知, Tars在腾讯内部使用叫taf. 开源出来是出于各种原因的考虑.

那么现在问题来了, 如何做到tars的快速迭代新功能.

  • 有些issue, 可能已经在内部系统里解决了, 或都实现方式不一样.
  • 新功能社区发现了, 而内部系统未发现
  • 是否可参考众多开源软件, 内部是基于开源的tars. (如docker 分离出mobi)

Failed to retrieve plugin descriptor for qq-cloud-central:tars-maven-plugin:1.0.1

跟着教程走的到 mvn tars:tars2java 的时候出现这个错,无法继续,google 了一下,也没找到 qq-cloud-central:tars-maven-plugin 这个依赖,我感觉这个是不是腾讯云内部的 repository 里才有的,可否发布到 mvnrepository.com 方便外部使用?

Failed to retrieve plugin descriptor for qq-cloud-central:tars-maven-plugin:1.0.1: Plugin qq-cloud-central:tars-maven-plugin:1.0.1 or one of its dependencies could not be resolved: Failure to find qq-cloud-central:tars-maven-plugin:jar:1.0.1

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.