User-Profile-Image
hankin
  • 5
  • centos7
  • docker
  • mysql
  • PostgreSQL
  • git/gitlab
  • ELK
  • python
    • python-Tornado
    • python-django
  • redis
  • nginx
  • kvm
  • proxmox
  • mongo
  • kubernetes
  • prometheus
  • GlusterFs
  • nfs
  • freeswitch
  • httpd
  • shell脚本
  • linux
  • fastdfs
  • nextcloud
  • openssl
  • openvpn
  • rabbitmq
  • sqlite
  • svn
  • java
  • ubuntu
  • vue2
  • wordpress
  • php
  • IOT物联网
  • 项目
  • 故障处理
  • 树莓派
  • 博客存档
  • 未分类
  • 杂项
  • #1742(无标题)
  • 新视野
  • 分类
    • 项目
    • 树莓派
    • 杂项
    • 未分类
    • 新视野
    • 故障处理
    • 博客存档
    • wordpress
    • vue2
    • ubuntu
    • svn
    • sqlite
    • shell脚本
    • redis
    • rabbitmq
    • python-django
    • python
    • proxmox
    • prometheus
    • PostgreSQL
    • php
    • openvpn
    • openssl
    • nginx
    • nfs
    • nextcloud
    • mysql
    • mongo
    • linux
    • kvm
    • kubernetes
    • java
    • IOT物联网
    • httpd
    • GlusterFs
    • git/gitlab
    • freeswitch
    • fastdfs
    • ELK
    • docker
    • centos7
  • 页面
    • #1742(无标题)
  • 友链
      请到[后台->主题设置->友情链接]中设置。
Help?

Please contact us on our email for need any support

Support
    首页   ›   mysql   ›   正文
mysql

centos7安装配置mysqlroute

2022-10-28 23:33:22
709  0 0
安装mysqlrouter
创建目录:
  mkdir -p /etc/mysqlrouter
  cd /etc/mysqlrouter

下载mysql-router
  wget https://cdn.mysql.com/archives/mysql-router/mysql-router-8.0.26-el7-x86_64.tar.gz
  tar -zxvf mysql-router-8.0.26-el7-x86_64.tar.gz 
  mv mysql-router-8.0.26-el7-x86_64 mysql-router
新建配置文件

vi mysqlrouter.conf

[DEFAULT]
logging_folder = /var/log/mysqlrouter
runtime_folder = /var/run/mysqlrouter
config_folder = /etc/mysqlrouter

[logger]
level = INFO

# 从节点负载均衡配置
[routing:balancing]
# 绑定的IP地址
bind_address=127.0.0.1
# 监听的端口
bind_port = 7000
# 连接超时时间
connect_timeout = 3
# 最大连接数
max_connections = 1024
# 后端服务器地址
destinations = 10.252.252.2:3306,10.252.252.3:3306
# 模式:读还是写
mode = read-only

# If no plugin is configured which starts a service, keepalive
# will make sure MySQL Router will not immediately exit. It is
# safe to remove once Router is configured.
[keepalive]
interval = 60
新建系统服务

vi /usr/lib/systemd/system/mysqlrouter.service

[Unit]
Description=MySQL Router
After=network.target
After=syslog.target


[Service]
Type=notify
#User=mysqlrouter
#Group=mysqlrouter

User=root
Group=root

# Start main service
ExecStart=/etc/mysqlrouter/mysql-router/bin/mysqlrouter -c /etc/mysqlrouter/mysqlrouter.conf

# Sets open_files_limit
LimitNOFILE = 10000

Restart=on-failure

PrivateTmp=true

[Install]
WantedBy=multi-user.target
启动
systemctl start mysqlrouter
systemctl enable mysqlrouter
评论 (0)

点击这里取消回复。

欢迎您 游客  

Copyright © 2025 网站备案号 : 蜀ICP备2022017747号
smarty_hankin 主题. Designed by hankin
主页
页面
  • #1742(无标题)
博主
tang.show
tang.show 管理员
linux、centos、docker 、k8s、mysql等技术相关的总结文档
212 文章 2 评论 201289 浏览
测试
测试