Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
933609f0
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
933609f0
编写于
2月 24, 2015
作者:
S
Stephan Ewen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-1608] [taskmanager] Hostname/address for TaskManager can be specified in the configuration
上级
086209ca
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
11 deletion
+24
-11
flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
.../java/org/apache/flink/configuration/ConfigConstants.java
+5
-0
flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
...la/org/apache/flink/runtime/taskmanager/TaskManager.scala
+19
-11
未找到文件。
flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
浏览文件 @
933609f0
...
...
@@ -80,6 +80,11 @@ public final class ConfigConstants {
*/
public
static
final
String
LIBRARY_CACHE_MANAGER_CLEANUP_INTERVAL
=
"library-cache-manager.cleanup.interval"
;
/**
* The config parameter defining the task manager's hostname.
*/
public
static
final
String
TASK_MANAGER_HOSTNAME_KEY
=
"taskmanager.hostname"
;
/**
* The config parameter defining the task manager's IPC port from the configuration.
*/
...
...
flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
浏览文件 @
933609f0
...
...
@@ -834,19 +834,27 @@ object TaskManager {
val
(
jobManagerHostname
,
jobManagerPort
)
=
getAndCheckJobManagerAddress
(
configuration
)
// try to find out the hostname of the interface from which the TaskManager
// can connect to the JobManager. This involves a reverse name lookup
LOG
.
info
(
"Trying to determine network interface and address/hostname to use"
)
val
jobManagerAddress
=
new
InetSocketAddress
(
jobManagerHostname
,
jobManagerPort
)
val
taskManagerHostname
=
try
{
NetUtils
.
resolveAddress
(
jobManagerAddress
).
getHostName
()
}
catch
{
case
t
:
Throwable
=>
throw
new
Exception
(
"TaskManager cannot find a network interface "
+
"that can communicate with the JobManager ("
+
jobManagerAddress
+
")"
,
t
)
var
taskManagerHostname
=
configuration
.
getString
(
ConfigConstants
.
TASK_MANAGER_HOSTNAME_KEY
,
null
)
if
(
taskManagerHostname
!=
null
)
{
LOG
.
info
(
"Using configured hostname/address for TaskManager: "
+
taskManagerHostname
)
}
else
{
// try to find out the hostname of the interface from which the TaskManager
// can connect to the JobManager. This involves a reverse name lookup
LOG
.
info
(
"Trying to select the network interface and address/hostname to use"
)
val
jobManagerAddress
=
new
InetSocketAddress
(
jobManagerHostname
,
jobManagerPort
)
taskManagerHostname
=
try
{
NetUtils
.
resolveAddress
(
jobManagerAddress
).
getHostName
()
}
catch
{
case
t
:
Throwable
=>
throw
new
Exception
(
"TaskManager cannot find a network interface "
+
"that can communicate with the JobManager ("
+
jobManagerAddress
+
")"
,
t
)
}
LOG
.
info
(
"TaskManager will use hostname/address '{}' for communication."
,
taskManagerHostname
)
LOG
.
info
(
"TaskManager will use hostname/address '{}' for communication."
,
taskManagerHostname
)
}
// if no task manager port has been configured, use 0 (system will pick any free port)
val
actorSystemPort
=
configuration
.
getInteger
(
ConfigConstants
.
TASK_MANAGER_IPC_PORT_KEY
,
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录