Explorar o código

修复 集群2保存无数据bug

wcc hai 1 ano
pai
achega
9335a17a15
Modificáronse 2 ficheiros con 6 adicións e 2 borrados
  1. 2 2
      createEsIndex/common.toml
  2. 4 0
      createEsIndex/main.go

+ 2 - 2
createEsIndex/common.toml

@@ -56,8 +56,8 @@
     bucketname = "topjy"
     filesize = 500000  ## 单位字节,附件总字节长度限制;超过就不再读取
 [db.es]
-#    addr = "http://127.0.0.1:19805"      ## 正常bidding 链接
-    addr = "http://192.168.3.149:9201"      ## 正常bidding 链接
+    addr = "http://127.0.0.1:19805"      ## 正常bidding 链接
+#    addr = "http://192.168.3.149:9201"      ## 正常bidding 链接
 #    addrp = "http://192.168.3.149:9201"    ##  采集使用的单机版地址
     username = "es_all"
     password = "TopJkO2E_d1x"

+ 4 - 0
createEsIndex/main.go

@@ -386,8 +386,12 @@ func SaveEsMethod() {
 	for {
 		select {
 		case v := <-saveEsPool:
+			id := v["id"]
+			ids := v["_id"]
 			Es.Save(config.Conf.DB.Es.IndexB, v)
 			if config.Conf.DB.Es.Addr2 != "" {
+				v["id"] = id
+				v["_id"] = ids
 				Es2.Save(config.Conf.DB.Es.Indexb2, v)
 			}