为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
- 【TiDB 版本】:lightning版本 4.0.0.RC1 TiDB版本4.0.0.RC2
- 【问题描述】:启动lightning的时候报错,但是telnet该端口是通的,而且通过客户端去访问数据库也正常。而且在3.0.5版本的是导入过一次。机器配置是完全一样的。
[2020/05/25 17:14:45.193 +08:00] [ERROR] [main.go:75] ["tidb lightning encountered error"] [error="cannot fetch settings from TiDB, please manually fill in `tidb.port` and `tidb.pd-addr`: get http://10.204.9.134:10080/settings http status code != 200, message <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\
<html><head>\
<meta http-equiv=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\
<title>ERROR: The requested URL could not be retrieved</title>\
<style type=\"text/css\"><!-- \
/*\
Stylesheet for Squid Error pages\
Adapted from design by Free CSS Templates\
http://www.freecsstemplates.org\
Released for free under a Creative Commons Attribution 2.5 License\
*/\
\
/* Page basics */\
* {\
\tfont-family: verdana, sans-serif;\
}\
\
html body {\
\tmargin: 0;\
\tpadding: 0;\
\tbackground: #efefef;\
\tfont-size: 12px;\
\tcolor: #1e1e1e;\
}\
\
/* Page displayed title area */\
#titles {\
\tmargin-left: 15px;\
\tpadding: 10px;\
\tpadding-left: 100px;\
\tbackground: url('http://www.squid-cache.org/Artwork/SN.png') no-repeat left;\
}\
\
/* initial title */\
#titles h1 {\
\tcolor: #000000;\
}\
#titles h2 {\
\tcolor: #000000;\
}\
\
/* special event: FTP success page titles */\
#titles ftpsuccess {\
\tbackground-color:#00ff00;\
\twidth:100%;\
}\
\
/* Page displayed body content area */\
#content {\
\tpadding: 10px;\
\tbackground: #ffffff;\
}\
\
/* General text */\
p {\
}\
\
/* error brief description */\
#error p {\
}\
\
/* some data which may have caused the problem */\
#data {\
}\
\
/* the error message received from the system or other software */\
#sysmsg {\
}\
\
pre {\
font-family:sans-serif;\
}\
\
/* special event: FTP / Gopher directory listing */\
#dirmsg {\
font-family: courier;\
color: black;\
font-size: 10pt;\
}\
#dirlisting {\
margin-left: 2%;\
margin-right: 2%;\
}\
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {\
border-bottom: groove;\
}\
#dirlisting td.size {\
width: 50px;\
text-align: right;\
padding-right: 5px;\
}\
\
/* horizontal lines */\
hr {\
\tmargin: 0;\
}\
\
/* page displayed footer area */\
#footer {\
\tfont-size: 9px;\
\tpadding-left: 10px;\
}\
\
\
body\
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }\
:lang(he) { direction: rtl; float: right; }\
--></style>\
</head><body id=ERR_CONNECT_FAIL>\
<div id=\"titles\">\
<h1>ERROR</h1>\
<h2>The requested URL could not be retrieved</h2>\
</div>\
<hr>\
\
<div id=\"content\">\
<p>The following error was encountered while trying to retrieve the URL: <a href=\"http://10.204.9.134:10080/settings\">http://10.204.9.134:10080/settings</a></p>\
\
<blockquote id=\"error\">\
<p><b>Connection to 10.204.9.134 failed.</b></p>\
</blockquote>\
\
<p id=\"sysmsg\">The system returned: <i>(110) Connection timed out</i></p>\
\
<p>The remote host or network may be down. Please try the request again.</p>\
\
<p>Your cache administrator is <a href=\"mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20hqyum01vl.fcbox.com%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(110)%20Connection%20timed%20out%0D%0ATimeStamp%3A%20Mon,%2025%20May%202020%2009%3A14%3A45%20GMT%0D%0A%0D%0AClientIP%3A%2010.204.9.90%0D%0AServerIP%3A%2010.204.9.134%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2Fsettings%20HTTP%2F1.1%0AHost%3A%2010.204.9.134%3A10080%0D%0AUser-Agent%3A%20Go-http-client%2F1.1%0D%0AAccept-Encoding%3A%20gzip%0D%0A%0D%0A%0D%0A\">webmaster</a>.</p>\
\
<br>\
</div>\
\
<hr>\
<div id=\"footer\">\
<p>Generated Mon, 25 May 2020 09:14:45 GMT by hqyum01vl.fcbox.com (squid/3.1.14)</p>\
<!-- ERR_CONNECT_FAIL -->\
</div>\
</body></html>\
"] [errorVerbose="get http://10.204.9.134:10080/settings http status code != 200, message <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\
<html><head>\
<meta http-equiv=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\
<title>ERROR: The requested URL could not be retrieved</title>\
<style type=\"text/css\"><!-- \
/*\
Stylesheet for Squid Error pages\
Adapted from design by Free CSS Templates\
http://www.freecsstemplates.org\
Released for free under a Creative Commons Attribution 2.5 License\
*/\
\
/* Page basics */\
* {\
\tfont-family: verdana, sans-serif;\
}\
\
html body {\
\tmargin: 0;\
\tpadding: 0;\
\tbackground: #efefef;\
\tfont-size: 12px;\
\tcolor: #1e1e1e;\
}\
\
/* Page displayed title area */\
#titles {\
\tmargin-left: 15px;\
\tpadding: 10px;\
\tpadding-left: 100px;\
\tbackground: url('http://www.squid-cache.org/Artwork/SN.png') no-repeat left;\
}\
\
/* initial title */\
#titles h1 {\
\tcolor: #000000;\
}\
#titles h2 {\
\tcolor: #000000;\
}\
\
/* special event: FTP success page titles */\
#titles ftpsuccess {\
\tbackground-color:#00ff00;\
\twidth:100%;\
}\
\
/* Page displayed body content area */\
#content {\
\tpadding: 10px;\
\tbackground: #ffffff;\
}\
\
/* General text */\
p {\
}\
\
/* error brief description */\
#error p {\
}\
\
/* some data which may have caused the problem */\
#data {\
}\
\
/* the error message received from the system or other software */\
#sysmsg {\
}\
\
pre {\
font-family:sans-serif;\
}\
\
/* special event: FTP / Gopher directory listing */\
#dirmsg {\
font-family: courier;\
color: black;\
font-size: 10pt;\
}\
#dirlisting {\
margin-left: 2%;\
margin-right: 2%;\
}\
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {\
border-bottom: groove;\
}\
#dirlisting td.size {\
width: 50px;\
text-align: right;\
padding-right: 5px;\
}\
\
/* horizontal lines */\
hr {\
\tmargin: 0;\
}\
\
/* page displayed footer area */\
#footer {\
\tfont-size: 9px;\
\tpadding-left: 10px;\
}\
\
\
body\
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }\
:lang(he) { direction: rtl; float: right; }\
--></style>\
</head><body id=ERR_CONNECT_FAIL>\
<div id=\"titles\">\
<h1>ERROR</h1>\
<h2>The requested URL could not be retrieved</h2>\
</div>\
<hr>\
\
<div id=\"content\">\
<p>The following error was encountered while trying to retrieve the URL: <a href=\"http://10.204.9.134:10080/settings\">http://10.204.9.134:10080/settings</a></p>\
\
<blockquote id=\"error\">\
<p><b>Connection to 10.204.9.134 failed.</b></p>\
</blockquote>\
\
<p id=\"sysmsg\">The system returned: <i>(110) Connection timed out</i></p>\
\
<p>The remote host or network may be down. Please try the request again.</p>\
\
<p>Your cache administrator is <a href=\"mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20hqyum01vl.fcbox.com%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(110)%20Connection%20timed%20out%0D%0ATimeStamp%3A%20Mon,%2025%20May%202020%2009%3A14%3A45%20GMT%0D%0A%0D%0AClientIP%3A%2010.204.9.90%0D%0AServerIP%3A%2010.204.9.134%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2Fsettings%20HTTP%2F1.1%0AHost%3A%2010.204.9.134%3A10080%0D%0AUser-Agent%3A%20Go-http-client%2F1.1%0D%0AAccept-Encoding%3A%20gzip%0D%0A%0D%0A%0D%0A\">webmaster</a>.</p>\
\
<br>\
</div>\
\
<hr>\
<div id=\"footer\">\
<p>Generated Mon, 25 May 2020 09:14:45 GMT by hqyum01vl.fcbox.com (squid/3.1.14)</p>\
<!-- ERR_CONNECT_FAIL -->\
</div>\
</body></html>\
\
github.com/pingcap/tidb-lightning/lightning/common.GetJSON\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/lightning/common/util.go:281\
github.com/pingcap/tidb-lightning/lightning/common.(*TLS).GetJSON\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/lightning/common/security.go:142\
github.com/pingcap/tidb-lightning/lightning/config.(*Config).Adjust\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/lightning/config/config.go:458\
github.com/pingcap/tidb-lightning/lightning.(*Lightning).RunOnce\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/lightning/lightning.go:139\
main.main\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/cmd/tidb-lightning/main.go:72\
runtime.main\
\t/usr/local/go/src/runtime/proc.go:203\
runtime.goexit\
\t/usr/local/go/src/runtime/asm_amd64.s:1357\
cannot fetch settings from TiDB, please manually fill in `tidb.port` and `tidb.pd-addr`"]
启动命令nohup bin/tikv-importer -C conf/tikv-importer.toml > nohup.out &
配置文件如下
log-file = "tikv-importer.log"
log-level = "info"
[server]
addr = "10.204.9.90:8287"
[metric]
job = "tikv-importer"
interval = "15s"
address = ""
[import]
import-dir = "/data32/ssd2/data.import"
[lightning]
# region-concurrency =
level = "info"
file = "tidb-lightning.log"
[tikv-importer]
addr = "10.204.9.90:8287"
[mydumper]
data-source-dir = "/data33/pay-data0521"
[tidb]
host = "10.204.9.135"
port = 4000
user = "root"
password = ""
status-port = 10080
yilong
(yi888long)
4
看报错是134,请问134是哪个节点? 这里配置连接的是135,对吧?
对的,一样是TiDB节点,这是后面我担心不通的时候改了下。
可以的,这台机器其实是该集群,TiFlash所在机器。理论上都应该都没问题
这台机器上有多个IP,如何确定绑定的哪个IP呢,正常来说就是主机IP吧
cannot fetch settings from TiDB, please manually fill in
tidb.portand
tidb.pd-addr``
看错误日志有这行提示信息,麻烦手动在 lightning 配置文件中配置一下 pd-addr
再试试
这个问题是因为在在使用lightning之前去使用了代理。导致连不上PD。不过为啥lightning会用到域名呢。不是都配置的是ip么
是export 进去的 http_proxy = ip:port 。当时也考虑过是不是被转发了,但是想了下我整个配置都没用域名,所以没深究这块
现在你的疑问,是 “为啥lightning会用到域名” 吗?
能麻烦给一下你觉得 lightning 使用了域名时的:
- lightning 配置信息
- 对应的 lightning log
- 是否指定了 http_proxy(如果指定了,是指定的什么)
1、我的配置中没有使用任何域名。
2、指定了http_proxy 这个是内部IP。
3、配置和日志在上面有。如果需要其他日志也应该可以找到。但是有价值的就是连不上的报错。
就是这个主题中的报错日志
[2020/05/25 17:14:45.193 +08:00] [ERROR] [main.go:75] ["tidb lightning encountered error"] [error="cannot fetch settings from TiDB, please manually fill in `tidb.port` and `tidb.pd-addr`: get http://10.204.9.134:10080/settings http status code != 200, message <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\
<html><head>\
<meta http-equiv=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\
<title>ERROR: The requested URL could not be retrieved</title>\
<style type=\"text/css\"><!-- \
/*\
Stylesheet for Squid Error pages\
Adapted from design by Free CSS Templates\
http://www.freecsstemplates.org\
Released for free under a Creative Commons Attribution 2.5 License\
*/\
\
/* Page basics */\
* {\
\tfont-family: verdana, sans-serif;\
}\
\
html body {\
\tmargin: 0;\
\tpadding: 0;\
\tbackground: #efefef;\
\tfont-size: 12px;\
\tcolor: #1e1e1e;\
}\
\
/* Page displayed title area */\
#titles {\
\tmargin-left: 15px;\
\tpadding: 10px;\
\tpadding-left: 100px;\
\tbackground: url('http://www.squid-cache.org/Artwork/SN.png') no-repeat left;\
}\
\
/* initial title */\
#titles h1 {\
\tcolor: #000000;\
}\
#titles h2 {\
\tcolor: #000000;\
}\
\
/* special event: FTP success page titles */\
#titles ftpsuccess {\
\tbackground-color:#00ff00;\
\twidth:100%;\
}\
\
/* Page displayed body content area */\
#content {\
\tpadding: 10px;\
\tbackground: #ffffff;\
}\
\
/* General text */\
p {\
}\
\
/* error brief description */\
#error p {\
}\
\
/* some data which may have caused the problem */\
#data {\
}\
\
/* the error message received from the system or other software */\
#sysmsg {\
}\
\
pre {\
font-family:sans-serif;\
}\
\
/* special event: FTP / Gopher directory listing */\
#dirmsg {\
font-family: courier;\
color: black;\
font-size: 10pt;\
}\
#dirlisting {\
margin-left: 2%;\
margin-right: 2%;\
}\
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {\
border-bottom: groove;\
}\
#dirlisting td.size {\
width: 50px;\
text-align: right;\
padding-right: 5px;\
}\
\
/* horizontal lines */\
hr {\
\tmargin: 0;\
}\
\
/* page displayed footer area */\
#footer {\
\tfont-size: 9px;\
\tpadding-left: 10px;\
}\
\
\
body\
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }\
:lang(he) { direction: rtl; float: right; }\
--></style>\
</head><body id=ERR_CONNECT_FAIL>\
<div id=\"titles\">\
<h1>ERROR</h1>\
<h2>The requested URL could not be retrieved</h2>\
</div>\
<hr>\
\
<div id=\"content\">\
<p>The following error was encountered while trying to retrieve the URL: <a href=\"http://10.204.9.134:10080/settings\">http://10.204.9.134:10080/settings</a></p>\
\
<blockquote id=\"error\">\
<p><b>Connection to 10.204.9.134 failed.</b></p>\
</blockquote>\
\
<p id=\"sysmsg\">The system returned: <i>(110) Connection timed out</i></p>\
\
<p>The remote host or network may be down. Please try the request again.</p>\
\
<p>Your cache administrator is <a href=\"mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20hqyum01vl.fcbox.com%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(110)%20Connection%20timed%20out%0D%0ATimeStamp%3A%20Mon,%2025%20May%202020%2009%3A14%3A45%20GMT%0D%0A%0D%0AClientIP%3A%2010.204.9.90%0D%0AServerIP%3A%2010.204.9.134%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2Fsettings%20HTTP%2F1.1%0AHost%3A%2010.204.9.134%3A10080%0D%0AUser-Agent%3A%20Go-http-client%2F1.1%0D%0AAccept-Encoding%3A%20gzip%0D%0A%0D%0A%0D%0A\">webmaster</a>.</p>\
\
<br>\
</div>\
\
<hr>\
<div id=\"footer\">\
<p>Generated Mon, 25 May 2020 09:14:45 GMT by hqyum01vl.fcbox.com (squid/3.1.14)</p>\
<!-- ERR_CONNECT_FAIL -->\
</div>\
</body></html>\
"] [errorVerbose="get http://10.204.9.134:10080/settings http status code != 200, message <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\
<html><head>\
<meta http-equiv=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\
<title>ERROR: The requested URL could not be retrieved</title>\
<style type=\"text/css\"><!-- \
/*\
Stylesheet for Squid Error pages\
Adapted from design by Free CSS Templates\
http://www.freecsstemplates.org\
Released for free under a Creative Commons Attribution 2.5 License\
*/\
\
/* Page basics */\
* {\
\tfont-family: verdana, sans-serif;\
}\
\
html body {\
\tmargin: 0;\
\tpadding: 0;\
\tbackground: #efefef;\
\tfont-size: 12px;\
\tcolor: #1e1e1e;\
}\
\
/* Page displayed title area */\
#titles {\
\tmargin-left: 15px;\
\tpadding: 10px;\
\tpadding-left: 100px;\
\tbackground: url('http://www.squid-cache.org/Artwork/SN.png') no-repeat left;\
}\
\
/* initial title */\
#titles h1 {\
\tcolor: #000000;\
}\
#titles h2 {\
\tcolor: #000000;\
}\
\
/* special event: FTP success page titles */\
#titles ftpsuccess {\
\tbackground-color:#00ff00;\
\twidth:100%;\
}\
\
/* Page displayed body content area */\
#content {\
\tpadding: 10px;\
\tbackground: #ffffff;\
}\
\
/* General text */\
p {\
}\
\
/* error brief description */\
#error p {\
}\
\
/* some data which may have caused the problem */\
#data {\
}\
\
/* the error message received from the system or other software */\
#sysmsg {\
}\
\
pre {\
font-family:sans-serif;\
}\
\
/* special event: FTP / Gopher directory listing */\
#dirmsg {\
font-family: courier;\
color: black;\
font-size: 10pt;\
}\
#dirlisting {\
margin-left: 2%;\
margin-right: 2%;\
}\
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {\
border-bottom: groove;\
}\
#dirlisting td.size {\
width: 50px;\
text-align: right;\
padding-right: 5px;\
}\
\
/* horizontal lines */\
hr {\
\tmargin: 0;\
}\
\
/* page displayed footer area */\
#footer {\
\tfont-size: 9px;\
\tpadding-left: 10px;\
}\
\
\
body\
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }\
:lang(he) { direction: rtl; float: right; }\
--></style>\
</head><body id=ERR_CONNECT_FAIL>\
<div id=\"titles\">\
<h1>ERROR</h1>\
<h2>The requested URL could not be retrieved</h2>\
</div>\
<hr>\
\
<div id=\"content\">\
<p>The following error was encountered while trying to retrieve the URL: <a href=\"http://10.204.9.134:10080/settings\">http://10.204.9.134:10080/settings</a></p>\
\
<blockquote id=\"error\">\
<p><b>Connection to 10.204.9.134 failed.</b></p>\
</blockquote>\
\
<p id=\"sysmsg\">The system returned: <i>(110) Connection timed out</i></p>\
\
<p>The remote host or network may be down. Please try the request again.</p>\
\
<p>Your cache administrator is <a href=\"mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20hqyum01vl.fcbox.com%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(110)%20Connection%20timed%20out%0D%0ATimeStamp%3A%20Mon,%2025%20May%202020%2009%3A14%3A45%20GMT%0D%0A%0D%0AClientIP%3A%2010.204.9.90%0D%0AServerIP%3A%2010.204.9.134%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2Fsettings%20HTTP%2F1.1%0AHost%3A%2010.204.9.134%3A10080%0D%0AUser-Agent%3A%20Go-http-client%2F1.1%0D%0AAccept-Encoding%3A%20gzip%0D%0A%0D%0A%0D%0A\">webmaster</a>.</p>\
\
<br>\
</div>\
\
<hr>\
<div id=\"footer\">\
<p>Generated Mon, 25 May 2020 09:14:45 GMT by hqyum01vl.fcbox.com (squid/3.1.14)</p>\
<!-- ERR_CONNECT_FAIL -->\
</div>\
</body></html>\
\
github.com/pingcap/tidb-lightning/lightning/common.GetJSON\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/lightning/common/util.go:281\
github.com/pingcap/tidb-lightning/lightning/common.(*TLS).GetJSON\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/lightning/common/security.go:142\
github.com/pingcap/tidb-lightning/lightning/config.(*Config).Adjust\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/lightning/config/config.go:458\
github.com/pingcap/tidb-lightning/lightning.(*Lightning).RunOnce\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/lightning/lightning.go:139\
main.main\
\t/home/jenkins/agent/workspace/release_tidb_4.0/go/src/github.com/pingcap/tidb-lightning/cmd/tidb-lightning/main.go:72\
runtime.main\
\t/usr/local/go/src/runtime/proc.go:203\
runtime.goexit\
\t/usr/local/go/src/runtime/asm_amd64.s:1357\
cannot fetch settings from TiDB, please manually fill in `tidb.port` and `tidb.pd-addr`"]
是没有,所以如果启动了代理就会报错,没启动就不会。中间并没有域名。
那你现在的疑问,是 lightning 使用了 http_proxy 代理?还是其他什么问题?
看到了是代理问题,由于lightning访问了http://10.204.9.134:10080/settings 而里面有代理但是代理能不能回到10.204.9.134:10080这个是不通的,导致报错。而单纯使用telnet去访问10.204.9.134 10080 却是通的。