You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/12/31 07:40:50 UTC

[GitHub] [servicecomb-service-center] little-cui opened a new pull request #1197: Feature: add syncer config framework

little-cui opened a new pull request #1197:
URL: https://github.com/apache/servicecomb-service-center/pull/1197


   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
    - [ ] Never comment source code, delete it.
    - [ ] UT should has "context, subject, expected result" result as test case name, when you call t.Run().
   ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1197: Feature: add syncer config framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1197:
URL: https://github.com/apache/servicecomb-service-center/pull/1197#discussion_r776949933



##########
File path: syncer/resource/admin/admin.go
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package admin
+
+import (
+	"net/http"
+
+	"github.com/apache/servicecomb-service-center/pkg/rest"
+)
+
+type Resource struct {
+}
+
+// URLPatterns 路由
+func (res *Resource) URLPatterns() []rest.Route {
+	return []rest.Route{
+		{Method: http.MethodGet, Path: "/v1/:project/syncer/health", Func: res.HealthCheck},

Review comment:
       health是否有project概念,假如和k8s的readness集成,似乎没有办法搞




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1197: Feature: add syncer config framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1197:
URL: https://github.com/apache/servicecomb-service-center/pull/1197#discussion_r776945977



##########
File path: etc/conf/syncer.yaml
##########
@@ -1,56 +1,16 @@
-# run mode, supports (single, cluster)
-mode: signle
-# node name, must be unique on the network
-node: syncer-node
-# Cluster name, clustering by this name
-cluster: syncer-cluster
-dataDir: ./syncer-data/
-listener:
-  # Address used to network with other Syncers in LAN
-  bindAddr: 0.0.0.0:30190
-  # Address used to network with other Syncers in WAN
-  advertiseAddr: ""
-  # Address used to synchronize data with other Syncers
-  rpcAddr: 0.0.0.0:30191
-  # Address used to communicate with other cluster peers
-  peerAddr: 127.0.0.1:30192
-  tlsMount:
-    enabled: false
-    name: syncer
-join:
-  enabled: false
-  # Address to join the network by specifying at least one existing member
-  address: 127.0.0.1:30190
-  # Limit the maximum of RetryJoin, default is 0, means no limit
-  retryMax: 3
-  retryInterval: 30s
-task:
-  kind: ticker
-  params:
-    # Time interval between timing tasks, default is 30s
-    - key: interval
-      value: 30s
-registry:
-  plugin: servicecenter
-  address: http://127.0.0.1:30100
-  tlsMount:
-    enabled: false
-    name: servicecenter
-tlsConfigs:
-  - name: syncer
-    verifyPeer: true
-    minVersion: TLSv1.2
-    caFile: ./certs/trust.cer
-    certFile: ./certs/server.cer
-    keyFile: ./certs/server_key.pem
-    passphrase: ""
-    ciphers:
-      - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
-      - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
-      - TLS_RSA_WITH_AES_256_GCM_SHA384
-      - TLS_RSA_WITH_AES_128_GCM_SHA256
-  - name: servicecenter
-    verifyPeer: false
-    caFile: ./certs/trust.cer
-    certFile: ./certs/server.cer
-    keyFile: ./certs/server_key.pem
\ No newline at end of file
+sync:
+  datacenter:
+    name: dc1
+  peers:
+    - name: dc2
+      kind: servicecomb
+      endpoints: [ "https://127.0.0.1:30100" ]
+      # only allow mode implemented in incremental approach like push, watch(such as pub/sub, long polling)
+      mode: [ push ]

Review comment:
       不该有空格




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1197: Feature: add syncer config framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1197:
URL: https://github.com/apache/servicecomb-service-center/pull/1197#discussion_r776949933



##########
File path: syncer/resource/admin/admin.go
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package admin
+
+import (
+	"net/http"
+
+	"github.com/apache/servicecomb-service-center/pkg/rest"
+)
+
+type Resource struct {
+}
+
+// URLPatterns 路由
+func (res *Resource) URLPatterns() []rest.Route {
+	return []rest.Route{
+		{Method: http.MethodGet, Path: "/v1/:project/syncer/health", Func: res.HealthCheck},

Review comment:
       health是否有project概念




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] robotLJW commented on a change in pull request #1197: Feature: add syncer config framework

Posted by GitBox <gi...@apache.org>.
robotLJW commented on a change in pull request #1197:
URL: https://github.com/apache/servicecomb-service-center/pull/1197#discussion_r776946281



##########
File path: etc/conf/syncer.yaml
##########
@@ -1,56 +1,16 @@
-# run mode, supports (single, cluster)
-mode: signle
-# node name, must be unique on the network
-node: syncer-node
-# Cluster name, clustering by this name
-cluster: syncer-cluster
-dataDir: ./syncer-data/
-listener:
-  # Address used to network with other Syncers in LAN
-  bindAddr: 0.0.0.0:30190
-  # Address used to network with other Syncers in WAN
-  advertiseAddr: ""
-  # Address used to synchronize data with other Syncers
-  rpcAddr: 0.0.0.0:30191
-  # Address used to communicate with other cluster peers
-  peerAddr: 127.0.0.1:30192
-  tlsMount:
-    enabled: false
-    name: syncer
-join:
-  enabled: false
-  # Address to join the network by specifying at least one existing member
-  address: 127.0.0.1:30190
-  # Limit the maximum of RetryJoin, default is 0, means no limit
-  retryMax: 3
-  retryInterval: 30s
-task:
-  kind: ticker
-  params:
-    # Time interval between timing tasks, default is 30s
-    - key: interval
-      value: 30s
-registry:
-  plugin: servicecenter
-  address: http://127.0.0.1:30100
-  tlsMount:
-    enabled: false
-    name: servicecenter
-tlsConfigs:
-  - name: syncer
-    verifyPeer: true
-    minVersion: TLSv1.2
-    caFile: ./certs/trust.cer
-    certFile: ./certs/server.cer
-    keyFile: ./certs/server_key.pem
-    passphrase: ""
-    ciphers:
-      - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
-      - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
-      - TLS_RSA_WITH_AES_256_GCM_SHA384
-      - TLS_RSA_WITH_AES_128_GCM_SHA256
-  - name: servicecenter
-    verifyPeer: false
-    caFile: ./certs/trust.cer
-    certFile: ./certs/server.cer
-    keyFile: ./certs/server_key.pem
\ No newline at end of file
+sync:
+  datacenter:

Review comment:
       这边是不是要加个 EnabledOnStart  开启?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1197: Feature: add syncer config framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1197:
URL: https://github.com/apache/servicecomb-service-center/pull/1197#discussion_r776946394



##########
File path: etc/conf/app.yaml
##########
@@ -16,22 +16,6 @@
 # environment can specify the sc running env, like dev or prod
 environment: dev
 
-sync:
-  datacenter:
-    name: dc1
-  peers:
-    - name: dc2
-      kind: servicecomb
-      endpoints: ["https://127.0.0.1:30100"]
-      # only allow mode implemented in incremental approach like push, watch(such as pub/sub, long polling)
-      mode: [push]
-      caFile: certs/ca.crt
-      revision: 100
-    - name: dc3
-      kind: consul
-      # since consul will not push data to servcecomb, if we need set push and watch mode to achieve two direction sync
-      mode: [push, watch]
-      revison: 200
 server:

Review comment:
       层级错了




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang merged pull request #1197: Feature: add syncer config framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang merged pull request #1197:
URL: https://github.com/apache/servicecomb-service-center/pull/1197


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org