首页 > 数据库 > > FAQ-如何解决修改IP过程中Linux系统很慢的问题
在修改IP时,需要先修改节点Linux系统中的IP。如果因为需要修改LdapServer服务的业务IP而修改Linux系统IP,重启网络服务后可能导致集群所有节点执行操作很慢。
说明:登录系统后,执行su - omm、ntpq -pn或者id admin命令,如果上述命令执行后,超过3s才返回结果,说明系统执行操作很慢。
修改了Linux系统IP后但未修改集群IP配置时,LdapClient中保留了LdapServer服务端旧的业务IP,需要在重启网络服务后修改IP配置文件之前手动修改所有节点的配置。修改后配置文件将自动生效。
tar -zxvf FusionInsight_SetupTool_6.5.1.tar.gz
cd /opt/FusionInsight_SetupTool/preinstall/tools/cluster/
main()
{
local argv="${1}"
if [ "${argv}" == "modify" ];then
cp /etc/nsswitch.conf /etc/nsswitch.conf_bak
sed -i "s/ldap//g" "/etc/nsswitch.conf"
elif [ "${argv}" == "restore" ];then
mv /etc/nsswitch.conf_bak /etc/nsswitch.conf
fi
}
source /home/omm/.profile
main "$@"main()
{
if [ "${argv}" == "modify" ];then
cp /etc/nsswitch.conf /etc/nsswitch.conf_bak
sed -i "s/sss//g" "/etc/nsswitch.conf"
elif [ "${argv}" == "restore" ];then
mv /etc/nsswitch.conf_bak /etc/nsswitch.conf
fi
}
source /home/omm/.profile
main "$@"main()
{
local ip1="${1}"
local ip2="${2}"
if [ -z "$ip1" -a -z "${ip2}" ];then
echo "IP paramters should not be null."
exit 1
fi
local basepath=$(ls "${BIGDATA_HOME}/" | grep "FusionInsight_BASE_")
local path=$(ls "${BIGDATA_HOME}/${basepath}/" | grep "SlapdClient")
local file="${BIGDATA_HOME}/${basepath}/"${path}/etc/ENV_VARS
local server_list_lines=$(grep -w "LDAP_SERVER_LIST" "${file}" | grep -v "#")
local server_list_lines_replace="LDAP_SERVER_LIST=${ip1},${ip2}"
local upg_list_lines=$(grep -w "LDAP_SERVER_LIST_UPGRADE" "${file}" | grep -v "#")
local upg_list_lines_replace="LDAP_SERVER_LIST_UPGRADE=${ip1},${ip2}"
if [ -n "${server_list_lines}" ];then
sed -i "s#${server_list_lines}#${server_list_lines_replace}#g" "${file}"
fi
if [ -n "${upg_list_lines}" ];then
sed -i "s#${upg_list_lines}#${upg_list_lines_replace}#g" "${file}"
fi
}
source /home/omm/.profile
main "$@"vi cluster.ini
修改其中的g_hosts=""参数值,将集群的所有节点IP(节点IP可以通过安装模板获取到)添加到其中,修改后保存退出编辑。
./clusterscp.sh put /opt/FusionInsight_SetupTool/preinstall/tools/cluster/modifynss.sh /tmp/
./clusterscp.sh put /opt/FusionInsight_SetupTool/preinstall/tools/cluster/modify.sh /tmp/
./clustercmd.sh "sh /tmp/modifynss.sh modify"
./clustercmd.sh "sh /tmp/modify.sh LDAPIP1 LDAPIP2"
其中LDAPIP1和LDAPIP2分别是新的LdapServer服务的业务IP。例如:./clustercmd.sh "sh /tmp/modify.sh 10.0.0.9 10.0.0.12"。
./clustercmd.sh "cat /etc/ldap.conf | grep URI"(非SUSE系统该命令不需要执行)
./clustercmd.sh "cat /etc/openldap/ldap.conf | grep URI"
./clustercmd.sh "sh /tmp/modifynss.sh restore"
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3147082/ ,如需转载,请注明出处,否则将追究法律责任。