模板配置

    框架的模版配置文件由父模版、主模版、私有模版配置来组织。

    父模版和主模版的配置信息,存放在db_tars/t_profile_template数据表里,表结构如下

    私有模版信息,存放在db_tars/t_server_conf数据表的profile字段里面。

    模板配置

    注意模版中有db.tars.com时,需要修改成部署数据库的机器ip

    模版名称:tars.default(所有服务的模版都直接或者间接继承这个模版)

    内容:

    tars.tarsconfig模版

    内容:

    1. <application>
    2. enableset=${enableset}
    3. setdivision=${setdivision}
    4. <client>
    5. locator=${locator}
    6. sync-invoke-timeout=3000
    7. async-invoke-timeout=5000
    8. refresh-endpoint-interval=60000
    9. report-interval=60000
    10. sample-rate=100000
    11. max-sample-count=50
    12. asyncthread=${asyncthread}
    13. modulename=${modulename}
    14. </client>
    15. <server>
    16. app=${app}
    17. server=${server}
    18. localip=${localip}
    19. local=${local}
    20. basepath=${basepath}
    21. datapath=${datapath}
    22. logpath=${logpath}
    23. logsize=10M
    24. config=tars.tarsconfig.ConfigObj
    25. notify=tars.tarsnotify.NotifyObj
    26. log=tars.tarslog.LogObj
    27. deactivating-timeout=3000
    28. logLevel=DEBUG
    29. </server>
    30. </application>
    31. <db>
    32. charset=utf8
    33. dbhost=db.tars.com
    34. dbname=db_tars
    35. dbpass=tars2015
    36. dbport=3306
    37. dbuser=tars
    38. </db>
    39. </tars>

    tars.tarslog模版

    模版名称:tars.tarslog(继承tars.default)

    内容:

    1. <tars>
    2. <application>
    3. enableset=${enableset}
    4. setdivision=${setdivision}
    5. <client>
    6. locator=${locator}
    7. sync-invoke-timeout=3000
    8. async-invoke-timeout=5000
    9. refresh-endpoint-interval=60000
    10. stat=tars.tarsstat.StatObj
    11. property=tars.tarsproperty.PropertyObj
    12. report-interval=60000
    13. sample-rate=100000
    14. max-sample-count=50
    15. asyncthread=${asyncthread}
    16. modulename=${modulename}
    17. </client>
    18. <server>
    19. app=${app}
    20. server=${server}
    21. localip=${localip}
    22. local=${local}
    23. basepath=${basepath}
    24. datapath=${datapath}
    25. logpath=${logpath}
    26. logsize=100000000
    27. config=tars.tarsconfig.ConfigObj
    28. notify=tars.tarsnotify.NotifyObj
    29. log=tars.tarslog.LogObj
    30. deactivating-timeout=3000
    31. logLevel=ERROR
    32. </server>
    33. </application>
    34. <log>
    35. logpath=/usr/local/app/tars/remote_app_log
    36. logthread=10
    37. <format>
    38. hour=xx
    39. </format>
    40. </log>

    模版名称:tars.tarsnotify(继承tars.default)

    内容:

    tars.tarspatch模版

    模版名称:tars.tarspatch(继承tars.default)

    内容:

    1. <tars>
    2. directory=/usr/local/app/patchs/tars
    3. uploadDirectory=/usr/local/app/patchs/tars.upload
    4. size=100M
    5. <application>
    6. enableset=${enableset}
    7. setdivision=${setdivision}
    8. <client>
    9. sync-invoke-timeout=3000
    10. async-invoke-timeout=5000
    11. refresh-endpoint-interval=60000
    12. report-interval=60000
    13. sample-rate=100000
    14. max-sample-count=50
    15. asyncthread=${asyncthread}
    16. modulename=${modulename}
    17. </client>
    18. <server>
    19. app=${app}
    20. server=${server}
    21. localip=${localip}
    22. local=${local}
    23. basepath=${basepath}
    24. datapath=${datapath}
    25. logpath=${logpath}
    26. logsize=10M
    27. config=tars.tarsconfig.ConfigObj
    28. notify=tars.tarsnotify.NotifyObj
    29. log=tars.tarslog.LogObj
    30. deactivating-timeout=3000
    31. logLevel=DEBUG
    32. </server>
    33. </application>
    34. </tars>

    tars.tarsproperty模版

    内容:

    1. <tars>
    2. 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
    3. <application>
    4. enableset=${enableset}
    5. setdivision=${setdivision}
    6. <client>
    7. locator=${locator}
    8. sync-invoke-timeout=3000
    9. async-invoke-timeout=5000
    10. refresh-endpoint-interval=60000
    11. report-interval=60000
    12. sample-rate=100000
    13. max-sample-count=50
    14. asyncthread=${asyncthread}
    15. modulename=${modulename}
    16. </client>
    17. <server>
    18. app=${app}
    19. server=${server}
    20. localip=${localip}
    21. local=${local}
    22. basepath=${basepath}
    23. datapath=${datapath}
    24. logpath=${logpath}
    25. logsize=10M
    26. config=tars.tarsconfig.ConfigObj
    27. notify=tars.tarsnotify.NotifyObj
    28. log=tars.tarslog.LogObj
    29. deactivating-timeout=3000
    30. logLevel=DEBUG
    31. </server>
    32. </application>
    33. <db>
    34. charset
    35. dbhost=db.tars.com
    36. dbname=tars
    37. dbport=3306
    38. dbuser=tars
    39. dbpass=tars2015
    40. </db>
    41. <multidb>
    42. <db1>
    43. dbhost=db.tars.com
    44. dbname=tars_property
    45. tbname=tars_property_
    46. dbuser=tars
    47. dbpass=tars2015
    48. dbport=3306
    49. charset=utf8
    50. </db1>
    51. <db2>
    52. dbhost=db.tars.com
    53. dbname=tars_property
    54. tbname=tars_property_
    55. dbuser=tars
    56. dbpass=tars2015
    57. dbport=3306
    58. </db2>
    59. </multidb>
    60. <hashmap>
    61. factor=1.5
    62. insertInterval=5
    63. maxBlock=200
    64. minBlock=100
    65. size=10M
    66. </hashmap>
    67. <reapSql>
    68. Interval=10
    69. sql=insert ignore into t_master_property select master_name, property_name, policy from ${TABLE} group by master_name, property_name, policy;
    70. </reapSql>
    71. </tars>

    模版名称:tars.tarsstat(继承tars.default)

    内容:

    tars.tarsquerystat模版

    模版名称:tars.tarsquerystat(继承tars.default)

    1. <tars>
    2. <application>
    3. #是否启用SET分组
    4. enableset=${enableset}
    5. #SET分组的全名.(mtt.s.1)
    6. setdivision=${setdivision}
    7. <client>
    8. #地址
    9. locator =${locator}
    10. #同步调用超时时间,缺省3s(毫秒)
    11. sync-invoke-timeout = 3000
    12. #异步超时时间,缺省5s(毫秒)
    13. async-invoke-timeout =5000
    14. #重新获取服务列表时间间隔(毫秒)
    15. refresh-endpoint-interval = 60000
    16. #模块间调用服务[可选]
    17. stat = tars.tarsstat.StatObj
    18. #属性上报服务[可选]
    19. property = tars.tarsproperty.PropertyObj
    20. #上报间隔时间,默认60s(毫秒)
    21. report-interval = 60000
    22. #stat采样比1:n 例如sample-rate为1000时 采样比为千分之一
    23. sample-rate = 100000
    24. #1分钟内stat最大采样条数
    25. max-sample-count = 50
    26. #网络异步回调线程个数
    27. asyncthread = ${asyncthread}
    28. #模块名称
    29. modulename = ${modulename}
    30. </client>
    31. #定义所有绑定的IP
    32. <server>
    33. #应用名称
    34. app = ${app}
    35. #服务名称
    36. server = ${server}
    37. #本地ip
    38. localip = ${localip}
    39. #本地管理套接字[可选]
    40. local = ${local}
    41. #服务的数据目录,可执行文件,配置文件等
    42. basepath = ${basepath}
    43. #
    44. datapath = ${datapath}
    45. #日志路径
    46. logpath = ${logpath}
    47. #日志大小
    48. logsize = 10M
    49. #日志数量
    50. # lognum = 10
    51. #配置中心的地址[可选]
    52. config = tars.tarsconfig.ConfigObj
    53. #信息中心的地址[可选]
    54. notify = tars.tarsnotify.NotifyObj
    55. #远程LogServer[可选]
    56. log = tars.tarslog.LogObj
    57. #关闭服务时等待时间
    58. deactivating-timeout = 3000
    59. #滚动日志等级默认值
    60. logLevel=DEBUG
    61. </server>
    62. </application>
    63. <countdb>
    64. <db1>
    65. dbhost=db.tars.com
    66. dbname=tars_stat
    67. tbname=tars_stat_
    68. dbuser=tars
    69. dbpass=tars2015
    70. dbport=3306
    71. charset=utf8
    72. </db1>
    73. </countdb>
    74. </tars>

    tars.tarsqueryproperty 模版

    模版名称:tars.tarsqueryproperty(继承tars.default)

    
    

    模版名称:.tars.tarsjava.default(继承tars.default,所有tarsjava服务的模版都直接或者间接继承这个模版)

    内容: