当前位置: 首页 > news >正文

cpu占用超出网站空间的分配值湖人排名最新

cpu占用超出网站空间的分配值,湖人排名最新,asp.net mvc做网站,做网站淘宝条形码文章目录 1、maxwell 输出消息到 redis1.1、启动一个Maxwell容器,它会连接到指定的MySQL数据库,捕获变更事件,并将这些事件以Redis发布/订阅的形式发送到指定的Redis服务器1.2、在已运行的 Redis 容器中执行 Redis 命令行界面(CLI…

文章目录

  • 1、maxwell 输出消息到 redis
    • 1.1、启动一个Maxwell容器,它会连接到指定的MySQL数据库,捕获变更事件,并将这些事件以Redis发布/订阅的形式发送到指定的Redis服务器
    • 1.2、在已运行的 Redis 容器中执行 Redis 命令行界面(CLI)工具
      • 解决方法
      • 示例
      • 完整命令示例
      • 注意事项
    • 1.3、tingshu_album 数据库中 新增数据
    • 1.4、tingshu_album 数据库中 更新数据
    • 1.5、tingshu_album 数据库中 删除数据
    • 1.6、总结

1、maxwell 输出消息到 redis

在这里插入图片描述
Reference - Maxwell’s Daemon:https://maxwells-daemon.io/config/
redis-producer:https://maxwells-daemon.io/config/#redis-producer
在这里插入图片描述

1.1、启动一个Maxwell容器,它会连接到指定的MySQL数据库,捕获变更事件,并将这些事件以Redis发布/订阅的形式发送到指定的Redis服务器

docker run -it --rm zendesk/maxwell bin/maxwell --user=$MYSQL_USERNAME \--password=$MYSQL_PASSWORD --host=$MYSQL_HOST --producer=stdout
docker run -it --rm zendesk/maxwell bin/maxwell --user=maxwell \--password=maxwell --host=192.168.74.148 --port=3306 --producer=redis \--redis_host=192.168.74.148 --redis_port=6379 --redis_auth=123456 --redis_type=pubsub --redis_key=maxwell

您提供的命令是一个Docker命令,用于运行Zendesk Maxwell这个容器化应用程序。Maxwell是一个变更数据捕获(CDC)工具,用于从MySQL数据库捕获变更事件并将它们发布到其他系统,如Redis、Kafka等。下面是对该命令的详细解释:

docker run -it --rm zendesk/maxwell bin/maxwell \--user=maxwell \--password=maxwell \--host=192.168.74.148 \--port=3306 \--producer=redis \--redis_host=192.168.74.148 \--redis_port=6379 \--redis_auth=123456 \--redis_type=pubsub \--redis_key=maxwell
  • docker run: 这是Docker用来创建和启动一个新的容器实例的命令。
  • -it: 这两个选项告诉Docker在前台运行容器,并且保持交互模式打开,使得可以在容器内部执行命令。
  • –rm: 这个选项指示Docker在容器退出后自动删除容器,有助于保持系统清洁。
  • zendesk/maxwell: 这是指定要运行的Docker镜像的名称,即Zendesk提供的Maxwell镜像。
  • bin/maxwell: 这是Maxwell可执行文件的路径,告诉Docker运行这个特定的二进制文件。
  • –user=maxwell: 指定连接到MySQL数据库的用户名。
  • –password=maxwell: 指定连接到MySQL数据库的密码。
  • –host=192.168.74.148: 指定MySQL数据库服务器的IP地址。
  • –port=3306: 指定MySQL数据库服务器的端口号。
  • –producer=redis: 指定Maxwell应该将变更事件发布到Redis。
  • –redishost=192.168.74.148: 指定Redis服务器的IP地址。
  • –redisport=6379: 指定Redis服务器的端口号。
  • –redisauth=123456: 指定连接到Redis服务器的认证密码。
  • –redistype=pubsub: 指定Redis的发布/订阅模式作为消息传递机制。Publish/Subscribe,即发布/订阅模式。
  • –rediskey=maxwell: 指定在Redis中使用的键名,Maxwell将变更事件发布到这个键对应的频道。
    执行这个命令会启动一个Maxwell容器,它会连接到指定的MySQL数据库,捕获变更事件,并将这些事件以Redis发布/订阅的形式发送到指定的Redis服务器。
[root@localhost ~]# docker run -it --rm zendesk/maxwell bin/maxwell \
>     --user=maxwell \
>     --password=maxwell \
>     --host=192.168.74.148 \
>     --port=3306 \
>     --producer=redis \
>     --redis_host=192.168.74.148 \
>     --redis_port=6379 \
>     --redis_auth=123456 \
>     --redis_type=pubsub \
>     --redis_key=maxwell
2024-09-19 10:13:40 INFO  Maxwell - Starting Maxwell. maxMemory: 1031798784 bufferMemoryUsage: 0.25
2024-09-19 10:13:40 INFO  Maxwell - Maxwell v1.41.2 is booting (MaxwellRedisProducer), starting at Position[BinlogPosition[spzxbinlog.000003:6061], lastHeartbeat=0]
2024-09-19 10:13:40 INFO  MysqlSavedSchema - Restoring schema id 1 (last modified at Position[BinlogPosition[spzxbinlog.000003:156], lastHeartbeat=0])
2024-09-19 10:13:41 INFO  BinlogConnectorReplicator - Setting initial binlog pos to: spzxbinlog.000003:6061
2024-09-19 10:13:41 INFO  BinaryLogClient - Connected to 192.168.74.148:3306 at spzxbinlog.000003/6061 (sid:6379, cid:43)
2024-09-19 10:13:41 INFO  BinlogConnectorReplicator - Binlog connected.

1.2、在已运行的 Redis 容器中执行 Redis 命令行界面(CLI)工具

[root@localhost ~]# docker exec -it spzx-redis redis-cli
127.0.0.1:6379> 
[root@localhost ~]# docker exec -it spzx-redis redis-cli
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
(error) NOAUTH Authentication required.

当你尝试在 Redis 容器中使用 SUBSCRIBE 命令时收到 (error) NOAUTH Authentication required. 错误,这意味着 Redis 服务器需要认证才能执行命令。Redis 从版本 3.0 开始支持密码认证功能。

解决方法

要在 Redis 中执行需要认证的操作,你需要先使用 AUTH 命令提供正确的密码。以下是具体的步骤:

  1. 连接到 Redis:
    使用 docker exec -it spzx-redis redis-cli 连接到 Redis CLI。

  2. 提供认证:
    使用 AUTH 命令提供 Redis 服务器所需的密码。假设密码是 yourpassword,命令如下:

    AUTH yourpassword
    
  3. 执行订阅操作:
    成功认证后,你可以继续执行订阅命令:

    SUBSCRIBE maxwell
    

示例

假设 Redis 的密码是 maxwell,你可以按照以下步骤操作:

  1. 连接到 Redis CLI:

    docker exec -it spzx-redis redis-cli
    
  2. 提供认证:

    AUTH maxwell
    
  3. 执行订阅操作:

    SUBSCRIBE maxwell
    

完整命令示例

你可以在一次命令中完成认证和订阅:

docker exec -it spzx-redis redis-cli -n 0 << 'EOF'
AUTH maxwell
SUBSCRIBE maxwell
EOF

或者,你也可以在 Redis CLI 中逐条输入命令:

docker exec -it spzx-redis redis-cli
127.0.0.1:6379> AUTH maxwell
127.0.0.1:6379> SUBSCRIBE maxwell

注意事项

  • 密码安全:

    • 确保使用强密码,并且不要在命令行中明文显示密码。可以考虑使用环境变量或其他方式传递密码。
  • Redis 配置文件:

    • 确保 Redis 的配置文件(redis.conf)中设置了 requirepass 选项,并指定了正确的密码。

通过上述步骤,你应该能够成功地通过认证并执行 Redis 的订阅命令。如果仍然遇到问题,请检查 Redis 的配置和密码是否正确。

[root@localhost ~]# docker exec -it spzx-redis redis-cli
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "maxwell"
3) (integer) 1

1.3、tingshu_album 数据库中 新增数据

在这里插入图片描述

[root@localhost ~]# docker exec -it spzx-redis redis-cli
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "maxwell"
3) (integer) 1
1) "message"
2) "maxwell"
3) "{\"database\":\"tingshu_album\",\"table\":\"base_category1\",\"type\":\"insert\",\"ts\":1726741946,\"xid\":6478,\"commit\":true,\"data\":{\"id\":16,\"name\":\"maxwell\",\"order_num\":0,\"create_time\":\"2024-09-19 10:32:26\",\"update_time\":\"2024-09-19 10:32:26\",\"is_deleted\":0}}"

在这里插入图片描述

1.4、tingshu_album 数据库中 更新数据

在这里插入图片描述

[root@localhost ~]# docker exec -it spzx-redis redis-cli
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "maxwell"
3) (integer) 1
1) "message"
2) "maxwell"
3) "{\"database\":\"tingshu_album\",\"table\":\"base_category1\",\"type\":\"insert\",\"ts\":1726741946,\"xid\":6478,\"commit\":true,\"data\":{\"id\":16,\"name\":\"maxwell\",\"order_num\":0,\"create_time\":\"2024-09-19 10:32:26\",\"update_time\":\"2024-09-19 10:32:26\",\"is_deleted\":0}}"
1) "message"
2) "maxwell"
3) "{\"database\":\"tingshu_album\",\"table\":\"base_category1\",\"type\":\"update\",\"ts\":1726742253,\"xid\":7197,\"commit\":true,\"data\":{\"id\":16,\"name\":\"plus\",\"order_num\":0,\"create_time\":\"2024-09-19 10:32:26\",\"update_time\":\"2024-09-19 10:37:33\",\"is_deleted\":0},\"old\":{\"name\":\"maxwell\",\"update_time\":\"2024-09-19 10:32:26\"}}"

在这里插入图片描述

1.5、tingshu_album 数据库中 删除数据

在这里插入图片描述

[root@localhost ~]# docker exec -it spzx-redis redis-cli
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> SUBSCRIBE maxwell
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "maxwell"
3) (integer) 1
1) "message"
2) "maxwell"
3) "{\"database\":\"tingshu_album\",\"table\":\"base_category1\",\"type\":\"insert\",\"ts\":1726741946,\"xid\":6478,\"commit\":true,\"data\":{\"id\":16,\"name\":\"maxwell\",\"order_num\":0,\"create_time\":\"2024-09-19 10:32:26\",\"update_time\":\"2024-09-19 10:32:26\",\"is_deleted\":0}}"
1) "message"
2) "maxwell"
3) "{\"database\":\"tingshu_album\",\"table\":\"base_category1\",\"type\":\"update\",\"ts\":1726742253,\"xid\":7197,\"commit\":true,\"data\":{\"id\":16,\"name\":\"plus\",\"order_num\":0,\"create_time\":\"2024-09-19 10:32:26\",\"update_time\":\"2024-09-19 10:37:33\",\"is_deleted\":0},\"old\":{\"name\":\"maxwell\",\"update_time\":\"2024-09-19 10:32:26\"}}"
1) "message"
2) "maxwell"
3) "{\"database\":\"tingshu_album\",\"table\":\"base_category1\",\"type\":\"delete\",\"ts\":1726742435,\"xid\":7622,\"commit\":true,\"data\":{\"id\":16,\"name\":\"plus\",\"order_num\":0,\"create_time\":\"2024-09-19 10:32:26\",\"update_time\":\"2024-09-19 10:37:33\",\"is_deleted\":0}}"

在这里插入图片描述

1.6、总结

在这里插入图片描述


文章转载自:
http://starling.sqxr.cn
http://bodice.sqxr.cn
http://unfoiled.sqxr.cn
http://protrusive.sqxr.cn
http://aucuba.sqxr.cn
http://ichthyosaur.sqxr.cn
http://neurologist.sqxr.cn
http://windhover.sqxr.cn
http://uprising.sqxr.cn
http://halvah.sqxr.cn
http://snippy.sqxr.cn
http://smithiantha.sqxr.cn
http://skinful.sqxr.cn
http://computational.sqxr.cn
http://pensioner.sqxr.cn
http://potboy.sqxr.cn
http://brassiness.sqxr.cn
http://sulfathiazole.sqxr.cn
http://nonius.sqxr.cn
http://theatregoing.sqxr.cn
http://cisatlantic.sqxr.cn
http://holler.sqxr.cn
http://receivability.sqxr.cn
http://brickkiln.sqxr.cn
http://scug.sqxr.cn
http://zwitterionic.sqxr.cn
http://impenetrable.sqxr.cn
http://finick.sqxr.cn
http://blindstory.sqxr.cn
http://maxine.sqxr.cn
http://handprint.sqxr.cn
http://armorica.sqxr.cn
http://caledonia.sqxr.cn
http://malefaction.sqxr.cn
http://admiral.sqxr.cn
http://monstrous.sqxr.cn
http://doubtless.sqxr.cn
http://handwrought.sqxr.cn
http://horseweed.sqxr.cn
http://mbps.sqxr.cn
http://quadric.sqxr.cn
http://embryonal.sqxr.cn
http://styrofoam.sqxr.cn
http://kinephoto.sqxr.cn
http://clava.sqxr.cn
http://turdoid.sqxr.cn
http://cosmonaut.sqxr.cn
http://widow.sqxr.cn
http://annexment.sqxr.cn
http://mossiness.sqxr.cn
http://quickset.sqxr.cn
http://pedigree.sqxr.cn
http://halliard.sqxr.cn
http://gemma.sqxr.cn
http://deraign.sqxr.cn
http://ninon.sqxr.cn
http://endophyte.sqxr.cn
http://harmonization.sqxr.cn
http://gallivorous.sqxr.cn
http://ghostwriter.sqxr.cn
http://agroecological.sqxr.cn
http://ungentlemanly.sqxr.cn
http://anticolonial.sqxr.cn
http://adversity.sqxr.cn
http://angelhood.sqxr.cn
http://postcommunion.sqxr.cn
http://meditation.sqxr.cn
http://stipend.sqxr.cn
http://syndicate.sqxr.cn
http://euryphage.sqxr.cn
http://providently.sqxr.cn
http://dispersion.sqxr.cn
http://diphosgene.sqxr.cn
http://kidnap.sqxr.cn
http://haematidrosis.sqxr.cn
http://cocksfoot.sqxr.cn
http://specification.sqxr.cn
http://credenza.sqxr.cn
http://baldness.sqxr.cn
http://schizoidia.sqxr.cn
http://sargassumfish.sqxr.cn
http://gruff.sqxr.cn
http://trottoir.sqxr.cn
http://impedient.sqxr.cn
http://caseate.sqxr.cn
http://abuilding.sqxr.cn
http://assessment.sqxr.cn
http://galibi.sqxr.cn
http://sentimentalist.sqxr.cn
http://ubiety.sqxr.cn
http://eyereach.sqxr.cn
http://biochemorphology.sqxr.cn
http://pressure.sqxr.cn
http://handball.sqxr.cn
http://bugs.sqxr.cn
http://outweigh.sqxr.cn
http://pockety.sqxr.cn
http://enclave.sqxr.cn
http://postembryonic.sqxr.cn
http://paucal.sqxr.cn
http://www.15wanjia.com/news/102320.html

相关文章:

  • 网站制作哪里做得好网站设计与建设的公司
  • 潍坊网站建设 管雷鸣网络上哪里可以做推广
  • 怎么自己创建小程序烟台seo外包
  • 暴雪国际服百度seo如何做
  • wordpress 音乐站建网站建设
  • 德州网站建设公司seo自学
  • 做网站设计收入seo优化按天扣费
  • 涉县住房与城乡建设厅网站沈阳cms建站模板
  • 淘客网站怎么建立百度如何投放广告
  • 今日油价92汽油中国石化seo搜索排名优化是什么意思
  • 东莞做网站贴吧制作网页的基本步骤
  • 网站开发 需求友情链接吧
  • 制作网页教程需要什么工具西安市seo排名按天优化
  • 手机最新发布app优化方案
  • 展示型手机网站网络营销策划推广公司
  • 沈阳网站制作流程免费培训机构
  • 武汉哪家做网站公司好上海网站推广公司
  • 网站建设网站管理seo数据是什么意思
  • 网站目录做别的内容数据分析培训班
  • 卖域名的网站要怎么做搜索引擎优化的主要工作有
  • 做设计哪个网站可以接单短视频营销策略
  • 24小时学会网站建设 百度云百度在线人工客服
  • 德州企业认证网站建设新闻头条今日要闻国内
  • 网站聚合页面国际重大新闻事件2023
  • 怎么在主机上的建设网站百度会员登录入口
  • 手机网站 自适应屏幕微信营销软件群发
  • 建立网站时首先考虑的问题整合营销传播最基础的形式是
  • 珠海网站建设杰作搜索引擎优化的具体操作
  • 网站弄论坛形式怎么做友链交换网站源码
  • 视频弹幕网站怎么做搜索引擎优化专员