瀏覽代碼

压测提交

liliang 7 月之前
父節點
當前提交
8c1df6420d
共有 4 個文件被更改,包括 15 次插入13 次删除
  1. 2 0
      components/mongo/component.go
  2. 4 4
      game/config/profile-gc.json
  3. 9 9
      game/game_cluster/internal/mdb/component.go
  4. 二進制
      z-deploy/docker/center/center

+ 2 - 0
components/mongo/component.go

@@ -93,6 +93,8 @@ func CreateDatabase(uri, dbName string, timeout ...time.Duration) (*mongo.Databa
 	if len(timeout) > 0 && timeout[0].Seconds() > 3 {
 	if len(timeout) > 0 && timeout[0].Seconds() > 3 {
 		tt = timeout[0]
 		tt = timeout[0]
 	}
 	}
+
+	// todo tls开启
 	//tlsConfig := &tls.Config{
 	//tlsConfig := &tls.Config{
 	//	MinVersion:               tls.VersionTLS12,
 	//	MinVersion:               tls.VersionTLS12,
 	//	PreferServerCipherSuites: true,
 	//	PreferServerCipherSuites: true,

+ 4 - 4
game/config/profile-gc.json

@@ -11,7 +11,7 @@
     },
     },
     "nats": {
     "nats": {
       "master_node_id": "m-master",
       "master_node_id": "m-master",
-      "address": "nats://127.0.0.1:4222",
+      "address": "nats://s5.z100.vip:24222",
       "reconnect_delay": 1,
       "reconnect_delay": 1,
       "max_reconnects": 5,
       "max_reconnects": 5,
       "request_timeout": 10,
       "request_timeout": 10,
@@ -19,7 +19,7 @@
       "password": ""
       "password": ""
     },
     },
     "etcd": {
     "etcd": {
-      "end_points": "http://127.0.0.1:2379",
+      "end_points": "http://s5.z100.vip:22379",
       "@end_points": "dev.com:2379,dev1.com:2379",
       "@end_points": "dev.com:2379,dev1.com:2379",
       "prefix": "mhaya",
       "prefix": "mhaya",
       "ttl": 5,
       "ttl": 5,
@@ -226,12 +226,12 @@
         "enable": true,
         "enable": true,
         "db_id": "game_db_1",
         "db_id": "game_db_1",
         "db_name": "db_mhaya",
         "db_name": "db_mhaya",
-        "uri": "mongodb://127.0.0.1:27017"
+        "uri": "mongodb://s5.z100.vip:27019"
       }
       }
     ]
     ]
   },
   },
   "redis": {
   "redis": {
-    "address": "127.0.0.1:6379",
+    "address": "s5.z100.vip:36379",
     "password": "",
     "password": "",
     "db": 0
     "db": 0
   },
   },

+ 9 - 9
game/game_cluster/internal/mdb/component.go

@@ -1,7 +1,6 @@
 package mdb
 package mdb
 
 
 import (
 import (
-	"crypto/tls"
 	"github.com/go-redis/redis/v8"
 	"github.com/go-redis/redis/v8"
 	mhayaMongo "github.com/mhaya/components/mongo"
 	mhayaMongo "github.com/mhaya/components/mongo"
 	clog "github.com/mhaya/logger"
 	clog "github.com/mhaya/logger"
@@ -37,15 +36,16 @@ func (p *ActorDB) OnInit() {
 		clog.Panic("game_db_id not found")
 		clog.Panic("game_db_id not found")
 	}
 	}
 	redisConfig := cprofile.GetConfig("redis")
 	redisConfig := cprofile.GetConfig("redis")
-	tlsConfig := &tls.Config{
-		MinVersion:               tls.VersionTLS12,
-		PreferServerCipherSuites: true,
-	}
+	// todo tls开启
+	//tlsConfig := &tls.Config{
+	//	MinVersion:               tls.VersionTLS12,
+	//	PreferServerCipherSuites: true,
+	//}
 	RDB = redis.NewUniversalClient(&redis.UniversalOptions{
 	RDB = redis.NewUniversalClient(&redis.UniversalOptions{
-		Addrs:     []string{redisConfig.GetString("address")},
-		Password:  redisConfig.GetString("password"),
-		DB:        redisConfig.GetInt("db"),
-		TLSConfig: tlsConfig,
+		Addrs:    []string{redisConfig.GetString("address")},
+		Password: redisConfig.GetString("password"),
+		DB:       redisConfig.GetInt("db"),
+		//TLSConfig: tlsConfig,
 	})
 	})
 
 
 	if p.App().NodeId() == "m-center" {
 	if p.App().NodeId() == "m-center" {

二進制
z-deploy/docker/center/center