question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automating the cluster setup

See original GitHub issue

I am incorporating kafka-manager in a kafka/zookeeper openshift/kubernetes config, and wish to automate the cluster setup.

I am using a docker image similar to sheepkiller/kafka-manager-docker, whereby I am passing an env var for the zookeeper connection. Anyhow I am seeing kafka-manager connecting to zookeeper fine:

[info] o.a.z.ZooKeeper - Initiating client connection, connectString=zookeeper:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@5c9fdc3a
[info] k.m.a.KafkaManagerActor - zk=zookeeper:2181
[info] k.m.a.KafkaManagerActor - baseZkPath=/kafka-manager
[info] o.a.z.ClientCnxn - Opening socket connection to server zookeeper.kafka.svc.cluster.local/172.30.151.6:2181. Will not attempt to authenticate using SASL (unknown error)
[info] o.a.z.ClientCnxn - Socket connection established to zookeeper.kafka.svc.cluster.local/172.30.151.6:2181, initiating session
[info] o.a.z.ClientCnxn - Session establishment complete on server zookeeper.kafka.svc.cluster.local/172.30.151.6:2181, sessionid = 0x100012e44a90005, negotiated timeout = 40000

But when I go in the gui, I see nothing. No clusters listed or anything. Is this expect behaviour, and if so, how can I pre-configure a cluster in kafka-manager to pass to the server?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:14

github_iconTop GitHub Comments

6reactions
montana-uacommented, Nov 20, 2017

I do it by ansible in the following way:

This is my defaults (any variable can be overriden by extra-vars)

kafka_cluster_config:
  name: "{{ kafka_cluster_name }}"
  zkHosts: "{{ kafka_cluster_zkhosts }}"
  kafkaVersion: "{{ kafka_cluster_version }}"
  jmxEnabled: "true"
  jmxUser: ""
  jmxPass: ""
  jmxSsl: "false"
  logkafkaEnabled: "false"
  pollConsumers: "true"
  filterConsumers: "true"
  activeOffsetCacheEnabled: "true"
  displaySizeEnabled: "false"
  tuning.brokerViewUpdatePeriodSeconds: 30
  tuning.clusterManagerThreadPoolSize: 10
  tuning.clusterManagerThreadPoolQueueSize: 100
  tuning.kafkaCommandThreadPoolSize: 10
  tuning.kafkaCommandThreadPoolQueueSize: 100
  tuning.logkafkaCommandThreadPoolSize: 10
  tuning.logkafkaCommandThreadPoolQueueSize: 100
  tuning.logkafkaUpdatePeriodSeconds: 30
  tuning.partitionOffsetCacheTimeoutSecs: 5
  tuning.brokerViewThreadPoolSize: 10
  tuning.brokerViewThreadPoolQueueSize: 1000
  tuning.offsetCacheThreadPoolSize: 10
  tuning.offsetCacheThreadPoolQueueSize: 1000
  tuning.kafkaAdminClientThreadPoolSize: 10
  tuning.kafkaAdminClientThreadPoolQueueSize: 1000
  securityProtocol: PLAINTEXT

and this is my task

# Add kafka cluster into kafka manager via POST API
###################################################
---

- block:
  
  - name: prepare data for the POST request
    set_fact:
      kafka_cluster_post_data: "{{ kafka_cluster_post_data | default('') }}&{{ item }}={{ kafka_cluster_config[item] }}"
    with_items: "{{ kafka_cluster_config }}"

  - name: add kafka cluster {{ kafka_cluster_name }}
    uri:
      url: "http://{{ first_host }}:{{ kafka_manager_port }}/clusters"
      method: POST
      body: "{{ kafka_cluster_post_data }}"
      status_code: 200

  run_once: true
  delegate_to: localhost
3reactions
montana-uacommented, Nov 20, 2017

Also you can do it by znode module from ansible

- name: add kafka cluster {{ kafka_cluster_name }}
   znode:
     hosts: "{{ kafka_manager_zkhosts }}"
     name: "{{ kafka_manager_baseZkPath }}/configs/{{ kafka_cluster_name }}"
     value: "{{ kafka_cluster_data | to_json | string }}"
     state: present
   run_once: true
   delegate_to: 127.0.0.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Automate Kubernetes Cluster Deployments?
For a time-saving booster, you can automate the deployment of clusters, which are groups of containers in Kubernetes. While automating Kubernetes cluster.
Read more >
How to automate the setup of a Kubernetes cluster on GCP
Using Ansible to install, setup, and configure a Google Kubernetes Cluster (GKE) on Google Cloud Platform (GCP).
Read more >
Automation Engine and Clusters
Install the Automation Engine in a separate directory. Enter the cluster's virtual IP address in the INI-file parameter hostname= (section [TCP/IP]).
Read more >
5 ways to automate Kubernetes cluster management
According to the official documentation, this involves automating cluster creation and configuration, upgrading master and worker nodes, ...
Read more >
Automating Hadoop Cluster Setup Using Ansible | Medium
Now lets start setup of Hadoop Cluster using Ansible. Steps : Install ansible in controller mode pip3 install ansible yum install sshpass#To see ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found