不修改成型大数据结构,升级版本的方法;以及变更mycat模型的方法

 (1) 升级时。

  需要在解压前备份旧的数据结构,解压后再恢复到旧的数据结构;并且阻止结构的升级脚本。

http://10.30.120.1/dualvenDoc/allshell/blob/master/chinese/0317.sh

function beforeUnzip()
{
now_version=`sed -n 's/<version>\(.*\)<\/version>/\1/p' $app_path/sql/version.xml`
echo $now_version
start_date=${now_version:5:8}
echo $start_date
if [ $start_date -le "20200317" ]; then 
   echo ' it is the small version'
   cp -f $hibernate_path $hibernate_path.old
   cp -f $hibernate_class $hibernate_class.old
else
  echo "Before:it is the bigger version; and I will  do nothing"
fi
}
function afterUnzipBexeLargeSql()
{
echo $start_date
if [ $start_date -le "20200317" ]; then 
   echo ' it is the small version'
   cp -f $hibernate_path $hibernate_path.new
   cp -f $hibernate_class $hibernate_class.new
   cp -f $hibernate_path.old $hibernate_path
   cp -f $hibernate_class.old  $hibernate_class
   
   mv $sql0317 $sql0317.txt
else
  echo "After:it is the bigger version; and I will  do nothing"
fi
}

(2)  由于在集群1,2,3,4种 情况下的xml变更中,每种 安装的情况不一样,笼统覆盖 schema.xml会有问题,比如IP,不一定是本地localhost; 又或者不是统一的数据库端口,有根据具体的环境特例安装。

所以最好的方法,只变更schema.xml上面的table结构。不变更数据结点等本地化配置。

猜你喜欢

转载自blog.csdn.net/dualvencsdn/article/details/114395123