MySQL Cluster verifies whether the memory in the management node configuration exceeds the standard script

Source: Internet
Author: User

MySQL Cluster verifies whether the memory in the management node configuration exceeds the standard script to verify the management node config. the shell script configured by the ini parameter to check whether memory has exceeded the memory quota. The above data node id must be included during running and the cluster must be in the working state, at least the manage node and data node must be in the "run check_memery.sh" Startup state:

#! /Bin/bashusage () {echo "---------------------------" echo "Usage: $ (basename $0) NodeId" # data node ID echo "-----------------------------" echo exit 1} print_size () {string1 =1 (echo $1 | sed-e: a-e's/^. \ {1, 40 \} $ /&. /; ta ') echo-e "$ string1 (MB): \ t $2"} if ["$1" = "]; then usagefistring1 = $ (echo $1 | egrep "^ [0-9] + $") if ["$1 "! = "$ String1"]; then usagefi # 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 MaxNoOfAttributesksize = 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 # AttributesTSIZE = $ ($ 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 "$ TSIZEMEMSIZE = $ (echo" scale = 2; $ MEMSIZE/$ gsize "| bc-l 2>/dev/null) echoecho" ****** Total Memory size: $ {MEMSIZE} GB ******"

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.