48 lines
977 B
Markdown
48 lines
977 B
Markdown
## 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;
|
||
|
||
``` |