mirror of https://github.com/apache/kafka.git
MINOR: Update vagrant/tests readme (#9650)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
0df461582c
commit
9412fc1151
|
@ -11,7 +11,10 @@ Running tests using docker
|
||||||
Docker containers can be used for running kafka system tests locally.
|
Docker containers can be used for running kafka system tests locally.
|
||||||
* Requirements
|
* Requirements
|
||||||
- Docker 1.12.3 (or higher) is installed and running on the machine.
|
- Docker 1.12.3 (or higher) is installed and running on the machine.
|
||||||
- Test require that Kafka, including system test libs, is built. This can be done by running ./gradlew clean systemTestLibs
|
- Test requires that Kafka, including system test libs, is built. This can be done by running
|
||||||
|
```
|
||||||
|
./gradlew clean systemTestLibs
|
||||||
|
```
|
||||||
* Run all tests
|
* Run all tests
|
||||||
```
|
```
|
||||||
bash tests/docker/run_tests.sh
|
bash tests/docker/run_tests.sh
|
||||||
|
@ -547,8 +550,10 @@ Where are the unit tests?
|
||||||
* The kafkatest unit tests are located under kafka/tests/unit
|
* The kafkatest unit tests are located under kafka/tests/unit
|
||||||
|
|
||||||
How do I run the unit tests?
|
How do I run the unit tests?
|
||||||
* cd kafka/tests # The base system test directory
|
```bash
|
||||||
* python3 setup.py test
|
$ cd kafka/tests # The base system test directory
|
||||||
|
$ python3 setup.py test
|
||||||
|
```
|
||||||
|
|
||||||
How can I add a unit test?
|
How can I add a unit test?
|
||||||
* Follow the naming conventions - module name starts with "check", class name begins with "Check", test method name begins with "check"
|
* Follow the naming conventions - module name starts with "check", class name begins with "Check", test method name begins with "check"
|
||||||
|
|
|
@ -5,10 +5,12 @@ Using Vagrant to get up and running.
|
||||||
1) Install Virtual Box [https://www.virtualbox.org/](https://www.virtualbox.org/)
|
1) Install Virtual Box [https://www.virtualbox.org/](https://www.virtualbox.org/)
|
||||||
2) Install Vagrant >= 1.6.4 [https://www.vagrantup.com/](https://www.vagrantup.com/)
|
2) Install Vagrant >= 1.6.4 [https://www.vagrantup.com/](https://www.vagrantup.com/)
|
||||||
3) Install Vagrant Plugins:
|
3) Install Vagrant Plugins:
|
||||||
|
```
|
||||||
$ vagrant plugin install vagrant-hostmanager
|
$ vagrant plugin install vagrant-hostmanager
|
||||||
# Optional
|
|
||||||
$ vagrant plugin install vagrant-cachier # Caches & shares package downloads across VMs
|
# Optional, to caches & shares package downloads across VMs
|
||||||
|
$ vagrant plugin install vagrant-cachier
|
||||||
|
```
|
||||||
|
|
||||||
In the main Kafka folder, do a normal Kafka build:
|
In the main Kafka folder, do a normal Kafka build:
|
||||||
|
|
||||||
|
@ -48,13 +50,11 @@ To log into one of the machines:
|
||||||
|
|
||||||
vagrant ssh <machineName>
|
vagrant ssh <machineName>
|
||||||
|
|
||||||
You can access the brokers and zookeeper by their IP or hostname, e.g.
|
You can access the brokers by their IP or hostname, e.g.
|
||||||
|
|
||||||
# Specify ZooKeeper node 1 by it's IP: 192.168.50.11
|
# Specify brokers by their hostnames: broker1, broker2, broker3 (or just one of them)
|
||||||
bin/kafka-topics.sh --create --zookeeper 192.168.50.11:2181 --replication-factor 3 --partitions 1 --topic sandbox
|
bin/kafka-topics.sh --create --bootstrap-server broker1:9092 --replication-factor 3 --partitions 1 --topic sandbox
|
||||||
|
bin/kafka-console-producer.sh --bootstrap-server broker1:9092,broker2:9092,broker3:9092 --topic sandbox
|
||||||
# Specify brokers by their hostnames: broker1, broker2, broker3
|
|
||||||
bin/kafka-console-producer.sh --broker-list broker1:9092,broker2:9092,broker3:9092 --topic sandbox
|
|
||||||
|
|
||||||
# Specify brokers by their IP: 192.168.50.51, 192.168.50.52, 192.168.50.53
|
# Specify brokers by their IP: 192.168.50.51, 192.168.50.52, 192.168.50.53
|
||||||
bin/kafka-console-consumer.sh --bootstrap-server 192.168.50.51:9092,192.168.50.52:9092,192.168.50.53:9092 --topic sandbox --from-beginning
|
bin/kafka-console-consumer.sh --bootstrap-server 192.168.50.51:9092,192.168.50.52:9092,192.168.50.53:9092 --topic sandbox --from-beginning
|
||||||
|
|
Loading…
Reference in New Issue