验证管理节点config.ini参数配置的shell脚本,看memory是否超标,运行的时候需要附带上面data node id,
而且cluster要处于工作状态,最起码manage node和data node要处于启动状态
run check_memery.sh
脚本内容下:
# 注明,是从网友飞鸿大哥那里趴过来,改改运行通过的,肯定有很多需要完善的地方,欢迎大家提出宝贵的意见。
#!/bin/bash
usage()
{
echo "-----------------------------"
echo "Usage:$(basename $0) NodeId" #数据节点的ID
echo "-----------------------------"
echo
exit 1
}
print_size ()
{
string1=$(echo $1|sed -e :a -e 's/^.\{1,40\}$/&./;ta')
echo -e "$string1 (MB):\t$2"
}
if [ "$1" == "" ]; then
usage
fi
string1=$(echo $1|egrep "^[0-9]+$")
if [ "$1" != "$string1" ]; then
usage
fi
# GETVAL="ndb_config --id=$1 -q"
GETVAL="/root/mysql-cluster-gpl-7.2.7-linux2.6-x86_64/bin/ndb_config --id=$1 -q"
#ndb_config --id=12 -q MaxNoOfAttributes
ksize=1024
msize=$(echo "scale=2; 1024*1024" | bc -l 2>/dev/null)
gsize=$(echo "scale=2; 1024*1024*1024" | bc -l 2>/dev/null)
echo "KB:$ksize MB:$msize GB:$gsize"
MEMSIZE=0
#Attributes
TSIZE=$($GETVAL MaxNoOfAttributes)
TSIZE=$(echo "scale=0; $TSIZE*200" | bc -l 2>/dev/null)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "MaxNoOfAttributes" $TSIZE
#Attributes
TSIZE=$($GETVAL MaxNoOfTables)
TSIZE=$(echo "scale=0; $TSIZE*20*$ksize" | bc -l 2>/dev/null)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "MaxNoOfTables" $TSIZE
#Attributes
TSIZE=$($GETVAL MaxNoOfOrderedIndexes)
TSIZE=$(echo "scale=0; $TSIZE*10*$ksize" | bc -l 2>/dev/null)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "MaxNoOfOrderedIndexes" $TSIZE
#Attributes
TSIZE=$($GETVAL MaxNoOfUniqueHashIndexes)
TSIZE=$(echo "scale=0; $TSIZE*10*$ksize" | bc -l 2>/dev/null)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "MaxNoOfUniqueHashIndexes" $TSIZE
#Attributes
TSIZE=$($GETVAL MaxNoOfConcurrentOperations)
TSIZE=$(echo "scale=0; $TSIZE*1*$ksize" | bc -l 2>/dev/null)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "MaxNoOfConcurrentOperations" $TSIZE
#Attributes
TSIZE=$($GETVAL TransactionBufferMemory)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "TransactionBufferMemory" $TSIZE
#Attributes
TSIZE=$($GETVAL IndexMemory)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "IndexMemory" $TSIZE
#Attributes
TSIZE=$($GETVAL DataMemory)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "DataMemory" $TSIZE
#Attributes
TSIZE=$($GETVAL UndoIndexBuffer)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "UndoIndexBuffer" $TSIZE
#Attributes
TSIZE=$($GETVAL UndoDataBuffer)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "UndoDataBuffer" $TSIZE
#Attributes
TSIZE=$($GETVAL RedoBuffer)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "RedoBuffer" $TSIZE
#Attributes
TSIZE=$($GETVAL LongMessageBuffer)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "LongMessageBuffer" $TSIZE
#Attributes
TSIZE=$($GETVAL DiskPageBufferMemory)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "DiskPageBufferMemory" $TSIZE
#Attributes
TSIZE=$($GETVAL SharedGlobalMemory)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "SharedGlobalMemory" $TSIZE
#Attributes
TSIZE=$($GETVAL BackupMemory)
MEMSIZE=$(echo "scale=2; $MEMSIZE+$TSIZE" | bc -l 2>/dev/null)
TSIZE=$(echo "scale=0; $TSIZE/$msize" | bc -l 2>/dev/null)
print_size "BackupMemory" $TSIZE
MEMSIZE=$(echo "scale=2; $MEMSIZE/$gsize" | bc -l 2>/dev/null)
echo
echo "******Total Memory size: ${MEMSIZE}GB******"
分享到:
相关推荐
Mysql 高可用 InnoDB Cluster 多节点搭建过程
在MySQL Cluster 环境的配置文件 config.ini 里面,每一类节点都有两个(或以上)的相应配置项组,每一类节点的配置项都主要由两部分组成,一部分是同类所有节点相同的配置项组,在[NDB_MGM DEFAULT]、[NDBD DEFAULT...
MySQL Cluster 是专门用来做MySQL集群的程序,简单来讲它是一种技术,该技术能够在无共享的系统中部署内存中数据库的“Cluster”,通过无共享体系结构,系统能够使用各种廉价的硬件,并对所有硬件没有任何特殊的要求...
mysql-cluster for windows配置mysql-cluster for windows配置
NULL 博文链接:https://wilr.iteye.com/blog/2168659
MySQL Cluster 8.0.27( Microsoft Windows) 适用于Windows (x86, 64-bit), ZIP Archive
是这样安排这些服务器的,192.168.0.2 作为 MySQL Cluster 的管理节点,2 ~ 6 既做数据节点(DATA node),也做SQL节点(SQL node),7 ~ 10 也做SQL节点。LVS采用 VS/DR 的模式,因此把 192.168.0.2 也同时作为 LVS 的 ...
Mysql Cluster 7.6.4 环境搭建,非常详细的文档。。。。
基于Windows的MySQL Cluster搭建及配置详解,从下载到安装十分详细的介绍了对mysql cluster 的搭建,以及对搭建过程中的错误,给与详细的解释。
MySQL Cluster 由一组计算机构成,每台计算机上均运行着多种进程,包括MySQL服务器,NDB Cluster 的数据节点,管理服务器,以及(可能)专门的数据访问程序。关于 Cluster 中这些组件的关系。 文档包含如下: 1、...
资源名称:MySQL Cluster 7.2.5 配置实例内容简介: MySQL Cluster 是一种技术,该技术允许在无共享的系统中部署“内存中”数据库的 Cluster 。通过无共享体系结构,系统能够使用廉价的硬件,而且对软硬件无特殊...
mysql cluster7.13在windows平台下的集群配置
MySQL_Cluster集群配置方案MySQL_Cluster集群配置方案MySQL_Cluster集群配置方案
MySQL Cluster(MySQL 集群) 测试环境: CentOS4.6 数据库版本: mysql-cluster-gpl-6.3.20
电子书 mysql Cluster.pdf
This guide explores how to tune and optimize the MySQL Cluster database to handle diverse workload requirements. It discusses data access patterns and how to build distribution awareness into ...
MySQL Cluster集群构建实战
mysql cluster集群介绍,及其实现架构
MySQL Cluster 8.0.27(mysql-cluster-community-server-8.0.27-1.el8.x86_64.rpm ) 适用于Red Hat Enterprise Linux 8 / Oracle Linux 8 (x86, 64-bit), RPM Package MySQL Server