Thanks to visit codestin.com
Credit goes to github.com

Skip to content

no available namenodes: SASL handshake: wrong Token ID. Expected 0504, was 607d #338

@mountainhua

Description

@mountainhua

I think it is similar with this issue:#274
here is my code

func newHDFSWithKerberosClient(volume models.Volume) (*HDFSClient, error) {
	addresses := strings.Split(volume.Storage.ServerAddresses, ",")
	credential := volume.Credential.HDFSKerberosCredential
	properties := volume.Storage.PropertiesMap
	kerberosClient, err := newKerberosClientWithKeyTab(
		properties[models.KerberosRealm], properties[models.KerberosKDC], credential)
	if err != nil {
		log.Logger.Error("new kerberos client failed, volume id[%s], err[%v]", volume.ID, err)
		return nil, err
	}

	dialFunc := (&net.Dialer{
		Timeout:   time.Duration(HDFSConnTimeOut) * time.Second,
		KeepAlive: 5 * time.Second,
		DualStack: true,
	}).DialContext

	principalName := strings.Split(volume.Storage.PropertiesMap[models.KerberosNameNodePrincipal], "@")[0]
	option := hdfs.ClientOptions{
		Addresses:                    addresses,
		NamenodeDialFunc:             dialFunc,
		DatanodeDialFunc:             dialFunc,
		KerberosClient:               kerberosClient,
		KerberosServicePrincipleName: principalName,
		DataTransferProtection:       volume.Storage.PropertiesMap[models.DataTransferProtection],
	}

	log.Logger.Info("new hdfs kerberos client volume id[%s], options[%+v]", volume.ID, option)
	client, err := hdfs.NewClient(option)
	if err != nil {
		log.Logger.Error("Create HDFS kerberos client failed, volume id[%s], credential[%+v], principalName[%s], err[%v]",
			volume.ID, credential, principalName, err)
		return nil, err
	}
	return &HDFSClient{Client: client}, nil
}

when it connected to hdfs with Kerberos,it returns no available namenodes: SASL handshake: wrong Token ID. Expected 0504, was 607d.
the error message is occured in this line
Actually, I have no idea what 607d stands for

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions