模板配置
框架的模版配置文件由父模版、主模版、私有模版配置来组织。
父模版和主模版的配置信息,存放在db_tars/t_profile_template数据表里,表结构如下
私有模版信息,存放在db_tars/t_server_conf数据表的profile字段里面。
模板配置
注意模版中有db.tars.com时,需要修改成部署数据库的机器ip
模版名称:tars.default(所有服务的模版都直接或者间接继承这个模版)
内容:
tars.tarsconfig模版
内容:
<application>
enableset=${enableset}
setdivision=${setdivision}
<client>
locator=${locator}
sync-invoke-timeout=3000
async-invoke-timeout=5000
refresh-endpoint-interval=60000
report-interval=60000
sample-rate=100000
max-sample-count=50
asyncthread=${asyncthread}
modulename=${modulename}
</client>
<server>
app=${app}
server=${server}
localip=${localip}
local=${local}
basepath=${basepath}
datapath=${datapath}
logpath=${logpath}
logsize=10M
config=tars.tarsconfig.ConfigObj
notify=tars.tarsnotify.NotifyObj
log=tars.tarslog.LogObj
deactivating-timeout=3000
logLevel=DEBUG
</server>
</application>
<db>
charset=utf8
dbhost=db.tars.com
dbname=db_tars
dbpass=tars2015
dbport=3306
dbuser=tars
</db>
</tars>
tars.tarslog模版
模版名称:tars.tarslog(继承tars.default)
内容:
<tars>
<application>
enableset=${enableset}
setdivision=${setdivision}
<client>
locator=${locator}
sync-invoke-timeout=3000
async-invoke-timeout=5000
refresh-endpoint-interval=60000
stat=tars.tarsstat.StatObj
property=tars.tarsproperty.PropertyObj
report-interval=60000
sample-rate=100000
max-sample-count=50
asyncthread=${asyncthread}
modulename=${modulename}
</client>
<server>
app=${app}
server=${server}
localip=${localip}
local=${local}
basepath=${basepath}
datapath=${datapath}
logpath=${logpath}
logsize=100000000
config=tars.tarsconfig.ConfigObj
notify=tars.tarsnotify.NotifyObj
log=tars.tarslog.LogObj
deactivating-timeout=3000
logLevel=ERROR
</server>
</application>
<log>
logpath=/usr/local/app/tars/remote_app_log
logthread=10
<format>
hour=xx
</format>
</log>
模版名称:tars.tarsnotify(继承tars.default)
内容:
tars.tarspatch模版
模版名称:tars.tarspatch(继承tars.default)
内容:
<tars>
directory=/usr/local/app/patchs/tars
uploadDirectory=/usr/local/app/patchs/tars.upload
size=100M
<application>
enableset=${enableset}
setdivision=${setdivision}
<client>
sync-invoke-timeout=3000
async-invoke-timeout=5000
refresh-endpoint-interval=60000
report-interval=60000
sample-rate=100000
max-sample-count=50
asyncthread=${asyncthread}
modulename=${modulename}
</client>
<server>
app=${app}
server=${server}
localip=${localip}
local=${local}
basepath=${basepath}
datapath=${datapath}
logpath=${logpath}
logsize=10M
config=tars.tarsconfig.ConfigObj
notify=tars.tarsnotify.NotifyObj
log=tars.tarslog.LogObj
deactivating-timeout=3000
logLevel=DEBUG
</server>
</application>
</tars>
tars.tarsproperty模版
内容:
<tars>
sql=CREATE TABLE `${TABLE}` (`stattime` timestamp NOT NULL default CURRENT_TIMESTAMP,`f_date` date NOT NULL default '1970-01-01', `f_tflag` varchar(8) NOT NULL default '',`master_name` varchar(128) NOT NULL default '',`master_ip` varchar(16) default NULL,`property_name` varchar(100) default NULL,`set_name` varchar(15) NOT NULL default '',`set_area` varchar(15) NOT NULL default '',`set_id` varchar(15) NOT NULL default '',`policy` varchar(20) default NULL,`value` varchar(255) default NULL, KEY (`f_date`,`f_tflag`,`master_name`,`master_ip`,`property_name`,`policy`),KEY `IDX_MASTER_NAME` (`master_name`),KEY `IDX_MASTER_IP` (`master_ip`),KEY `IDX_TIME` (`stattime`)) ENGINE\=Innodb
<application>
enableset=${enableset}
setdivision=${setdivision}
<client>
locator=${locator}
sync-invoke-timeout=3000
async-invoke-timeout=5000
refresh-endpoint-interval=60000
report-interval=60000
sample-rate=100000
max-sample-count=50
asyncthread=${asyncthread}
modulename=${modulename}
</client>
<server>
app=${app}
server=${server}
localip=${localip}
local=${local}
basepath=${basepath}
datapath=${datapath}
logpath=${logpath}
logsize=10M
config=tars.tarsconfig.ConfigObj
notify=tars.tarsnotify.NotifyObj
log=tars.tarslog.LogObj
deactivating-timeout=3000
logLevel=DEBUG
</server>
</application>
<db>
charset
dbhost=db.tars.com
dbname=tars
dbport=3306
dbuser=tars
dbpass=tars2015
</db>
<multidb>
<db1>
dbhost=db.tars.com
dbname=tars_property
tbname=tars_property_
dbuser=tars
dbpass=tars2015
dbport=3306
charset=utf8
</db1>
<db2>
dbhost=db.tars.com
dbname=tars_property
tbname=tars_property_
dbuser=tars
dbpass=tars2015
dbport=3306
</db2>
</multidb>
<hashmap>
factor=1.5
insertInterval=5
maxBlock=200
minBlock=100
size=10M
</hashmap>
<reapSql>
Interval=10
sql=insert ignore into t_master_property select master_name, property_name, policy from ${TABLE} group by master_name, property_name, policy;
</reapSql>
</tars>
模版名称:tars.tarsstat(继承tars.default)
内容:
tars.tarsquerystat模版
模版名称:tars.tarsquerystat(继承tars.default)
<tars>
<application>
#是否启用SET分组
enableset=${enableset}
#SET分组的全名.(mtt.s.1)
setdivision=${setdivision}
<client>
#地址
locator =${locator}
#同步调用超时时间,缺省3s(毫秒)
sync-invoke-timeout = 3000
#异步超时时间,缺省5s(毫秒)
async-invoke-timeout =5000
#重新获取服务列表时间间隔(毫秒)
refresh-endpoint-interval = 60000
#模块间调用服务[可选]
stat = tars.tarsstat.StatObj
#属性上报服务[可选]
property = tars.tarsproperty.PropertyObj
#上报间隔时间,默认60s(毫秒)
report-interval = 60000
#stat采样比1:n 例如sample-rate为1000时 采样比为千分之一
sample-rate = 100000
#1分钟内stat最大采样条数
max-sample-count = 50
#网络异步回调线程个数
asyncthread = ${asyncthread}
#模块名称
modulename = ${modulename}
</client>
#定义所有绑定的IP
<server>
#应用名称
app = ${app}
#服务名称
server = ${server}
#本地ip
localip = ${localip}
#本地管理套接字[可选]
local = ${local}
#服务的数据目录,可执行文件,配置文件等
basepath = ${basepath}
#
datapath = ${datapath}
#日志路径
logpath = ${logpath}
#日志大小
logsize = 10M
#日志数量
# lognum = 10
#配置中心的地址[可选]
config = tars.tarsconfig.ConfigObj
#信息中心的地址[可选]
notify = tars.tarsnotify.NotifyObj
#远程LogServer[可选]
log = tars.tarslog.LogObj
#关闭服务时等待时间
deactivating-timeout = 3000
#滚动日志等级默认值
logLevel=DEBUG
</server>
</application>
<countdb>
<db1>
dbhost=db.tars.com
dbname=tars_stat
tbname=tars_stat_
dbuser=tars
dbpass=tars2015
dbport=3306
charset=utf8
</db1>
</countdb>
</tars>
tars.tarsqueryproperty 模版
模版名称:tars.tarsqueryproperty(继承tars.default)
模版名称:.tars.tarsjava.default(继承tars.default,所有tarsjava服务的模版都直接或者间接继承这个模版)
内容: