Home > other >  The problem of about kfsclient write data
The problem of about kfsclient write data

Time:10-05

The great god good
The younger brother in a recent study KFS
The code is as follows:
 
String strMetaHostName="localhost";
String strDir="/MNT/test";
String strFileName=strDir + "/1";
KfsClientPtr pKfsClient=getKfsClientFactory () - & gt; GetClient (strMetaHostName, 20000);
Int ierr=pKfsClient - & gt; The file.mkdirs (strDir c_str ());
If (0!=ierr)
{
Printf (" the file.mkdirs failed> Errno=% d \ n ", ierr);
}
The else
{
Printf (" the file.mkdirs success \ n ");
Int _fd=pKfsClient - & gt; Open (strFileName. C_str (), O_CREAT | O_RDWR);
If (_fd & lt; 0)
{
Printf (" create | open file [% s] failed \ n ", strFileName. C_str ());
}
The else
{
String strContent="test write";
Ssize_t ret=pKfsClient - & gt; Write (_fd, strContent c_str (), strContent. The length ());
If (ret & lt; 0)
{
Printf (" Unable to write \ n ");
}
The else
{
Printf (" Write success \ n ");
}
}
}

Background:
1. The existing two machines A and B are decorated in KFS
2. Metaserver KFS and chunkserver are on the same machine
3. The above code on A machine

Question:
1. When strMetaServer="localhost", create the directory and file for write operations are no problem
2. When strMetaServer=B: hostname (machine B IP), create a directory that's no problem, but returned the following error when call Write
 
The 01-10-2014 11:04:38. 003 INFO - (KfsClient. Cc: 2638) Unable to connect to any server for the size on fid: 271
The 01-10-2014 11:04:38. 004 INFO - (KfsClient. Cc: 2043) Unable to get the size for the chunk 259; Error=9; The need to retry

3. Check the machine B the metaserver chunkserver service discovery running

For the great god help to analysis what is the problem with
Thank you very much

CodePudding user response:

Well, no one, under the roof

CodePudding user response:

I think a problem is unlikely to code, and the greatly help analysis of what is wrong with the configuration of the
  • Related