Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error:broken pipe #286

Open
a67793581 opened this issue Feb 15, 2022 · 1 comment
Open

error:broken pipe #286

a67793581 opened this issue Feb 15, 2022 · 1 comment

Comments

@a67793581
Copy link

a67793581 commented Feb 15, 2022

This error occurred during operation:open /home/web/1.log: no available namenodes: write tcp local IP:48934->10.217.116.84:9000: write: broken pipe.
hdfs version 3.x
github.com/colinmarc/hdfs v1.1.3

func GetHDFSClientInstance() (result *hdfs.Client, err error) {
	var (
		ok bool
		v  interface{}
	)
	v, ok = instanceSM.Load(id)
	if !ok {
		result, err = GetHDFSClient()
		if err != nil {
			return
		}
		instanceSM.Store(id, result)
	} else {
		result = v.(*hdfs.Client)
	}
	return
}

func GetHDFSClient() (*hdfs.Client, error) {
	return hdfs.New("10.217.116.84:9000")
}
//Run at any time according to the requestor
func do(path string) error {
        hdfsClient,err:=GetHDFSClientInstance()
	if err != nil {
		return err
	}
	file, err := hdfsClient.Open(path)
	if file != nil {
		defer func() {
			_ = file.Close()
		}()
	}
	if err != nil {
		return err
	}
}
@Yichkhun
Copy link

Yichkhun commented Aug 5, 2022

I also met this problem. How did you deal with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants