⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 make-config.sh

📁 mysql-5.0.22.tar.gz源码包
💻 SH
字号:
#!/bin/shbaseport=""basedir=""proc_no=1node_id=1d_file=/tmp/d.$$dir_file=/tmp/dirs.$$config_file=/tmp/config.$$cluster_file=/tmp/cluster.$$add_procs(){	type=$1; shift	while [ $# -ne 0 ]	do		add_proc $type $1		shift	done}add_proc (){	case $type in	mgm)		echo "$proc_no.ndb_mgmd" >> $dir_file		echo "[ndb_mgmd]"        >> $config_file		echo "Id: $node_id"      >> $config_file		echo "HostName: $2"      >> $config_file		node_id=`expr $node_id + 1`		;;	api)		echo "$proc_no.ndb_api" >> $dir_file                echo "[api]"            >> $config_file                echo "Id: $node_id"     >> $config_file                echo "HostName: $2"     >> $config_file		node_id=`expr $node_id + 1`		;;	ndb)		echo "$proc_no.ndbd" >> $dir_file                echo "[ndbd]"        >> $config_file                echo "Id: $node_id"  >> $config_file                echo "HostName: $2"  >> $config_file		node_id=`expr $node_id + 1`		;;	mysqld)		echo "$proc_no.mysqld" >> $dir_file                echo "[ndb_mgmd]"      >> $config_file                echo "Id: $node_id"    >> $config_file                echo "HostName: $2"    >> $config_file		node_id=`expr $node_id + 1`		;;	mysql)		echo "$proc_no.mysql" >> $dir_file		;;	esac	proc_no=`expr $proc_no + 1`}cnf=/dev/nullcat $1 | while read linedo	case $line in	baseport:*) baseport=`echo $line | sed 's/baseport[ ]*:[ ]*//g'`;;	basedir:*) basedir=`echo $line | sed 's/basedir[ ]*:[ ]*//g'`;;	mgm:*) add_procs mgm `echo $line | sed 's/mgm[ ]*:[ ]*//g'`;;	api:*) add_procs api `echo $line | sed 's/api[ ]*:[ ]*//g'`;;	ndb:*) add_procs ndb `echo $line | sed 's/ndb[ ]*:[ ]*//g'`;;	mysqld:*) add_procs mysqld `echo $line | sed 's/mysqld[ ]*:[ ]*//g'`;;	mysql:*) add_procs mysql `echo $line | sed 's/mysql[ ]*:[ ]*//g'`;;	"-- cluster config") 		if [ "$cnf" = "/dev/null" ]		    then		    cnf=$cluster_file		else		    cnf=/dev/null		fi		line="";;	    *) echo $line >> $cnf; line="";;	esac	if [ "$line" ]	then	    echo $line >> $d_file	fidonecat $dir_file | xargs mkdir -pif [ -f $cluster_file ]    then    cat $cluster_file $config_file >> /tmp/config2.$$    mv /tmp/config2.$$ $config_filefifor i in `find . -type d -name '*.ndb_mgmd'`  do  cp $config_file $i/config.inidonemv $d_file d.txtrm -f $config_file $dir_file $cluster_file

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -