实验系统:CentOS 6.6_x86_64实验前提:防火墙和selinux都关闭实验说明:本实验共有4台主机,IP分配如拓扑实验软件:mariadb-10.
实验系统:CentOS 6.6_x86_64
实验前提:防火墙和selinux都关闭
实验说明:本实验共有4台主机,IP分配如拓扑
实验软件:mariadb-10.0.20 oneproxy-rhel5-linux64-v5.6-ga
相关如见下载地址:
百度网盘下载:
------------------------------------------分割线------------------------------------------
免费下载地址在
用户名与密码都是
具体下载目录在 /2015年资料/8月/6日/用OneProxy部署MySQL数据库的读写分离/
下载方法见
------------------------------------------分割线------------------------------------------
实验拓扑:
注意:本实验是之前MySQL-Proxy实验的拓展,因此大部分环境及设定是相同的,其中一、二步这里不再重复,具体请参考:利用MySQL-Proxy进行MySQL数据库的读写分离
一、准备工作
二、配置主从复制
三、安装oneproxy
1.此实验中19.79为onproxy服务器,所以软件安装在此主机上:
tar xf oneproxy-rhel5-linux64-v5.6-ga.tar.gz -C /usr/local/
cd /usr/local/oneproxy
vim demo.sh
---------------------------------------------------------------->
#/bin/bash
#
export ONEPROXY_HOME=/usr/local/oneproxy
# valgrind --leak-check=full --show-reachable=yes \
${ONEPROXY_HOME}/oneproxy --keepalive \ //自动检查和重起OneProxy服务
--proxy-address=192.168.19.79:3306 \ //Proxy Server第一个监听地址
--admin-address=192.168.19.79:4041 \ //管理端口地址
--proxy-master-addresses=192.168.19.66:3306@server1 \ //Master节点地址(可写入节点),其中@后面是“Server Group”的名字,如果不指定,则默认为“default”
--proxy-slave-addresses=192.168.19.74:3306@server1 \ //Slave节点地址(可读取节点)
--proxy-slave-addresses=192.168.19.76:3306@server1 \
--proxy-user-list=test/14B1772BA9874974E6ECEA0745EE774930E2EFA3 \ //Proxy用户列表(用户名/口令),进行完第2步之后回来配置
--proxy-part-tables=${ONEPROXY_HOME}/part.txt \
--proxy-found-rows \
--event-threads=4 \ //OneProxy的工作线程数
--proxy-group-policy=server1:2 \ //定义MySQL集群的路由访问策略,这里配置的是从Slave读取,,如果Slave端不可用,则从Master端读取
--proxy-group-security=server1:0 \ //定义MySQL集群的安全访问策略
--proxy-memory-db=root/@::test \
--proxy-memory-engine \
--proxy-sql-autosave=${ONEPROXY_HOME}/sql_firewall.sql \
--log-file=${ONEPROXY_HOME}/oneproxy.log \
--pid-file=${ONEPROXY_HOME}/oneproxy.pid
2.查看密码字符并配置:
chmod +x demo.sh
./demo.sh
mysql -uadmin -pOneProxy -h192.168.19.79 --port=4041 //进入管理接口
-------------------------------------------------------------------->
passwd 'RedHat'; //查看密码字符,并写入demo.sh中
+--------+------------------------------------------+
| TEXT | PASSWORD |
+--------+------------------------------------------+
| redhat | 14B1772BA9874974E6ECEA0745EE774930E2EFA3 |
+--------+------------------------------------------+
3.在master上创建测试用户:
/usr/local/mysql/bin/mysql
----------------------------------------------->
GRANT ALL ON *.* TO 'test'@'192.168.19.%' IDENTIFIED BY 'redhat'; //这里要和demo.sh中的Proxy用户列表信息保持一致
FLUSH PRIVILEGES;
4.回到oneproxy服务器启动进程:
killall -9 oneproxy //先清理掉之前的进程
./demo.sh
tail -f oneproxy.log //查看日志

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor

Notepad++7.3.1
Easy-to-use and free code editor
