galera cluster的设计与实现
Galera Cluster的优点
对等的multi-master,share nothing的高冗余结构
中间层 --建立连接、管理连接池,均衡负载,实现客户端与实例重连
galera参数解析
状态参数
20180530
================================================
galera的验证方法
binlog与galera的关系
验证方法
galera消息传送
Gcache实现原理
缓存最新写集(通常也是最热的),提供给joiner做IST
配置参数
mem_size
size
page_size
大话SST/IST细节
初始化节点环境
20180604
================================================
galera cluster从库的转移
没有开启server级GTID的情况
1.找到file及pos点
2.mysqlbinlog找到binlog信息,Xid --galera级的GTID的seqno
relay-log purge
大事务的处理
20180605
================================================
在线改变引发的集群死锁
20180606
================================================
inception
git clone方式获取源码
git clone https://github.com/mysql-inception/inception.git
如果出现ssl验证问题,关掉即可
git config --global http.sslVerify false
yum install cmake ncurses-libs ncurses-devel.x86_64 openssl-devel.x86_64 gcc-c++ gcc libgcc bison -y
出现这个问题是gcc++编译器版本过低的问题
cmake: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by cmake)
cmake: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by cmake)
strings /opt/lampp/lib/libstdc++.so.6 | grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBC_2.3
GLIBC_2.4
GLIBC_2.2.5
GLIBCXX_FORCE_NEW
不包含GLIBCXX_3.4.11和GLIBCXX_3.4.9
远程gcc++是包含GLIBCXX_3.4.11和GLIBCXX_3.4.9
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBC_2.2.5
GLIBC_2.3
GLIBC_2.4
GLIBC_2.3.2
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH
改变连接文件
rm -f /opt/lampp/lib/libstdc++.so.6
ln -s /usr/lib64/libstdc++.so.6.0.13 /opt/lampp/lib/libstdc++.so.6
mkdir debug
CMake Error: The source directory "/root/soft" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
必须在inception目录下才能找到lists文件
cd debug/
cmake .. -DWITH_DEBUG=OFF -DCMAKE_INSTALL_PREFIX=/var/inception -DWITH_SSL=bundled -DCMAKE_BUILD_TYPE=RELEASE -DWITH_ZLIB=bundled
出现下面输出结果表示配置编译环境成功
-- Configuring done
-- Generating done
-- Build files have been written to: /root/soft/inception/debug
编译
make install
在inception目录下,inception_build.sh脚本已经包括了配置编译环境以及make install的操作,所以,直接执行脚本即可完成编译操作
脚本内容如下:
#!/bin/bash debug_dir=$1 platform=$2 if [ $# -eq 1 ] then echo "building project in $1" platform="x" elif [ $# -ne 2 ] then echo "Usage: $0 builddir [platform(linux:Xcode)]" echo "EXAPMLE: $0 debug [Xcode]" exit fi Gplatform="" makerule="" if [ $platform == "Xcode" ] then Gplatform="-G Xcode" else makerule="make install" fi if [ -d $debug_dir ] then cd $debug_dir else mkdir $debug_dir cd $debug_dir # cmake && make && make install cmake -DWITH_DEBUG=OFF -DCMAKE_INSTALL_PREFIX=./mysql -DMYSQL_DATADIR=./mysql/data -DWITH_SSL=bundled -DCMAKE_BUILD_TYPE=RELEASE -DWITH_ZLIB=bundled -DMY_MAINTAINER_CXX_WARNINGS="-Wall -Wextra -Wunused -Wno-dev -Wwrite-strings -Wno-strict-aliasing -Wno-unused-parameter -Woverloaded-virtual" -DMY_MAINTAINER_C_WARNINGS="-Wall -Wextra -Wno-dev -Wunused -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement" $Gplatform .. fi if [ $platform != "Xcode" ] then $makerule fi
配置参数文件
inc.cnf
vim /var/inception/inc.cnf
[inception]
general_log=1
general_log_file=/var/inception/log/inception.log
port=6669
socket=/var/inception/inc.socket
character-set-client-handshake=0
character-set-server=utf8mb4
inception_remote_system_password=mysql123
inception_remote_system_user=admin
inception_remote_backup_port=3306
inception_remote_backup_host=192.168.110.133
inception_support_charset=utf8mb4
inception_enable_nullable=0
inception_check_primary_key=1
inception_check_column_comment=1
inception_check_table_comment=1
inception_osc_min_table_size=1
inception_osc_bin_dir=/var/inception/data/temp
inception_osc_chunk_time=0.1
inception_ddl_support=1
inception_enable_blob_type=1
inception_check_column_default_value=1
启动inception
inception web部分
环境配置
flask
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org flask_wtf
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org flask-script