Prometheus+Grafana 配置Elasticsearch ,Kafka的启动【Windows环境入门】
Elasticsearch官网下载elasticsearch-9.4.3-windows-x86_64.zip解压3.修改config/elasticsearch.yml# 本地调试开发单机模式 discovery.type:single-node # 集群模式需要设置 #cluster.initial_master_nodes[node_1]# 这几个都改成false访问不需要权限开发环境 xpack.security.enabled:falsexpack.security.enrollment.enabled:falsexpack.security.http.ssl.enabled:falsexpack.security.transport.ssl.enabled:false4.启动escmd cd elasticsearch-9.4.3 bin\elasticsearch.bat # 访问 http://127.0.0.1:9200/ { name : GXF-COMPUTER, cluster_name : elasticsearch, cluster_uuid : 3sK5j_5fSxK57kMksm2VOg, version : { number : 9.4.3, build_flavor : default, build_type : zip, build_hash : 45f6a06b1b441b41fe711059b8720013173e7c89, build_date : 2026-06-25T14:04:34.316306228Z, build_snapshot : false, lucene_version : 10.4.0, minimum_wire_compatibility_version : 8.19.0, minimum_index_compatibility_version : 8.0.0 }, tagline : You Know, for Search }5.下载并启动elasticsearch_export下载地址https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.10.0/elasticsearch_exporter-1.10.0.windows-amd64.zip解压后点击执行.\elasticsearch_exporter.exe --es.urihttp://127.0.0.1:9200启动访问127.0.0.1:9114/metrics启动Prometheus官网下载安装包prometheus-3.13.0.windows-amd64.zip点击启动 prometheus.exe页面状态启动Grafana官网下载安装包grafana-enterprise_12.4.2_23531306697_windows_amd64.tar.gz点击启动 grafana-server.exe admin/admin登录添加prometheus的地址导入dashboard选择面板数据源prometheusSave Dashboard,查看面板Kafka下载安装包解压修改数据目录kafka_2.13-3.9.2\config\kraft\server.properties 中log.dirs/tmp/kafka-logs改为log.dirsD:/Java/devops/kafka_2.13-3.9.2/kraft-data生成唯一ID:bin\windowskafka-storage.bat random-uuidB3AmYe6MTz-X1eXekbsiaw初始化存储目录bin\windowskafka-storage.bat format -t B3AmYe6MTz-X1eXekbsiaw --config …\config\kraft\server.propertiesFormatting metadata directory D:/Java/devops/kafka_2.13-3.9.2/kraft-data with metadata.version 3.9-IV0.启动kafka\bin\windowskafka-server-start.bat …\…\config\kraft\server.properties测试kafka正常打开3个CMD窗口创建topicbin\windows\kafka-topics.bat --create --topic test-demo --bootstrap-server localhost:9092结果Created topic test-demo.创建消费者bin\windows\kafka-console-consumer.bat --topic test-demo --from-beginning --bootstrap-server localhost:9092创建生产者bin\windows\kafka-console-producer.bat --topic test-demo --bootstrap-server localhost:9092生产者回车发送消息消费者可以看到。