[ 
https://issues.apache.org/jira/browse/HDFS-14974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16970740#comment-16970740
 ] 

Íñigo Goiri edited comment on HDFS-14974 at 11/9/19 6:41 AM:
-------------------------------------------------------------

I happened to have Jupyter running in my machine in port 8888.
When running the tests, I got:
{code}
Caused by: java.net.BindException: Problem binding to [localhost:8888] 
java.net.BindException: Address already in use: bind; For more details see:  
http://wiki.apache.org/hadoop/BindException
{code}

A quick solution would be to do something like:
{code}
    // Start routers with only an RPC service
    Configuration routerConf = new RouterConfigBuilder()
        .metrics()
        .rpc()
        .build();

    routerConf.set("dfs.federation.router.rpc-address", "0.0.0.0:0");
    conf.addResource(routerConf);
    Router router = new Router();
    router.init(conf);
    router.start();
{code}

But maybe we want to set this a little more general.
The MiniRouterDFSCluster already does:
{cluster}
  public Configuration generateRouterConfiguration(String nsId, String nnId) {

    Configuration conf = new HdfsConfiguration(false);
    conf.addResource(generateNamenodeConfiguration(nsId));

    conf.setInt(DFS_ROUTER_HANDLER_COUNT_KEY, 10);
    conf.set(DFS_ROUTER_RPC_ADDRESS_KEY, "127.0.0.1:0");
    conf.set(DFS_ROUTER_RPC_BIND_HOST_KEY, "0.0.0.0");
...
{cluster}


was (Author: elgoiri):
I happened to have Jupyter running in my machine in port 8888.
When running the tests, I got:
{code}
Caused by: java.net.BindException: Problem binding to [localhost:8888] 
java.net.BindException: Address already in use: bind; For more details see:  
http://wiki.apache.org/hadoop/BindException
{code}

> RBF: TestRouterSecurityManager#testCreateCredentials should use :0 for port
> ---------------------------------------------------------------------------
>
>                 Key: HDFS-14974
>                 URL: https://issues.apache.org/jira/browse/HDFS-14974
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Íñigo Goiri
>            Priority: Major
>
> Currently, {{TestRouterSecurityManager#testCreateCredentials}} create a 
> Router with the default ports. However, these ports might be used. We should 
> set it to :0 for it to be assigned dynamically.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to