solusvm 主控端迁移
2024-09-06 07:55:54
难点在于solusvm被控端已经开了小鸡的情况。
备份数据库:
#!/bin/sh ## Vars
CONF=/usr/local/solusvm/includes/solusvm.conf
FILENAME=solusvm_database_dump.gz ## Get the database details
DN=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DU=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DP=`grep -m1 $: ${CONF} | cut -d ':' -f `; ## Do the dump
echo "Dumping database..."
mysqldump --opt -h localhost --user=${DU} --password=${DP} ${DN} > ~/${FILENAME};
echo "Complete."
新主动端恢复数据库:
#!/bin/sh ## Vars
CONF=/usr/local/solusvm/includes/solusvm.conf
FILENAME=solusvm_database_dump.gz ## Get the database details
DN=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DU=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DP=`grep -m1 $: ${CONF} | cut -d ':' -f `; ## Do the dump
echo "Restoring database..."
mysql --user=${DU} --password=${DP} ${DN} < ~/${FILENAME};
echo "Complete."
注意恢复数据库后,重新到界面对node,更新其key password。
顺便改进下,做个快键键登录连接数据库:
!/bin/sh ## Vars
CONF=/usr/local/solusvm/includes/solusvm.conf ## Get the database details
DN=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DU=`grep -m1 $: ${CONF} | cut -d ':' -f `;
DP=`grep -m1 $: ${CONF} | cut -d ':' -f `; mysql --user=${DU} --password=${DP} ${DN};
最新文章
- Centos 7 开启端口
- Spring boot学习一
- ORA-1034 ORACLE not available (转)
- 解决项目中.a文件的冲突
- Winform文件下载之WebClient
- [bug] 未能加载文件或程序集“SIPEPS, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。系统找不到指定的文件。
- HD1532Drainage Ditches(最大流模板裸题 + 邻接表)
- poj2996 模拟
- Failed to connect to remote VM. Connection refused. Connection refused: connect.
- 将数组之中的省份市区地区ID改成对用中文字符
- Mac中MacPorts安装和使用
- tomcat容器启动的启动过程(三)
- npm install含义 及vue安装启动项目时报错解决及vue建项目时各文件间的依赖关系
- SaberRD之瞬态分析
- Git命令以及常见注意事项
- js三种经典排序:冒泡排序、插入排序、快速排序
- 梯度下降法原理与python实现
- [转]C++编译链接过程详解
- Map、Set、List 集合 差别 联系
- 查看docker容器日志