Re: ClientContext.init() produces error

73 views
Skip to first unread message

Gene Pang

unread,
Mar 11, 2016, 11:52:03 AM3/11/16
to Nelson Chu, Alluxio Users
Hi Nelson,

I don't think you should be setting configuration values via the ClientContext. Unfortunately, it is probably not documented enough to explicit mention that. Therefore, you can set configuration properties via 1) changing "alluxio-default.properties" and recompiling, 2) using "alluxio-site.properties", or 3) adding '-Dconfig_name=config_value options to the java command line when launching your program.

Also, what port are you using for the master port? Also, you might be hitting this issue: https://groups.google.com/d/topic/alluxio-users/CZc1mhWmAZc/discussion The fix has been merged and will be in the next release.

Thanks,
Gene

On Wed, Mar 9, 2016 at 8:20 PM, Nelson Chu <nelson...@gmail.com> wrote:

Hi,

I tried to write a user-level client program performing basic write/read operation with Alluxio.
After I run the following codes in my client program in order to setup Alluxio configuration:
   
    ClientContext.getConf().set(Constants.MASTER_HOSTNAME,*master host name*);
    ClientContext.getConf().set(Constants.MASTER_RPC_PORT, Integer.toString(*master port*);

But this only works when the client program and the master are on the same machine. The client will not be able to find master when they are on different machines.

After debugging, I found that ClientContext.getMasterAddress() doesn't return the real master address, but the default address(which is set when the ClientContext class was firstly loaded into JVM, before I can set the master address by the above code)
According to the java doc of ClientContext, it is said that when I change the master hostname/port configuration, I should call init() again.

Therefore, I changed the code to the following:

    ClientContext.getConf().set(Constants.MASTER_HOSTNAME,*master host name*);
    ClientContext.getConf().set(Constants.MASTER_RPC_PORT, Integer.toString(*master port*);
    ClientContext.init();

However, this time I got the following error when making "createFile" rpc from FileSystemMasterClient to FileSystemMasterClientServiceHandler:

Exception in thread "main" java.io.IOException: Frame size (1213486160) larger than max length (16384000)!
at alluxio.AbstractClient.checkVersion(AbstractClient.java:109)
at alluxio.AbstractClient.connect(AbstractClient.java:172)
at alluxio.AbstractClient.retryRPC(AbstractClient.java:320)
at alluxio.client.file.FileSystemMasterClient.createFile(FileSystemMasterClient.java:111)
at alluxio.client.file.BaseFileSystem.createFile(BaseFileSystem.java:91)
at alluxioOperation.AlluxioBasicIO.getFileOutStream(AlluxioBasicIO.java:69)
at alluxioOperation.AlluxioBasicIO.writeFile(AlluxioBasicIO.java:53)
at alluxioOperation.AlluxioBasicIO.main(AlluxioBasicIO.java:132)

My questions are:
1) What should I do after I set the master hostname/port so that ClientContext.getMasterAddress() returns the correct value?
2) Is it correct to manually call ClientContext.init() after I set the master hostname/port? If so, why did I get this error message?

I am running Alluxio on two virtualBox machines


Many thanks,
Nelson

--
You received this message because you are subscribed to the Google Groups "Alluxio Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alluxio-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gene Pang

unread,
Mar 11, 2016, 8:56:05 PM3/11/16
to Nelson Chu, Alluxio Users
Thanks Nelson, for the confirmation. I'm glad you got things working!

-Gene

On Fri, Mar 11, 2016 at 9:30 AM, Nelson Chu <nelson...@gmail.com> wrote:
Hi Gene,

Thanks for the excellent answer!!
I found that I used the wrong port(19999) for data transmission.
Every thing looks great now.

Best,
Nelson
Reply all
Reply to author
Forward
0 new messages