accept memcache protocol data save it to kafka use netty
just use set command,write to kafka easily
- ✅write data to kafka by topic
- ✅registe server to consul
- ✅add prometheus monitor application
- add unittest
import memcache
mc = memcache.Client(['127.0.0.1:11222'], debug=True)
#mc = memcache.Client(['127.0.0.1:9090'], debug=True)
print(mc)
ret=mc.set("test_mc", "{\"a\":123}")
print(ret)
java server show this
other kafka client show this
consul agent -dev -ui=true -client 0.0.0.0 &
http://127.0.0.1:8500/ui/dc1/services
- add spring-cloud library
- add config
spring.cloud.consul.host=localhost
spring.cloud.consul.port=8500
spring.cloud.consul.discovery.service-name=ho-java-producer
http://127.0.0.1:21314/actuator/prometheus
global:
scrape_interval: 10s
evaluation_interval: 10s
scrape_configs:
- job_name: 'spring'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['127.0.0.1:21314']
docker run -d -p 9090:9090 -v /tmp/px.yml:/etc/prometheus/prometheus.yml prom/prometheus
docker run -d -p 3000:3000 --name=grafana -v /tmp/grafana:/var/lib/grafana grafana/grafana