首页
壁纸
留言
友链
关于
统计
Search
1
武汉理工刷课,武汉理工大学刷课,刷在线作业程序
950 阅读
2
Linux下Golang编译程序在后台运行及开机启动
769 阅读
3
抖音userid怎么获取
657 阅读
4
破解Typora1.1.5最新版
536 阅读
5
[必看]Go语言配置代理
412 阅读
技术
php
Mysql
wechat公众号
git
前端
前端大杂烩
vue2
vue3
Golang
gorm
golang配置
韩昊杰的软件
工具
VMware
其他
docker
kafka
nginx
openwrt
登录
Search
韩昊杰
累计撰写
65
篇文章
累计收到
52
条评论
首页
栏目
技术
php
Mysql
wechat公众号
git
前端
前端大杂烩
vue2
vue3
Golang
gorm
golang配置
韩昊杰的软件
工具
VMware
其他
docker
kafka
nginx
openwrt
页面
壁纸
留言
友链
关于
统计
搜索到
65
篇与
的结果
2023-12-30
如果通过docker-compose 安装kafka和zookeeper
如果通过docker-compose 安装kafka和zookeeper一. 先编写 docker-compose.yml 的文件version: "3" # 通用配置 x-common-config: &common-config KAFKA_ENABLE_KRAFT: no ALLOW_PLAINTEXT_LISTENER: yes KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_CFG_INTER_BROKER_LISTENER_NAME: INTERNAL KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT # kafka镜像通用配置 x-kafka: &kafka image: bitnami/kafka:3.2 networks: net: depends_on: - zookeeper services: zookeeper: container_name: zookeeper image: bitnami/zookeeper:3.8 ports: - "2181:2181" environment: - ALLOW_ANONYMOUS_LOGIN=yes networks: - net volumes: - zookeeper_data:/bitnami/zookeeper kafka-0: container_name: kafka-0 <<: *kafka ports: - "9093:9093" environment: <<: *common-config KAFKA_CFG_BROKER_ID: 0 KAFKA_CFG_LISTENERS: INTERNAL://:9092,EXTERNAL://0.0.0.0:9093 KAFKA_CFG_ADVERTISED_LISTENERS: INTERNAL://kafka-0:9092,EXTERNAL://10.150.36.72:9093 #修改为宿主机IP volumes: - kafka_0_data:/bitnami/kafka kafka-1: container_name: kafka-1 <<: *kafka ports: - "9094:9094" environment: <<: *common-config KAFKA_CFG_BROKER_ID: 1 KAFKA_CFG_LISTENERS: INTERNAL://:9092,EXTERNAL://0.0.0.0:9094 KAFKA_CFG_ADVERTISED_LISTENERS: INTERNAL://kafka-1:9092,EXTERNAL://10.150.36.72:9094 #修改为宿主机IP volumes: - kafka_1_data:/bitnami/kafka kafka-2: container_name: kafka-2 <<: *kafka ports: - "9095:9095" environment: <<: *common-config KAFKA_CFG_BROKER_ID: 2 KAFKA_CFG_LISTENERS: INTERNAL://:9092,EXTERNAL://0.0.0.0:9095 KAFKA_CFG_ADVERTISED_LISTENERS: INTERNAL://kafka-2:9092,EXTERNAL://10.150.36.72:9095 #修改为宿主机IP volumes: - kafka_2_data:/bitnami/kafka volumes: zookeeper_data: driver: local driver_opts: o: bind type: none device: ./zookeeper_data kafka_0_data: driver: local driver_opts: o: bind type: none device: ./kafka_0_data kafka_1_data: driver: local driver_opts: o: bind type: none device: ./kafka_1_data kafka_2_data: driver: local driver_opts: o: bind type: none device: ./kafka_2_data networks: net:二. 运行docker-composedocker-compose up -d三.检测是否启动成功1.进入到kafka-0 容器中 docker exec -it kafka-0 /bin/bash2.创建主题/opt/bitnami/kafka/bin/kafka-topics.sh \ --create --bootstrap-server kafka-0:9092 \ --topic my-topic \ --partitions 3 --replication-factor 2 3.控制台生产者/opt/bitnami/kafka/bin/kafka-console-producer.sh \ --bootstrap-server kafka-0:9092 \ --topic my-topic4.控制台消费者/opt/bitnami/kafka/bin/kafka-console-consumer.sh \ --bootstrap-server kafka-0:9092 \ --topic my-topic
2023年12月30日
47 阅读
0 评论
0 点赞
2023-11-07
修改webstorm 格式化缩进空格的问题
修改webstorm 格式化缩进空格的问题
2023年11月07日
50 阅读
0 评论
0 点赞
2023-11-03
An unexpected error was encountered while executing a WSL command. 安装docker出现报错
windows安装docker出现报错解决办法An unexpected error was encountered while executing a WSL command. Common causes include access rights issues, which occur after waking the computer or not being connected to your domain/active directory. Please try shutting WSL down (wsl --shutdown) and/or rebooting your computer. If not sufficient, WSL may need to be reinstalled fully. As a last resort, try to uninstall/reinstall Docker Desktop. If the issue persists please collect diagnostics and submit an issue (https://docs.docker.com/desktop/troubleshoot/overview/#diagnose-from-the-terminal). 1.以下操作在window powershell的管理员权限下进行,首先要确保wsl安装正确wsl -l #list wsl installed wsl --update2.其次更新网络设置netsh winsock reset
2023年11月03日
205 阅读
0 评论
0 点赞
2023-09-20
Golang 获取当前外网IP
Golang 获取当前外网IP
2023年09月20日
259 阅读
0 评论
0 点赞
2023-09-07
gorm的sum查询
当执行一下代码会报错,因为当amount为0时会给amount传递NULL保存var amount *float64 if err := db.Model(&OverweightMoney{}).Select("SUM(amount)").Scan(&amount).Error; err != nil { panic("无法执行求和操作") }执行一下代码即可var amount float64 global.GVA_DB.Model(&OverweightMoney).Debug().Where("`type` = 0" ).Pluck("COALESCE(SUM(amount), 0) as amount", &amount).Error
2023年09月07日
233 阅读
0 评论
0 点赞
1
...
3
4
5
...
13