MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / InitEnv

Function InitEnv

tools/deploy.py:56–70  ·  view source on GitHub ↗
(tablet_conf)

Source from the content-addressed store, hash-verified

54 return (prefix, suffix, is_local)
55
56def InitEnv(tablet_conf):
57 for item in tablet_conf["address_arr"]:
58 host = item["address"].split(":")[0]
59 (prefix, suffix, is_local) = GetPrefixAndSuffix(host)
60 cmd_arr = []
61 print("Init Env on {}".format(host))
62 cmd_arr.append("{} echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled;"
63 "echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag {}".format(prefix, suffix))
64 cmd_arr.append("{} swapoff -a {}".format(prefix, suffix))
65 for cmd in cmd_arr:
66 (returncode,output,errout) = RunWithRetunCode(cmd)
67 if returncode != 0:
68 print("execute cmd[{}] failed! error msg: {}".format(cmd, errout))
69 return
70 print("execute cmd[{}] success".format(cmd))
71
72def CheckJava(host):
73 (prefix, suffix, is_local) = GetPrefixAndSuffix(host)

Callers 1

deploy.pyFile · 0.85

Calls 3

GetPrefixAndSuffixFunction · 0.85
RunWithRetunCodeFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected