sdlan/maxwell.md
2026-02-28 23:55:05 +08:00

48 lines
977 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## maxwell配置
## docker-compose.yml配置
```yaml
services:
maxwell:
image: docker.1ms.run/zendesk/maxwell:latest
container_name: maxwell
network_mode: "host"
restart: always
entrypoint: ["bin/maxwell"]
command:
- --host=127.0.0.1
- --port=3306
- --user=punchnetuser
- --password=punchnet@J1c8WGu
- --producer=redis
- --redis_host=127.0.0.1
- --redis_port=16379
- --redis_type=stream
- --redis_stream=maxwell_stream
- --log_level=info
```
## mysql权限配置
```sql
# 创建maxwell依赖的数据库
CREATE DATABASE maxwell;
GRANT ALL ON maxwell.* TO 'punchnetuser'@'%';
-- 1⃣ 允许读取数据
GRANT SELECT ON *.* TO 'punchnetuser'@'%';
-- 2⃣ 允许复制权限(关键)
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'punchnetuser'@'%';
-- 3⃣ 如果还需要创建 maxwell 库
GRANT ALL ON maxwell.* TO 'punchnetuser'@'%';
FLUSH PRIVILEGES;
```