Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binglog: fix tls error when create pump with TLS when use CRD (#1799) #1838

Merged
merged 11 commits into from
Mar 3, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Mar 2, 2020

cherry-pick #1799 to release-1.1


What problem does this PR solve?

If use CRD to create pump with tls , pump will create failed

What is changed and how does it work?

fix tiny config

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    use this tc yaml to test and use latest binlog tag as 3.0.8
  apiVersion: pingcap.com/v1alpha1
  kind: TidbCluster
  metadata:
    name: db
    namespace: tidb8
  spec:
    configUpdateStrategy: RollingUpdate
    enableTLSCluster: true
    helper:
      image: busybox:1.31.1
    hostNetwork: true
    imagePullPolicy: IfNotPresent
    pd:
      affinity: {}
      baseImage: pingcap/pd
      config:
        log:
          level: info
        replication:
          max-replicas: 3
      podSecurityContext: {}
      replicas: 1
      requests:
        cpu: "1"
        memory: 400Mi
        storage: 1Gi
      storageClassName: local-storage
    pump:
      baseImage: pingcap/tidb-binlog
      replicas: 1
      storageClassName: local-storage
      requests:
        cpu: "1"
        memory: 400Mi
        storage: 45Gi
    tidb:
      affinity: {}
      baseImage: pingcap/tidb
      binlogEnabled: true
      config:
        log:
          level: info
        performance:
          max-procs: 0
      enableTLSClient: true
      maxFailoverCount: 3
      podSecurityContext: {}
      replicas: 1
      requests:
        cpu: "1"
        memory: 400Mi
      separateSlowLog: true
      service:
        annotations:
          pingcap.com/last-applied-configuration: '{"ports":[{"name":"mysql-client","protocol":"TCP","port":4000,"targetPort":4000},{"name":"status","protocol":"TCP","port":10080,"targetPort":10080}],"selector":{"app.kubernetes.io/component":"tidb","app.kubernetes.io/instance":"db","app.kubernetes.io/managed-by":"tidb-operator","app.kubernetes.io/name":"tidb-cluster"},"type":"LoadBalancer","externalTrafficPolicy":"Local"}'
          service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
          service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
          service.beta.kubernetes.io/aws-load-balancer-type: nlb
        exposeStatus: true
        externalTrafficPolicy: Local
        type: LoadBalancer
      slowLogTailer:
        limits:
          cpu: 100m
          memory: 50Mi
        requests:
          cpu: 20m
          memory: 5Mi
    tikv:
      affinity: {}
      baseImage: pingcap/tikv
      config:
        log-level: info
      hostNetwork: false
      maxFailoverCount: 3
      podSecurityContext: {}
      privileged: false
      replicas: 1
      requests:
        cpu: "1"
        memory: 1Gi
        storage: 45Gi
      storageClassName: local-storage
    timezone: UTC
    version: v3.0.8

after apply, log shows pump and tidb works well

[2020/02/27 03:11:53.257 +00:00] [INFO] [version.go:50] ["Welcome to Pump"] ["Release Version"=v4.0.0-beta-8-g0bd1881a] ["Git Commit Hash"=0bd1881a6f1cf91ce3a7a82fcbfa037556976e2a] ["Build TS"="2020-02-21 06:27:36"] ["Go Version"=go1.13] ["Go OS/Arch"=linux/amd64]
[2020/02/27 03:11:53.258 +00:00] [INFO] [main.go:48] ["start pump..."] [config="{\"log-level\":\"info\",\"node-id\":\"\",\"addr\":\"http://10.244.3.1:8250\",\"advertise-addr\":\"http://db-pump-0.db-pump:8250\",\"socket\":\"\",\"pd-urls\":\"https://db-pd:2379\",\"EtcdDialTimeout\":5000000000,\"data-dir\":\"/data\",\"heartbeat-interval\":2,\"gc\":7,\"log-file\":\"\",\"security\":{\"ssl-ca\":\"/var/run/secrets/kubernetes.io/serviceaccount/ca.crt\",\"ssl-cert\":\"/var/lib/pump-tls/cert\",\"ssl-key\":\"/var/lib/pump-tls/key\"},\"gen-binlog-interval\":3,\"MetricsAddr\":\"\",\"MetricsInterval\":15,\"storage\":{\"sync-log\":null,\"kv_chan_cap\":0,\"slow_write_threshold\":0,\"kv\":null,\"stop-write-at-available-space\":null}}"]
[2020/02/27 03:11:53.259 +00:00] [INFO] [client.go:147] ["[pd] create pd client with endpoints"] [pd-address="[https://db-pd:2379]"]
[2020/02/27 03:11:53.314 +00:00] [INFO] [client.go:255] ["[pd] switch leader"] [new-leader=https://db-pd-0.db-pd-peer.tidb8.svc:2379] [old-leader=]
[2020/02/27 03:11:53.318 +00:00] [INFO] [client.go:166] ["[pd] init cluster id"] [cluster-id=6797946772916288597]
[2020/02/27 03:11:53.318 +00:00] [INFO] [server.go:126] ["get clusterID success"] [clusterID=6797946772916288597]
[2020/02/27 03:11:53.318 +00:00] [INFO] [client.go:147] ["[pd] create pd client with endpoints"] [pd-address="[https://db-pd:2379]"]
[2020/02/27 03:11:53.352 +00:00] [INFO] [client.go:255] ["[pd] switch leader"] [new-leader=https://db-pd-0.db-pd-peer.tidb8.svc:2379] [old-leader=]
[2020/02/27 03:11:53.354 +00:00] [INFO] [client.go:166] ["[pd] init cluster id"] [cluster-id=6797946772916288597]
[2020/02/27 03:11:53.399 +00:00] [WARN] [pd.go:109] ["get timestamp too slow"] ["cost time"=39.56503ms]
[2020/02/27 03:11:53.399 +00:00] [INFO] [store.go:68] ["new store"] [path="tikv://db-pd:2379?disableGC=true"]
[2020/02/27 03:11:53.399 +00:00] [INFO] [client.go:147] ["[pd] create pd client with endpoints"] [pd-address="[db-pd:2379]"]
[2020/02/27 03:11:53.429 +00:00] [INFO] [client.go:255] ["[pd] switch leader"] [new-leader=https://db-pd-0.db-pd-peer.tidb8.svc:2379] [old-leader=]
[2020/02/27 03:11:53.430 +00:00] [INFO] [client.go:166] ["[pd] init cluster id"] [cluster-id=6797946772916288597]
[2020/02/27 03:11:53.470 +00:00] [WARN] [pd.go:109] ["get timestamp too slow"] ["cost time"=37.799699ms]
[2020/02/27 03:11:53.470 +00:00] [INFO] [store.go:74] ["new store with retry success"]
[2020/02/27 03:11:53.470 +00:00] [INFO] [storage.go:135] [NewAppendWithResolver] [options="{\"ValueLogFileSize\":524288000,\"Sync\":true,\"KVChanCapacity\":1048576,\"SlowWriteThreshold\":1,\"StopWriteAtAvailableSpace\":10737418240,\"KVConfig\":null}"]

Code changes

  • Has Go code change

@cofyc
Copy link
Contributor

cofyc commented Mar 2, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

Your auto merge job has been accepted, waiting for 1831, 1827

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

@sre-bot merge failed.

@cofyc
Copy link
Contributor

cofyc commented Mar 2, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

@sre-bot merge failed.

@cofyc
Copy link
Contributor

cofyc commented Mar 2, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

Your auto merge job has been accepted, waiting for 1842

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

@sre-bot merge failed.

@cofyc
Copy link
Contributor

cofyc commented Mar 3, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 3, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 3, 2020

@sre-bot merge failed.

@cofyc
Copy link
Contributor

cofyc commented Mar 3, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 3, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 3, 2020

@sre-bot merge failed.

@cofyc
Copy link
Contributor

cofyc commented Mar 3, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 3, 2020

/run-all-tests

Copy link
Contributor

@aylei aylei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 3, 2020

@sre-bot merge failed.

@cofyc
Copy link
Contributor

cofyc commented Mar 3, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 3, 2020

/run-all-tests

@sre-bot sre-bot merged commit a358038 into pingcap:release-1.1 Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants