2022年发布MySQL集群自动安装脚本1.0Mysql教程.docx
《2022年发布MySQL集群自动安装脚本1.0Mysql教程.docx》由会员分享,可在线阅读,更多相关《2022年发布MySQL集群自动安装脚本1.0Mysql教程.docx(12页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、2022年发布MySQL集群自动安装脚本1.0Mysql教程1. 在MySQL源代码书目下新建脚本 install.sh,把下面的代码添加到这个脚本中:#!/bin/bash# Title: MySQL 4.1 Cluster Installation Script# Version: 1.0# Date: 2022-11-11# Author: yipsilon# Email: yipsilon # License: General Public License (GPL) # Copyright(c) 2022, yipsilon All Rights Reserved # ChangeL
2、og #Installation Guide #1. Copy the script file into mysql source path #2. Change script files permission to 755#3. execute it and wait for.# MySQL Server Config #Determine to install MySQL server#0 means do not install server programsINST_SERVER=1#MySQL installation pathINST_PATH=/usr/local/mysql#D
3、efine the ports of MySQL installation, intput strings of PORT with whitespace separated.#e.g. 3306 3307 means install two MySQL servers:# The first server will be installed to $INST_PATH/1 and listen 3306 port.# The second server will be installed to $INST_PATH/2 and listen 3307 port.# . .IN
4、ST_PORTS=3306#The management server informationMGM_HOST=192.168.1.253MGM_PORT=2200# MySQL Cluster Config #Determine to install cluster#0 means do not install cluster programsINST_CLUSTER=1#Define COMPUTERs in config.ini, intput strings of HostName with whitespace separated.#The Id attribute is auto
5、increment and start with 1.#e.g. 192.168.1.253 192.168.252 will generate the following code#COMPUTER#Id=1#HostName=192.168.1.253#COMPUTER#Id=2#HostName=192.168.1.252COMPUTERS=192.168.1.253 192.168.1.252#Define MGMs in config.ini, intput strings of HostName with whitespace separated.#e.g. 192.168.1.2
6、53 192.168.252 will generate the following code#MGM#HostName=192.168.1.253#MGM#HostName=192.168.1.252MGMS=192.168.1.253#Define DBs in config.ini, intput ids of ExecuteOnComputer with whitespace separated.#e.g. 1 2 will generate the following code#DB#ExecuteOnComputer=1#DB#ExecuteOnComputer=2DBS=1#De
7、fine APIs in config.ini, intput ids of ExecuteOnComputer with whitespace separated.#e.g. 1 0 1 2 will generate the following code#API#ExecuteOnComputer=1#API#API#ExecuteOnComputer=1#API#ExecuteOnComputer=2APIS=1 0 2 2# Starting to install programs, do not modify them! #echo Starting to install progr
8、ams > install.log#Find installation pathif $# -gt 0 thenINST_PATH=$1elseINST_PATH=/usr/local/mysqlfiif 0 -lt $INST_SERVER thenecho Now, installing the MySQL servers.#Loop to install mysql serversINSTALLED_SERVER_COUNT=1for PORT in $INST_PORTSdo#Define the current mysql server inst
9、allation pathMYSL_PATH=$INST_PATH/$INSTALLED_SERVER_COUNT#Configure mysql serverecho Exec ./configure -prefix=$MYSL_PATH -with-pthread -with-unix-socket-path=$MYSL_PATH/var/mysql.sock -with-mysqld-user=root -with-tcp-port=$PORT -with-charset=gbk -with-ndbcluster >> install.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022 发布 MySQL 集群 自动 安装 脚本 1.0 教程
限制150内