123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437 |
- <tars>
- <application>
- #proxy需要的配置
- <client>
- #地址
- locator = TestApp.FrameworkServer.QueryObj@tcp -h 127.0.0.1 -p 11004
- #最大超时时间(毫秒)
- sync-invoke-timeout = 50000
- async-invoke-timeout = 60000
- #刷新端口时间间隔(毫秒)
- refresh-endpoint-interval = 100000
- #模块间调用[可选]
- stat = TestApp.FrameworkServer.StatObj
- #发送队列长度
- sendqueuelimit = 1000000
- #异步回调队列个数限制
- asyncqueuecap = 1000000
- #网络异步回调线程个数
- asyncthread = 3
- #网络线程个数
- netthread = 2
- #合并回调线程和网络线程(以网络线程个数为准)
- mergenetasync = 0
- #模块名称
- modulename = TestApp.HelloServer
- #server crt
- ca = PROJECT_PATH/certs/server.crt
- #can be empty
- cert = PROJECT_PATH/certs/client.crt
- #can be empty
- key = PROJECT_PATH/certs/client.key
- <TestApp.HelloServer.AuthObj>
- #auth access key
- accesskey = tars-test-user
- #auth secret key
- secretkey = 123456
- </TestApp.HelloServer.AuthObj>
- <TestApp.HelloServer.SSL1Obj>
- #server crt
- ca = PROJECT_PATH/certs/server1.crt
- #can be empty
- # cert = PROJECT_PATH/certs/client1.crt
- #can be empty
- # key = PROJECT_PATH/certs/client1.key
- </TestApp.HelloServer.SSL1Obj>
- <TestApp.HelloServer.SSL2Obj>
- #server crt
- ca = PROJECT_PATH/certs/server1.crt
- #can be empty
- cert = PROJECT_PATH/certs/client1.crt
- #can be empty
- key = PROJECT_PATH/certs/client1.key
- </TestApp.HelloServer.SSL2Obj>
- <TestApp.HelloServer.SSL3Obj>
- #auth access key
- accesskey = tars-test-user
- #auth secret key
- secretkey = 123456
- #server crt
- ca = PROJECT_PATH/certs/server1.crt
- #can be empty
- cert = PROJECT_PATH/certs/client1.crt
- #can be empty
- key = PROJECT_PATH/certs/client1.key
- </TestApp.HelloServer.SSL3Obj>
-
- </client>
-
- #定义所有绑定的IP
- <server>
- start_output = ERROR
- closecout = 0
- #应用名称
- app = TestApp
- #服务名称
- server = HelloServer
- #服务的数据目录,可执行文件,配置文件等
- basepath = .
- datapath = .
- #日志路径
- logpath = .
- #网络线程个数
- netthread = 1
- #合并网络和业务线程(以网络线程个数为准)
- mergenetimp = 0
- opencoroutine = 0
- loglevel=TARS
- #本地管理套接字[可选]
- local = tcp -h 127.0.0.1 -p 18001 -t 10000
- #配置中心的地址[可选]
- config = TestApp.FrameworkServer.ConfigObj
- #配置中心的地址[可选]
- # notify = tars.tarsconfig.NotifyObj
- #远程LogServer[可选]
- log = TestApp.FrameworkServer.LogObj
- # manuallisten = 1
- #client crt, it can be empty when verifyclient is 0
- # ca = PROJECT_PATH/certs/client.crt
- cert = PROJECT_PATH/certs/server.crt
- key = PROJECT_PATH/certs/server.key
- ciphers =
- #default is 0
- verifyclient = 1
- #配置绑定端口
- <HelloAdapter>
- #ip:port:timeout
- #endpoint = tcp -h harbor.tars.com -p 45460 -t 60000
- endpoint = tcp -h 127.0.0.1 -p 25460 -t 10000
- #endpoint = udp -h * -p 45460 -t 60000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 5
- #处理对象
- servant = TestApp.HelloServer.HelloObj
- #队列最大包个数
- queuecap = 1000000
- </HelloAdapter>
- <TransAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 15460 -t 60000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 5
- #处理对象
- servant = TestApp.HelloServer.TransObj
- #队列最大包个数
- queuecap = 1000000
- </TransAdapter>
- <TransDstAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 15760 -t 60000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 5
- #处理对象
- servant = TestApp.HelloServer.TransDstObj
- #队列最大包个数
- queuecap = 1000000
- </TransDstAdapter>
- <TransWupAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 15461 -t 60000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 5
- #处理对象
- servant = TestApp.HelloServer.TransWupObj
- #队列最大包个数
- queuecap = 1000000
- protocol = not-tars
- </TransWupAdapter>
- <HttpAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 8080 -t 60000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 5
- #处理对象
- servant = TestApp.HelloServer.HttpObj
- #队列最大包个数
- queuecap = 1000000
- protocol = not-tars
- </HttpAdapter>
- <HttpsAdapter>
- #ip:port:timeout
- endpoint = ssl -h 127.0.0.1 -p 8081 -t 60000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 5
- #处理对象
- servant = TestApp.HelloServer.HttpsObj
- #队列最大包个数
- queuecap = 1000000
- protocol = not-tars
- </HttpsAdapter>
- <Ipv6Adapter>
- #ip:port:timeout
- #endpoint = tcp -h fe80::9e5c:8eff:fe95:5cda%enp3s0 -p 25460 -t 10000
- #endpoint = tcp -h fe80::9e5c:8eff:fe95:5cda%enp3s0 -p 25460 -t 10000
- endpoint = tcp -h ::1 -p 25460 -t 60000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 5
- #处理对象
- servant = TestApp.HelloServer.Ipv6Obj
- #队列最大包个数
- queuecap = 1000000
- </Ipv6Adapter>
- <AuthObjAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 9016 -t 60000 -e 1
- #allow ip
- allow =
- #max connection num
- maxconns = 4096
- #imp thread num
- threads = 5
- #servant
- servant = TestApp.HelloServer.AuthObj
- #queue capacity
- queuecap = 1000000
- #tars protocol
- protocol = tars
- accesskey=tars-test-user
- secretkey=123456
- </AuthObjAdapter>
- <SSLHelloAdapter>
- #ip:port:timeout
- endpoint = ssl -h 127.0.0.1 -p 9005 -t 60000
- #allow ip
- allow =
- #max connection num
- maxconns = 4096
- #imp thread num
- threads = 5
- #servant
- servant = TestApp.HelloServer.SSLObj
- #queue capacity
- queuecap = 1000000
- #tars protocol
- protocol = tars
- </SSLHelloAdapter>
- <SSLHello1Adapter>
- #ip:port:timeout
- endpoint = ssl -h 127.0.0.1 -p 9006 -t 60000
- #allow ip
- allow =
- #max connection num
- maxconns = 4096
- #imp thread num
- threads = 5
- #servant
- servant = TestApp.HelloServer.SSL1Obj
- #queue capacity
- queuecap = 1000000
- #tars protocol
- protocol = tars
- # ca = PROJECT_PATH/certs/client1.crt
- cert = PROJECT_PATH/certs/server1.crt
- key = PROJECT_PATH/certs/server1.key
- #default is 0
- verifyclient = 0
- ciphers =
- </SSLHello1Adapter>
- <SSLHello2Adapter>
- #ip:port:timeout
- endpoint = ssl -h 127.0.0.1 -p 9007 -t 60000
- #allow ip
- allow =
- #max connection num
- maxconns = 4096
- #imp thread num
- threads = 5
- #servant
- servant = TestApp.HelloServer.SSL2Obj
- #queue capacity
- queuecap = 1000000
- #tars protocol
- protocol = tars
- ca = PROJECT_PATH/certs/client1.crt
- cert = PROJECT_PATH/certs/server1.crt
- key = PROJECT_PATH/certs/server1.key
- #default is 0
- verifyclient = 1
- ciphers =
- </SSLHello2Adapter>
- <SSLHello3Adapter>
- #ip:port:timeout
- endpoint = ssl -h 127.0.0.1 -p 9008 -t 60000 -e 1
- #allow ip
- allow =
- #max connection num
- maxconns = 4096
- #imp thread num
- threads = 5
- #servant
- servant = TestApp.HelloServer.SSL3Obj
- #queue capacity
- queuecap = 1000000
- #tars protocol
- protocol = tars
- #auth access key
- accesskey = tars-test-user
- #auth secret key
- secretkey = 123456
- ca = PROJECT_PATH/certs/client1.crt
- cert = PROJECT_PATH/certs/server1.crt
- key = PROJECT_PATH/certs/server1.key
- #default is 0
- verifyclient = 1
- ciphers =
- </SSLHello3Adapter>
- <CustomAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 9400 -t 60000
- #allow ip
- allow =
- #max connection num
- maxconns = 4096
- #imp thread num
- threads = 5
- #servant
- servant = TestApp.HelloServer.CustomObj
- #queue capacity
- queuecap = 1000000
- #tars protocol
- protocol = not_tars
- </CustomAdapter>
- <UdpObjAdapter>
- #ip:port:timeout
- endpoint = udp -h 127.0.0.1 -p 9016 -t 60000 -e 1
- #allow ip
- allow =
- #max connection num
- maxconns = 4096
- #imp thread num
- threads = 5
- #servant
- servant = TestApp.HelloServer.UdpObj
- #queue capacity
- queuecap = 1000000
- #tars protocol
- protocol = tars
- </UdpObjAdapter>
- <UdpIpv6Adapter>
- #ip:port:timeout
- endpoint = udp -h ::1 -p 25460 -t 60000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 5
- #处理对象
- servant = TestApp.HelloServer.UdpIpv6Obj
- #队列最大包个数
- queuecap = 1000000
- </UdpIpv6Adapter>
- <PushAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 9300 -t 60000
- #allow ip
- allow =
- #max connection num
- maxconns = 4096
- #imp thread num
- threads = 5
- #servant
- servant = TestApp.HelloServer.PushObj
- #queue capacity
- queuecap = 1000000
- #tars protocol
- protocol = not_tars
- </PushAdapter>
- <HelloTimeoutAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 25860 -t 5000
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 1
- #处理对象
- servant = TestApp.HelloServer.HelloTimeoutObj
- #队列最大包个数
- queuecap = 1000000
- #protocol = not-tars
- </HelloTimeoutAdapter>
- <HelloNoTimeoutAdapter>
- #ip:port:timeout
- endpoint = tcp -h 127.0.0.1 -p 26460 -t 0
- #允许的IP地址
- allow =
- #最大连接数
- maxconns = 4096
- #当前线程个数
- threads = 1
- #处理对象
- servant = TestApp.HelloServer.HelloNoTimeoutObj
- #队列最大包个数
- queuecap = 1000000
- #protocol = not-tars
- </HelloNoTimeoutAdapter>
- </server>
- </application>
- </tars>
|