!200 om 适配docker centos容器 gaussdb提示语句修改

Merge pull request !200 from gyt0221/master
This commit is contained in:
opengauss-bot
2020-09-09 16:13:05 +08:00
committed by Gitee
6 changed files with 28 additions and 8 deletions

View File

@ -2167,7 +2167,7 @@ int PostmasterMain(int argc, char* argv[])
/* init Opfusion function id */
InitOpfusionFunctionId();
ereport(LOG, (errmsg("Success to start openGauss Database, please press any key to exit...")));
ereport(LOG, (errmsg("Success to start openGauss Database. If you specify \"&\", please press any key to exit...")));
/*
* If enabled, start up syslogger collection subprocess

View File

@ -754,6 +754,8 @@ class DefaultValue():
cmd = "find %s -iname 'ifcfg-*-%s' -print" % (
SuSENetWorkConfPath, networkCardNum)
(status, output) = subprocess.getstatusoutput(cmd)
if (status != 0 and DefaultValue.checkDockerEnv()):
return output.strip()
if (status != 0):
raise Exception(ErrorCode.GAUSS_514["GAUSS_51400"] % cmd)
if (len(output.split('\n')) != 1):

View File

@ -275,7 +275,8 @@ class ErrorCode():
GAUSS_506 = {
'GAUSS_50600': "[GAUSS-50600] : The IP address cannot be pinged, "
"which is caused by network faults.",
'GAUSS_50601': "[GAUSS-50601] : The port [%s] is occupied.",
'GAUSS_50601': "[GAUSS-50601] : The port [%s] is occupied or the ip "
"address is incorrectly configured.",
'GAUSS_50602': "[GAUSS-50602] : Failed to bind network adapters.",
'GAUSS_50603': "[GAUSS-50603] : The IP address is invalid.",
'GAUSS_50604': "[GAUSS-50604] : Failed to obtain network interface "

View File

@ -59,7 +59,7 @@ class CheckDataDiskUsage(BaseItem):
# Check inode usage
diskName = g_disk.getMountPathByDataDir(path)
diskType = g_disk.getDiskMountType(diskName)
if (not diskType in ["xfs", "ext3", "ext4"]):
if (not diskType in ["xfs", "ext3", "ext4", "overlay"]):
resultStr += \
"Path(%s) inodes usage(%s) Warning reason: " \
"The file system type [%s] is unrecognized " \

View File

@ -47,10 +47,17 @@ actioItemMap = {
}
docker_no_need_check = ["net.core.wmem_max", "net.core.rmem_max",
"net.core.wmem_default",
"net.core.rmem_default", "net.sctp.sctp_mem",
"net.sctp.sctp_rmem", "net.sctp.sctp_wmem",
"net.core.netdev_max_backlog"]
"net.core.wmem_default", "net.core.rmem_default",
"net.sctp.sctp_mem", "net.sctp.sctp_rmem",
"net.sctp.sctp_wmem", "net.core.netdev_max_backlog",
"net.ipv4.tcp_max_tw_buckets", "net.ipv4.tcp_tw_reuse",
"net.ipv4.tcp_tw_recycle", "net.ipv4.tcp_retries2",
"net.ipv4.ip_local_reserved_ports", "net.ipv4.tcp_rmem",
"net.ipv4.tcp_wmem", "net.ipv4.tcp_max_syn_backlog",
"net.ipv4.tcp_syncookies", "net.ipv4.tcp_fin_timeout",
"net.ipv4.tcp_sack", "net.ipv4.tcp_timestamps",
"net.ipv4.tcp_retries1", "net.ipv4.tcp_syn_retries",
"net.ipv4.tcp_synack_retries"]
paraList = {}
@ -227,7 +234,7 @@ def checkSysctlParameter(kernelParameter, isSet):
if (patchlevel == "1" and key == "vm.extfrag_threshold"):
continue
# Skip check net.ipv4.tcp_tw_recycle with ARM
if (platform.machine() == "aarch64"
if ((platform.machine() == "aarch64" or platform.release().endswith("oe1.x86_64"))
and key == "net.ipv4.tcp_tw_recycle"):
continue
if (DefaultValue.checkDockerEnv() and key in docker_no_need_check):

View File

@ -915,6 +915,9 @@ def CheckNetWorkBonding(serviceIP, bondMode=False):
"""
networkCardNum = DefaultValue.getNICNum(serviceIP)
NetWorkConfFile = DefaultValue.getNetWorkConfFile(networkCardNum)
if (NetWorkConfFile.find("No such file or directory") >= 0
and DefaultValue.checkDockerEnv()):
return
networkCardNumList = []
networkCardNumList.append(networkCardNum)
bondingConfFile = "/proc/net/bonding/%s" % networkCardNum
@ -994,6 +997,13 @@ def getNetWorkTXRXValue(networkCardNum, valueType):
cmd = "/sbin/ethtool -g %s | grep '%s:' | tail -n 2" % (networkCardNum,
valueType)
(status, output) = subprocess.getstatusoutput(cmd)
if (output.find("Operation not supported") >= 0
and DefaultValue.checkDockerEnv()):
g_logger.log(" Warning reason: Failed to obtain the"
" network card TXRX value in docker container. Commands "
"for obtain the network card TXRX: %s. Error: \n%s"
% (cmd, output))
return (0, 0)
if (status != 0 or len(output.splitlines()) != 2):
g_logger.debug("Failed to obtain network card %s value. Commands"
" for getting information: %s." % (valueType, cmd))