Commit f749294e by 孙龙

up

parent 0c0fb15f
...@@ -15,6 +15,8 @@ type Config struct { ...@@ -15,6 +15,8 @@ type Config struct {
WebRoot string `json:"webroot"` WebRoot string `json:"webroot"`
MongodbUri string `json:"mongodbUri"` MongodbUri string `json:"mongodbUri"`
MongodbConnectTimeout int `json:"mongodbConnectTimeout"` MongodbConnectTimeout int `json:"mongodbConnectTimeout"`
EtcdUserName string `json"etcdUserName"`
EtcdPasswd string `json"etcdPasswd"`
} }
var ( var (
......
...@@ -45,6 +45,8 @@ func InitJobMgr() (err error) { ...@@ -45,6 +45,8 @@ func InitJobMgr() (err error) {
config = clientv3.Config{ config = clientv3.Config{
Endpoints: G_config.EtcdEndpoints, // 集群地址 Endpoints: G_config.EtcdEndpoints, // 集群地址
DialTimeout: time.Duration(G_config.EtcdDialTimeout) * time.Millisecond, // 连接超时 DialTimeout: time.Duration(G_config.EtcdDialTimeout) * time.Millisecond, // 连接超时
Username:G_config.EtcdUserName,
Password:G_config.EtcdPasswd,
} }
// 建立连接 // 建立连接
......
...@@ -56,6 +56,8 @@ func InitWorkerMgr() (err error) { ...@@ -56,6 +56,8 @@ func InitWorkerMgr() (err error) {
config = clientv3.Config{ config = clientv3.Config{
Endpoints: G_config.EtcdEndpoints, // 集群地址 Endpoints: G_config.EtcdEndpoints, // 集群地址
DialTimeout: time.Duration(G_config.EtcdDialTimeout) * time.Millisecond, // 连接超时 DialTimeout: time.Duration(G_config.EtcdDialTimeout) * time.Millisecond, // 连接超时
Username:G_config.EtcdUserName,
Password:G_config.EtcdPasswd,
} }
// 建立连接 // 建立连接
......
...@@ -21,5 +21,8 @@ ...@@ -21,5 +21,8 @@
"mongodbUri": "mongodb://ichunt:huntmon6699@192.168.1.237:27017/ichunt?authMechanism=SCRAM-SHA-1", "mongodbUri": "mongodb://ichunt:huntmon6699@192.168.1.237:27017/ichunt?authMechanism=SCRAM-SHA-1",
"mongodb连接超时时间": "单位毫秒", "mongodb连接超时时间": "单位毫秒",
"mongodbConnectTimeout": 5000 "mongodbConnectTimeout": 5000,
"etcdUserName":"root",
"etcdPasswd":"huntmon66499"
} }
\ No newline at end of file
...@@ -21,5 +21,7 @@ ...@@ -21,5 +21,7 @@
"mongodbUri": "mongodb://ichunt:huntmon6699@192.168.1.237:27017/ichunt?authMechanism=SCRAM-SHA-1", "mongodbUri": "mongodb://ichunt:huntmon6699@192.168.1.237:27017/ichunt?authMechanism=SCRAM-SHA-1",
"mongodb连接超时时间": "单位毫秒", "mongodb连接超时时间": "单位毫秒",
"mongodbConnectTimeout": 5000 "mongodbConnectTimeout": 5000,
"etcdUserName":"",
"etcdPasswd":""
} }
\ No newline at end of file
...@@ -21,5 +21,8 @@ ...@@ -21,5 +21,8 @@
"mongodbUri": "mongodb://ichunt:huntmon66499@172.18.137.23:27017/ichunt?authMechanism=SCRAM-SHA-1", "mongodbUri": "mongodb://ichunt:huntmon66499@172.18.137.23:27017/ichunt?authMechanism=SCRAM-SHA-1",
"mongodb连接超时时间": "单位毫秒", "mongodb连接超时时间": "单位毫秒",
"mongodbConnectTimeout": 5000 "mongodbConnectTimeout": 5000,
"etcdUserName":"root",
"etcdPasswd":"huntmon66499"
} }
\ No newline at end of file
...@@ -14,6 +14,8 @@ type Config struct { ...@@ -14,6 +14,8 @@ type Config struct {
JobLogBatchSize int `json:"jobLogBatchSize"` JobLogBatchSize int `json:"jobLogBatchSize"`
JobLogCommitTimeout int `json"jobLogCommitTimeout"` JobLogCommitTimeout int `json"jobLogCommitTimeout"`
ExecCommand string `json"execCommand"` ExecCommand string `json"execCommand"`
EtcdUserName string `json"etcdUserName"`
EtcdPasswd string `json"etcdPasswd"`
} }
var ( var (
......
...@@ -212,6 +212,8 @@ func InitJobMgr() (err error) { ...@@ -212,6 +212,8 @@ func InitJobMgr() (err error) {
config = clientv3.Config{ config = clientv3.Config{
Endpoints: G_config.EtcdEndpoints, // 集群地址 Endpoints: G_config.EtcdEndpoints, // 集群地址
DialTimeout: time.Duration(G_config.EtcdDialTimeout) * time.Millisecond, // 连接超时 DialTimeout: time.Duration(G_config.EtcdDialTimeout) * time.Millisecond, // 连接超时
Username:G_config.EtcdUserName,
Password:G_config.EtcdPasswd,
} }
// 建立连接 // 建立连接
......
...@@ -119,6 +119,8 @@ func InitRegister() (err error) { ...@@ -119,6 +119,8 @@ func InitRegister() (err error) {
config = clientv3.Config{ config = clientv3.Config{
Endpoints: G_config.EtcdEndpoints, // 集群地址 Endpoints: G_config.EtcdEndpoints, // 集群地址
DialTimeout: time.Duration(G_config.EtcdDialTimeout) * time.Millisecond, // 连接超时 DialTimeout: time.Duration(G_config.EtcdDialTimeout) * time.Millisecond, // 连接超时
Username:G_config.EtcdUserName,
Password:G_config.EtcdPasswd,
} }
// 建立连接 // 建立连接
......
...@@ -17,5 +17,8 @@ ...@@ -17,5 +17,8 @@
"日志自动提交超时": "在批次未达到阀值之前, 超时会自动提交batch", "日志自动提交超时": "在批次未达到阀值之前, 超时会自动提交batch",
"jobLogCommitTimeout": 1000, "jobLogCommitTimeout": 1000,
"etcdUserName":"root",
"etcdPasswd":"huntmon66499",
"execCommand": "C:\\\\cygwin64\\\\bin\\\\bash.exe" "execCommand": "C:\\\\cygwin64\\\\bin\\\\bash.exe"
} }
\ No newline at end of file
...@@ -17,5 +17,8 @@ ...@@ -17,5 +17,8 @@
"日志自动提交超时": "在批次未达到阀值之前, 超时会自动提交batch", "日志自动提交超时": "在批次未达到阀值之前, 超时会自动提交batch",
"jobLogCommitTimeout": 1000, "jobLogCommitTimeout": 1000,
"execCommand": "/bin/bash" "execCommand": "/bin/bash",
"etcdUserName":"root",
"etcdPasswd":"huntmon66499"
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment