Esrally: error: --target-hosts and --client-options must define the same keys for multi cluster setups

Rally version elastic/rally latest version


The command is as shown above. Because the destination elasticsearch uses xpack, I use client-options to prevent a security exception.

Even after looking at the official documentation, I can't quite understand... The official documentation only says to use it as above. What should I do?

target-hosts is only one
im use elasticsearch eck!

And target-host is not a multi-cluster

@pquentin

Hi @slowup - can you please post the full --target-hosts value (redacting any sensitive hostnames/IPs of course).

of course

goods-review-coordinating-service.local-search-engine.svc.cluster.local:9200

I wondered if the dns was a problem, so I tried public, but it didn't work.

@Bradley_Deam

I can't replicate your error using your invocation locally, either on the latest esrally release, or on master branch. I even aliased your hostname in /etc/hosts to see if there was something funky with the FQDN.

This error usually only appears when you specify something like below where client-options doesn't match the corresponding pattern by also including top level dict/json key called my_cluster_name;

esrally race --track geonames --pipeline=benchmark-only --target-hosts='{"my_cluster_name":"goods-review-coordinating-service.local-search-engine.svc.cluster.local:9200"}' --client-options="use_ssl: true, verify_certs: false,basic_auth_user: elastic, basic_auth_password: changeme" --kill-running-processes

I assume from the screenshot that you're using K8s, so I wonder if it's possible that the actual command executed is being parsed into something different than what is written in your manifest?

@Bradley_Deam
command:
- esrally
- race
- --track=geonames
- --pipeline=benchmark-only
- --target-hosts=goods-review-coordinating-service.local-search-engine.svc.cluster.local:9200
- --client-options="use_ssl:false,verify_certs:false,basic_auth_user:'elastic',basic_auth_password:'secret'"

i run command above

Need more information?

Hmm, I still can't reproduce the error you're seeing.

I suspect this is something specific to Docker/K8s. Can you please share your full manifest? I'd like to see if I can replicate this locally with Minikube.

Of course elasticsearch used eck

apiVersion: batch/v1
kind: Job
metadata:
  name: release-name-elasticsearch-rally
  namespace: local-search-engine
spec:
  template:
    metadata:
      labels:
        app: release-name-elasticsearch-rally
    spec:
      containers:
      - name: esrally
        command:
          - esrally
          - race
          - --track=geonames
          - --pipeline=benchmark-only
          - --target-hosts=goods-review-coordinating-service.local-search-engine.svc.cluster.local:9200
          - --client-options="use_ssl:false,verify_certs:false,basic_auth_user:'elastic',basic_auth_password:'Vx9Lh7CYLN7709Yp2xiw2Q06'"



        image: elastic/rally
        volumeMounts:
        - name: report
          mountPath: /tmp
      restartPolicy: Never
      volumes:
      - name: report
        hostPath:
          path: /tmp

Thanks. I was able to reproduce the problem, though I'm still not exactly certain what parsing K8s is doing to the supplied command cause the error we see, but I was able to fix it via separating the command and args:

apiVersion: batch/v1
kind: Job
metadata:
  name: rally
  namespace: default
spec:
  template:
    metadata:
      labels:
        app: rally
    spec:
      containers:
        - name: esrally
          command: ["esrally"]
          args:
            [
              "race",
              "--track=geonames",
              "--pipeline=benchmark-only",
              "--target-hosts=host.minikube.internal:39200",
              "--client-options='use_ssl:false,verify_certs:false,basic_auth_user:elastic,basic_auth_password:changeme",
            ]
          image: elastic/rally
          volumeMounts:
            - name: report
              mountPath: /rally/.rally/logs
      restartPolicy: Never
      volumes:
        - name: report
          hostPath:
            path: /tmp

Give that a shot.

@Bradley_Deam
Thanks!! Thanks to you, I think I can finish my work comfortably today!!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.