big-data-europe / docker-hadoop

Apache Hadoop docker image
2.21k stars 1.3k forks source link

Configuration on remote server #79

Open luigi-asprino opened 4 years ago

luigi-asprino commented 4 years ago

Hi,

I have deployed the docker containers on a remote server. I'm able to list files stored on hdfs from a client application (e.g. ./hadoop fs -ls hdfs://:9000/) but when I try to read a file (e.g. ./hadoop fs -cat hdfs://:9000/a.txt) files I get a ConnectionRefused Exception. In the hadoop.env file I've only set

CORE_CONF_fs_defaultFS=hdfs://<remote_ip>:8020

I'm a newbie hadoop user but it seems to me that the datanode ip is not visible outside the network created by docker and I don't know how to fix it.

Anyone can help me?

Thanks

Luigi

Data-drone commented 4 years ago

Is the port open? if you have portainer installed can use that to view all the containers running on the host and check the ports

luigi-asprino commented 4 years ago

Yes it is. I opened the following TCP ports 8020, 8042, 8088, 8188, 9000, 9864-9867, 9879, 9870, 50070

This is a screenshot from portrainer the 9000 and the 9870 are opened.

Screenshot 2020-06-26 at 15 59 52

Data-drone commented 4 years ago

from the screenshot only 9000 and 9870 are open? For you docker-compose you need something like

ports:
      - 16000:16000
      - 16010:16010
      - 16020:16020

for each port

luigi-asprino commented 4 years ago

Hi @Data-drone I think this helps, thanks! I've mapped all the ports declared in the Dockerfile (may something that should be done the bde repo as well?) but I still get the same error when I try to read a file with

 ./hadoop fs -cat hdfs://<remote_ip>:9000/a/a.txt
``` $ ./hadoop fs -cat hdfs://90.147.188.89:9000/a/a.txt WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 2020-06-27 08:37:40,925 WARN impl.BlockReaderFactory: I/O error constructing remote block reader. java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:533) at org.apache.hadoop.hdfs.DFSClient.newConnectedPeer(DFSClient.java:2940) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.nextTcpPeer(BlockReaderFactory.java:822) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:747) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.build(BlockReaderFactory.java:380) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:644) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:575) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) 2020-06-27 08:37:40,929 WARN hdfs.DFSClient: Failed to connect to /90.147.188.89:9866 for file /a/a.txt for block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006, add to deadNodes and continue. java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:533) at org.apache.hadoop.hdfs.DFSClient.newConnectedPeer(DFSClient.java:2940) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.nextTcpPeer(BlockReaderFactory.java:822) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:747) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.build(BlockReaderFactory.java:380) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:644) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:575) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) 2020-06-27 08:37:40,930 WARN hdfs.DFSClient: No live nodes contain block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 after checking nodes = [DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]], ignoredNodes = null 2020-06-27 08:37:40,930 INFO hdfs.DFSClient: Could not obtain BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 from any node: No live nodes contain current block Block locations: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK] Dead nodes: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]. Will get new block locations from namenode and retry... 2020-06-27 08:37:40,930 WARN hdfs.DFSClient: DFS chooseDataNode: got # 1 IOException, will wait for 1703.7111780005573 msec. 2020-06-27 08:37:42,713 WARN impl.BlockReaderFactory: I/O error constructing remote block reader. java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:533) at org.apache.hadoop.hdfs.DFSClient.newConnectedPeer(DFSClient.java:2940) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.nextTcpPeer(BlockReaderFactory.java:822) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:747) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.build(BlockReaderFactory.java:380) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:644) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:575) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) 2020-06-27 08:37:42,714 WARN hdfs.DFSClient: Failed to connect to /90.147.188.89:9866 for file /a/a.txt for block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006, add to deadNodes and continue. java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:533) at org.apache.hadoop.hdfs.DFSClient.newConnectedPeer(DFSClient.java:2940) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.nextTcpPeer(BlockReaderFactory.java:822) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:747) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.build(BlockReaderFactory.java:380) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:644) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:575) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) 2020-06-27 08:37:42,714 WARN hdfs.DFSClient: No live nodes contain block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 after checking nodes = [DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]], ignoredNodes = null 2020-06-27 08:37:42,715 INFO hdfs.DFSClient: Could not obtain BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 from any node: No live nodes contain current block Block locations: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK] Dead nodes: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]. Will get new block locations from namenode and retry... 2020-06-27 08:37:42,715 WARN hdfs.DFSClient: DFS chooseDataNode: got # 2 IOException, will wait for 8037.649939750932 msec. 2020-06-27 08:37:50,829 WARN impl.BlockReaderFactory: I/O error constructing remote block reader. java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:533) at org.apache.hadoop.hdfs.DFSClient.newConnectedPeer(DFSClient.java:2940) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.nextTcpPeer(BlockReaderFactory.java:822) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:747) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.build(BlockReaderFactory.java:380) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:644) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:575) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) 2020-06-27 08:37:50,830 WARN hdfs.DFSClient: Failed to connect to /90.147.188.89:9866 for file /a/a.txt for block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006, add to deadNodes and continue. java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:533) at org.apache.hadoop.hdfs.DFSClient.newConnectedPeer(DFSClient.java:2940) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.nextTcpPeer(BlockReaderFactory.java:822) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:747) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.build(BlockReaderFactory.java:380) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:644) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:575) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) 2020-06-27 08:37:50,830 WARN hdfs.DFSClient: No live nodes contain block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 after checking nodes = [DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]], ignoredNodes = null 2020-06-27 08:37:50,831 INFO hdfs.DFSClient: Could not obtain BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 from any node: No live nodes contain current block Block locations: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK] Dead nodes: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]. Will get new block locations from namenode and retry... 2020-06-27 08:37:50,831 WARN hdfs.DFSClient: DFS chooseDataNode: got # 3 IOException, will wait for 10000.711345313724 msec. 2020-06-27 08:38:00,945 WARN impl.BlockReaderFactory: I/O error constructing remote block reader. java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:533) at org.apache.hadoop.hdfs.DFSClient.newConnectedPeer(DFSClient.java:2940) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.nextTcpPeer(BlockReaderFactory.java:822) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:747) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.build(BlockReaderFactory.java:380) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:644) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:575) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) 2020-06-27 08:38:00,946 WARN hdfs.DFSClient: Failed to connect to /90.147.188.89:9866 for file /a/a.txt for block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006, add to deadNodes and continue. java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:533) at org.apache.hadoop.hdfs.DFSClient.newConnectedPeer(DFSClient.java:2940) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.nextTcpPeer(BlockReaderFactory.java:822) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:747) at org.apache.hadoop.hdfs.client.impl.BlockReaderFactory.build(BlockReaderFactory.java:380) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:644) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:575) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) 2020-06-27 08:38:00,947 WARN hdfs.DFSClient: No live nodes contain block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 after checking nodes = [DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]], ignoredNodes = null 2020-06-27 08:38:00,947 WARN hdfs.DFSClient: Could not obtain block: BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 file=/a/a.txt No live nodes contain current block Block locations: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK] Dead nodes: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]. Throwing a BlockMissingException 2020-06-27 08:38:00,947 WARN hdfs.DFSClient: No live nodes contain block BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 after checking nodes = [DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]], ignoredNodes = null 2020-06-27 08:38:00,947 WARN hdfs.DFSClient: Could not obtain block: BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 file=/a/a.txt No live nodes contain current block Block locations: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK] Dead nodes: DatanodeInfoWithStorage[90.147.188.89:9866,DS-c85d358c-2cd6-4951-b122-cc8d4a5bc532,DISK]. Throwing a BlockMissingException 2020-06-27 08:38:00,947 WARN hdfs.DFSClient: DFS Read org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block: BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 file=/a/a.txt at org.apache.hadoop.hdfs.DFSInputStream.refetchLocations(DFSInputStream.java:879) at org.apache.hadoop.hdfs.DFSInputStream.chooseDataNode(DFSInputStream.java:862) at org.apache.hadoop.hdfs.DFSInputStream.chooseDataNode(DFSInputStream.java:841) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:567) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:757) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:829) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:94) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:68) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:129) at org.apache.hadoop.fs.shell.Display$Cat.printToStdout(Display.java:101) at org.apache.hadoop.fs.shell.Display$Cat.processPath(Display.java:96) at org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367) at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331) at org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304) at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286) at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270) at org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120) at org.apache.hadoop.fs.shell.Command.run(Command.java:177) at org.apache.hadoop.fs.FsShell.run(FsShell.java:327) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.hadoop.fs.FsShell.main(FsShell.java:390) cat: Could not obtain block: BP-43268830-172.19.0.2-1593067126792:blk_1073741830_1006 file=/a/a.txt ```
luigi-asprino commented 4 years ago

I'm not an expert but it seems to me that the address given to the datanode (i.e. d4d282b96803) is not reachable from the outside of the network created by docker. Anyone knows how to make datanode addresses with a given remote ip?

Data-drone commented 4 years ago

probably check this: https://community.cloudera.com/t5/Support-Questions/HDFS-port-8020-not-accessible-from-outside/td-p/201252 Also try to add an extra test node to your docker compose and see if that node can access it

Forest216 commented 2 years ago

Do you know how to solve it,please?I have the same problem.