英文:
Why does HDFS throw unexpected EOF error using golang?
问题
以下是翻译好的内容:
package main
import (
"fmt"
"github.com/colinmarc/hdfs"
)
func main() {
client, err := hdfs.New("192.168.0.38:50070")
fs, err := client.ReadDir("/")
fmt.Println(err)
fmt.Println(fs)
}
err is unexpected EOF
And I found that the error occurs in
func (c *NamenodeConnection) readResponse(method string, resp proto.Message) error {
...
_, err = io.ReadFull(c.conn, packet)
...
}
I'm using hadoop 2.7.3
错误是意外的EOF
我发现错误发生在
func (c *NamenodeConnection) readResponse(method string, resp proto.Message) error {
...
_, err = io.ReadFull(c.conn, packet)
...
}
我正在使用hadoop 2.7.3
英文:
package main
import (
"fmt"
"github.com/colinmarc/hdfs"
)
func main() {
client, err := hdfs.New("192.168.0.38:50070")
fs, err := client.ReadDir("/")
fmt.Println(err)
fmt.Println(fs)
}
err is unexpected EOF
And I found that the error occurs in
func (c *NamenodeConnection) readResponse(method string, resp proto.Message) error {
...
_, err = io.ReadFull(c.conn, packet)
...
}
I'm using hadoop 2.7.3
答案1
得分: 2
我找到了原因。我使用的是WEBHDFS端口(50070),而不是Hadoop IPC端口(9000)。
英文:
I've found the reason. I was using the WEBHDFS Port (50070) instead of the Hadoop IPC Port (9000).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论