@@ -52,21 +52,73 @@ event.subscribe = {
52
52
* ** enable** : plugin can receive nothing if the value is false.
53
53
* ** topic** : the value is the kafka topic to receive events. Make sure it has been created and Kafka process is running
54
54
55
- ##### Run Kafka
55
+ ##### Install Kafka
56
+ On Mac:
57
+ ```
58
+ brew install kafka
59
+ ```
60
+
61
+ On Linux:
62
+ ```
63
+ cd /usr/local
64
+ wget http://archive.apache.org/dist/kafka/0.8.2.1/kafka_2.11-0.8.2.1.tgz
65
+ tar -xzvf kafka_2.11-0.8.2.1.tgz
66
+ mv kafka_2.11-0.8.2.1 kafka
67
+
68
+ add "export PATH=$PATH:/usr/local/kafka/bin" to end of /etc/profile
69
+ source /etc/profile
56
70
71
+
72
+ kafka-server-start.sh /usr/local/kafka/config/server.properties &
73
+ ```
74
+
75
+
76
+ ##### Run Kafka
77
+ On Mac:
57
78
```
58
79
zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties & kafka-server-start /usr/local/etc/kafka/server.properties
59
80
```
60
81
82
+ On Linux:
83
+ /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties &
84
+
85
+
61
86
#### Create topics to receive events, the topic is defined in config.conf
62
87
88
+ On Mac:
63
89
```
64
90
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic block
65
91
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic transaction
66
92
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractlog
67
93
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractevent
68
94
```
69
95
96
+ On Linux:
97
+ ```
98
+ kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic block
99
+ kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic transaction
100
+ kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractlog
101
+ kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractevent
102
+ ```
103
+
104
+ #### Kafka consumer
105
+
106
+ On Mac:
107
+ ```
108
+ kafka-console-consumer --bootstrap-server localhost:9092 --topic block --from-beginning
109
+ kafka-console-consumer --bootstrap-server localhost:9092 --topic transaction --from-beginning
110
+ kafka-console-consumer --bootstrap-server localhost:9092 --topic contractlog --from-beginning
111
+ kafka-console-consumer --bootstrap-server localhost:9092 --topic contractevent --from-beginning
112
+ ```
113
+
114
+ On Linux:
115
+ ```
116
+ kafka-console-consumer.sh --zookeeper localhost:2181 --topic block --from-beginning
117
+ kafka-console-consumer.sh --zookeeper localhost:2181 --topic transaction --from-beginning
118
+ kafka-console-consumer.sh --zookeeper localhost:2181 --topic contractlog --from-beginning
119
+ kafka-console-consumer.sh --zookeeper localhost:2181 --topic contractevent --from-beginning
120
+ ```
121
+
70
122
### Load plugin in Java-tron
71
123
* add --es to command line, for example:
72
124
```
0 commit comments