Browse Source

More compatible with `config/confgen.sh`

chyeh 8 years ago
parent
commit
d294e6b730

+ 2 - 3
config/agent.json

@@ -10,15 +10,14 @@
     },
     "heartbeat": {
         "enabled": true,
-        "addr": "127.0.0.1:6030",
+        "addr": "%%HBS_HTTP%%",
         "interval": 60,
         "timeout": 1000
     },
     "transfer": {
         "enabled": true,
         "addrs": [
-            "127.0.0.1:8433",
-            "127.0.0.1:8433"
+            "%%TRANSFER_RPC%%"
         ],
         "interval": 60,
         "timeout": 1000

+ 4 - 4
config/aggregator.json

@@ -2,17 +2,17 @@
     "debug": true,
     "http": {
         "enabled": true,
-        "listen": "0.0.0.0:6055"
+        "listen": "%%AGGREGATOR_HTTP%%"
     },
     "database": {
-        "addr": "root:@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&parseTime=true",
+        "addr": "%%MYSQL%%/falcon_portal?loc=Local&parseTime=true",
         "idle": 10,
         "ids": [1, -1],
         "interval": 55
     },
     "api": {
         "hostnames": "http://127.0.0.1:5050/api/group/%s/hosts.json",
-        "push": "http://127.0.0.1:6060/api/push",
-        "graphLast": "http://127.0.0.1:9966/graph/last"
+        "push": "http://%%TRANSFER_HTTP%%/api/push",
+        "graphLast": "http://%%QUERY_HTTP%%/graph/last"
     }
 }

+ 12 - 5
config/confgen.sh

@@ -2,14 +2,21 @@
 
 declare -A confs
 confs=(
-    [%%QUERY_HTTP%%]=0.0.0.0:9966
-    [%%HBS_HTTP%%]=0.0.0.0:6031
-    [%%TRANSFER_HTTP%%]=0.0.0.0:6060
+    [%%AGENT_HTTP%%]=0.0.0.0:1988
+    [%%AGGREGATOR_HTTP%%]=0.0.0.0:6055
     [%%GRAPH_HTTP%%]=0.0.0.0:6071
-    [%%HBS_RPC%%]=0.0.0.0:6030
-    [%%REDIS%%]=127.0.0.1:6379
     [%%GRAPH_RPC%%]=0.0.0.0:6070
+    [%%HBS_HTTP%%]=0.0.0.0:6031
+    [%%HBS_RPC%%]=0.0.0.0:6030
+    [%%JUDGE_HTTP%%]=0.0.0.0:6081
+    [%%JUDGE_RPC%%]=0.0.0.0:6080
+    [%%NODATA_HTTP%%]=0.0.0.0:6090
+    [%%QUERY_HTTP%%]=0.0.0.0:9966
+    [%%SENDER_HTTP%%]=0.0.0.0:6066
+    [%%TASK_HTTP%%]=0.0.0.0:8002
+    [%%TRANSFER_HTTP%%]=0.0.0.0:6060
     [%%TRANSFER_RPC%%]=0.0.0.0:8433
+    [%%REDIS%%]=127.0.0.1:6379
     [%%MYSQL%%]="root:password@tcp(127.0.0.1:3306)"
 )
 

+ 4 - 12
config/graph.json

@@ -2,26 +2,18 @@
 	"debug": false,
 	"http": {
 		"enabled": true,
-		"listen": "0.0.0.0:6071"
+		"listen": "%%GRAPH_HTTP%%"
 	},
 	"rpc": {
 		"enabled": true,
-		"listen": "0.0.0.0:6070"
+		"listen": "%%GRAPH_RPC%%"
 	},
 	"rrd": {
 		"storage": "/home/work/data/6070"
 	},
 	"db": {
-		"dsn": "root:@tcp(127.0.0.1:3306)/graph?loc=Local&parseTime=true",
+		"dsn": "%%MYSQL%%/graph?loc=Local&parseTime=true",
 		"maxIdle": 4
 	},
-	"callTimeout": 5000,
-	"migrate": {
-		"enabled": false,
-		"concurrency": 2,
-		"replicas": 500,
-		"cluster": {
-			"graph-00" : "127.0.0.1:6070"
-		}
-	}
+	"callTimeout": 5000
 }

+ 2 - 2
config/hbs.json

@@ -1,12 +1,12 @@
 {
     "debug": true,
-    "database": "root:@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&parseTime=true",
+    "database": "%%MYSQL%%/falcon_portal?loc=Local&parseTime=true",
     "hosts": "",
     "maxIdle": 100,
     "listen": ":6030",
     "trustable": [""],
     "http": {
         "enabled": true,
-        "listen": "0.0.0.0:6031"
+        "listen": "%%HBS_HTTP%%"
     }
 }

+ 5 - 5
config/judge.json

@@ -1,17 +1,17 @@
 {
     "debug": true,
     "debugHost": "nil",
-    "remain": 11, 
+    "remain": 11,
     "http": {
         "enabled": true,
-        "listen": "0.0.0.0:6081"
+        "listen": "%%JUDGE_HTTP%%"
     },
     "rpc": {
         "enabled": true,
-        "listen": "0.0.0.0:6080"
+        "listen": "%%JUDGE_RPC%%"
     },
     "hbs": {
-        "servers": ["127.0.0.1:6030"],
+        "servers": ["%%HBS_RPC%%"],
         "timeout": 300,
         "interval": 60
     },
@@ -20,7 +20,7 @@
         "minInterval": 300,
         "queuePattern": "event:p%v",
         "redis": {
-            "dsn": "127.0.0.1:6379",
+            "dsn": "%%REDIS%%",
             "maxIdle": 5,
             "connTimeout": 5000,
             "readTimeout": 5000,

+ 4 - 4
config/nodata.json

@@ -2,16 +2,16 @@
     "debug": true,
     "http": {
         "enabled": true,
-        "listen": "0.0.0.0:6090"
+        "listen": "%%NODATA_HTTP%%"
     },
     "query":{
         "connectTimeout": 5000,
         "requestTimeout": 30000,
-        "queryAddr": "127.0.0.1:9966"
+        "queryAddr": "%%QUERY_HTTP%%"
     },
     "config": {
         "enabled": true,
-        "dsn": "root:@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&parseTime=true&wait_timeout=604800",
+        "dsn": "%%MYSQL%%/falcon_portal?loc=Local&parseTime=true&wait_timeout=604800",
         "maxIdle": 4
     },
     "collector":{
@@ -23,7 +23,7 @@
         "enabled": true,
         "connectTimeout": 5000,
         "requestTimeout": 30000,
-        "transferAddr": "127.0.0.1:6060",
+        "transferAddr": "%%TRANSFER_HTTP%%",
         "batch": 500,
         "block": {
             "enabled": false,

+ 3 - 3
config/query.json

@@ -2,7 +2,7 @@
     "debug": "false",
     "http": {
         "enabled":  true,
-        "listen":   "0.0.0.0:9966"
+        "listen":   "%%QUERY_HTTP%%"
     },
     "graph": {
         "connTimeout": 1000,
@@ -11,11 +11,11 @@
         "maxIdle": 32,
         "replicas": 500,
         "cluster": {
-            "graph-00": "127.0.0.1:6070"
+            "graph-00": "%%GRAPH_RPC%%"
         }
     },
     "api": {
-        "query": "http://127.0.0.1:9966",
+        "query": "%%QUERY_HTTP%%",
         "dashboard": "http://127.0.0.1:8081",
         "max": 500
     }

+ 4 - 4
config/sender.json

@@ -2,10 +2,10 @@
     "debug": true,
     "http": {
         "enabled": true,
-        "listen": "0.0.0.0:6066"
+        "listen": "%%SENDER_HTTP%%"
     },
     "redis": {
-        "addr": "127.0.0.1:6379",
+        "addr": "%%REDIS%%",
         "maxIdle": 5
     },
     "queue": {
@@ -17,7 +17,7 @@
         "mail": 50
     },
     "api": {
-        "sms": "http://11.11.11.11:8000/sms",
-        "mail": "http://11.11.11.11:9000/mail"
+        "sms": "http://127.0.0.1:8000/sms",
+        "mail": "http://127.0.0.1:9000/mail"
     }
 }

+ 6 - 6
config/task.json

@@ -2,11 +2,11 @@
     "debug": false,
     "http": {
         "enable": true,
-        "listen": "0.0.0.0:8002"
+        "listen": "%%TASK_HTTP%%"
     },
     "index": {
         "enable": false,
-        "dsn": "root:root@tcp(127.0.0.1:3306)/graph?loc=Local&parseTime=true",
+        "dsn": "%%MYSQL%%/graph?loc=Local&parseTime=true",
         "maxIdle": 4,
         "autoDelete": false,
         "cluster":{
@@ -16,12 +16,12 @@
     },
     "collector" : {
         "enable": true,
-        "destUrl" : "http://127.0.0.1:1988/v1/push",
+        "destUrl" : "http://%%AGENT_HTTP%%/v1/push",
         "srcUrlFmt" : "http://%s/statistics/all",
         "cluster" : [
-            "transfer,test.hostname:6060",
-            "graph,test.hostname:6071",
-            "task,test.hostname:8001"
+            "transfer,%%TRANSFER_HTTP%%",
+            "graph,%%GRAPH_HTTP%%",
+            "task,%%TASK_HTTP%%"
         ]
     }
 }

+ 4 - 4
config/transfer.json

@@ -3,11 +3,11 @@
     "minStep": 30,
     "http": {
         "enabled": true,
-        "listen": "0.0.0.0:6060"
+        "listen": "%%TRANSFER_HTTP%%"
     },
     "rpc": {
         "enabled": true,
-        "listen": "0.0.0.0:8433"
+        "listen": "%%TRANSFER_RPC%%"
     },
     "socket": {
         "enabled": true,
@@ -23,7 +23,7 @@
         "maxIdle": 32,
         "replicas": 500,
         "cluster": {
-            "judge-00" : "127.0.0.1:6080"
+            "judge-00" : "%%JUDGE_RPC%%"
         }
     },
     "graph": {
@@ -35,7 +35,7 @@
         "maxIdle": 32,
         "replicas": 500,
         "cluster": {
-            "graph-00" : "127.0.0.1:6070"
+            "graph-00" : "%%GRAPH_RPC%%"
         }
     },
     "tsdb": {