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

mqtt connect timeout problem #88

Open
momochaasdf opened this issue Mar 12, 2023 · 2 comments
Open

mqtt connect timeout problem #88

momochaasdf opened this issue Mar 12, 2023 · 2 comments

Comments

@momochaasdf
Copy link

There is a problem with the mqtt connection after the deployment of the k8s cluster on thingsboard.

When mqtt's: replicas=1, a single device repeatedly establishes and closes the connection, no matter how many times it is executed continuously, it can work normally.
When mqtt's: replicas>1, a single device repeatedly establishes and closes the connection, which will cause many problems such as connection timeout and connection failure.

I don't know why. Please help me.Thanks.

微信图片_20230312212809

微信图片_20230312213215

@momochaasdf
Copy link
Author

expose the 1883 port through the isio gateway.

@momochaasdf
Copy link
Author

istio gateway yaml:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: {{ .Release.Name }}-mqtt-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:

  • port:
    number: {{ .Values.gateway.mqtt.port }}
    name: mqtt
    protocol: TCP
    hosts:
    • "*"

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: {{ .Release.Name }}-mqtt-gateway-virtual-service
spec:
hosts:

  • "*"
    gateways:
  • {{ .Release.Name }}-mqtt-gateway
    tcp:
  • match:
    • port: {{ .Values.gateway.mqtt.port }}
      route:
    • destination:
      host: {{ .Release.Name }}-mqtt.{{ .Release.Namespace }}.svc.cluster.local
      port:
      number: {{ .Values.mqtt.port }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant