Skip to content

Commit

Permalink
Pull latest version for kafka.
Browse files Browse the repository at this point in the history
  • Loading branch information
musa-asad committed Dec 2, 2024
1 parent 50b4a00 commit 5029491
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions test/metric_value_benchmark/jmx_kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,25 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error {

log.Println("set up zookeeper and kafka")
startJMXCommands := []string{
"curl https://dlcdn.apache.org/kafka/3.6.2/kafka_2.13-3.6.2.tgz -o kafka_2.13-3.6.2.tgz",
"tar -xzf kafka_2.13-3.6.2.tgz",
"echo 'export JMX_PORT=2000'|cat - kafka_2.13-3.6.2/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-3.6.2/bin/kafka-server-start.sh",
"echo 'export JMX_PORT=2010'|cat - kafka_2.13-3.6.2/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-3.6.2/bin/kafka-console-consumer.sh",
"echo 'export JMX_PORT=2020'|cat - kafka_2.13-3.6.2/bin/kafka-console-producer.sh > /tmp/kafka-console-producer.sh && mv /tmp/kafka-console-producer.sh kafka_2.13-3.6.2/bin/kafka-console-producer.sh",
"sudo chmod +x kafka_2.13-3.6.2/bin/kafka-run-class.sh",
"sudo chmod +x kafka_2.13-3.6.2/bin/kafka-server-start.sh",
"sudo chmod +x kafka_2.13-3.6.2/bin/kafka-console-consumer.sh",
"sudo chmod +x kafka_2.13-3.6.2/bin/kafka-console-producer.sh",
"(yes | nohup kafka_2.13-3.6.2/bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092) > /tmp/kafka-console-producer-logs.txt 2>&1 &",
"kafka_2.13-3.6.2/bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092 > /tmp/kafka-console-consumer-logs.txt 2>&1 &",
"kafka_version=$(curl -s https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1)\n",
"curl https://dlcdn.apache.org/kafka/${kafka_version}/kafka_2.13-${kafka_version}.tgz -o kafka_2.13-${kafka_version}.tgz",
"tar -xzf kafka_2.13-${kafka_version}.tgz",
"echo 'export JMX_PORT=2000'|cat - kafka_2.13-${kafka_version}/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-${kafka_version}/bin/kafka-server-start.sh",
"echo 'export JMX_PORT=2010'|cat - kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh",
"echo 'export JMX_PORT=2020'|cat - kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh > /tmp/kafka-console-producer.sh && mv /tmp/kafka-console-producer.sh kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh",
"sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-run-class.sh",
"sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-server-start.sh",
"sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh",
"sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh",
"(yes | nohup kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092) > /tmp/kafka-console-producer-logs.txt 2>&1 &",
"kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092 > /tmp/kafka-console-consumer-logs.txt 2>&1 &",
"curl https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz -o apache-zookeeper-3.8.4-bin.tar.gz",
"tar -xzf apache-zookeeper-3.8.4-bin.tar.gz",
"mkdir apache-zookeeper-3.8.4-bin/data",
"touch apache-zookeeper-3.8.4-bin/conf/zoo.cfg",
"echo -e 'tickTime = 2000\ndataDir = ../data\nclientPort = 2181\ninitLimit = 5\nsyncLimit = 2\n' >> apache-zookeeper-3.8.4-bin/conf/zoo.cfg",
"sudo apache-zookeeper-3.8.4-bin/bin/zkServer.sh start",
"sudo kafka_2.13-3.6.2/bin/kafka-server-start.sh kafka_2.13-3.6.2/config/server.properties > /tmp/kafka-server-start-logs.txt 2>&1 &",
"sudo kafka_2.13-${kafka_version}/bin/kafka-server-start.sh kafka_2.13-${kafka_version}/config/server.properties > /tmp/kafka-server-start-logs.txt 2>&1 &",
}

err = common.RunCommands(startJMXCommands)
Expand Down

0 comments on commit 5029491

Please sign in to comment.