- Community Home
- >
- Software
- >
- HPE Ezmeral Software platform
- >
- maprDB query works at command line but not in dock...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:43 PM - last edited on 08-29-2023 11:37 AM by support_s
08-22-2023 04:43 PM - last edited on 08-29-2023 11:37 AM by support_s
I have this simple query
package mapr_java_client;
import com.mapr.db.MapRDB;
import com.mapr.db.Table;
import com.mapr.db.Admin;
import org.ojai.Document;
import org.ojai.DocumentStream;
public class App {
public static void main(String[] args) {
Table dMediaTable = MapRDB.getTable("/user/tim/transactions");
DocumentStream stream = dMediaTable.find();
for (final Document userDocument : stream) {
System.out.println(userDocument.asJsonString());
}
}
}
and when I execute it at the mac command line
java -jar mapr_java_client.jar
I get an annoying warning but then it outputs the table content with no problem. Although I don't want to go down the rabbit hole, for completeness the annoying warning is this. But please scroll down for what happens when I do the same inside a docker container
WARNING: Exception thrown during refresh
com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key 0.
at com.google.common.cache.LocalCache$Segment.getAndRecordStats(LocalCache.java:2350)
at com.google.common.cache.LocalCache$Segment$1.run(LocalCache.java:2331)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
at com.google.common.util.concurrent.ExecutionList.add(ExecutionList.java:101)
at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:170)
at com.google.common.cache.LocalCache$Segment.loadAsync(LocalCache.java:2326)
at com.google.common.cache.LocalCache$Segment.refresh(LocalCache.java:2389)
at com.google.common.cache.LocalCache.refresh(LocalCache.java:4090)
at com.google.common.cache.LocalCache$LocalLoadingCache.refresh(LocalCache.java:4843)
at com.mapr.fs.MapRClientImpl.refreshZkConnectString(MapRClientImpl.java:1445)
at com.mapr.fs.MapRClientImpl.<init>(MapRClientImpl.java:149)
at com.mapr.fs.MapRFileSystem.lookupClient(MapRFileSystem.java:690)
at com.mapr.fs.MapRFileSystem.lookupClient(MapRFileSystem.java:749)
at com.mapr.fs.MapRFileSystem.openTable(MapRFileSystem.java:3720)
at com.mapr.fs.MapRHTable.init(MapRHTable.java:111)
at com.mapr.db.impl.MapRDBTableImpl.<init>(MapRDBTableImpl.java:85)
at com.mapr.db.impl.MapRDBImpl.getTable(MapRDBImpl.java:129)
at com.mapr.db.impl.MapRDBImpl.getTable(MapRDBImpl.java:115)
at com.mapr.db.MapRDB.getTable(MapRDB.java:98)
at mapr_java_client.App.main(App.java:29)
But when I put the jar in a centos7 docker container, I get this
2023-08-22 23:37:15,8008 ERROR Client fc/client.cc:11409 Thread: 19 rpc err Connection timed out(110) 28.21 to 34.218.238.108:5692, fid 2049.16.2, upd 0
Now you should know that in both environments, mac and inside docker container the file, /opt/mapr/conf/mapr-clusters.conf contains this
mycluster secure=false ec2-34-218-238-108.us-west-2.compute.amazonaws.com:7222 ec2-34-219-45-86.us-west-2.compute.amazonaws.com:7222 ec2-34-216-115-96.us-west-2.compute.amazonaws.com:7222
And the real puzzler is this. When I run a net cat command on two ports, they say the ports are open
[root@44845a00cdac /]# nc -zv 34.218.238.108 7222
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 34.218.238.108:7222.
Ncat: 0 bytes sent, 0 bytes received in 0.06 seconds.
[root@44845a00cdac /]# nc -zv 34.218.238.108 5692
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 34.218.238.108:5692.
Ncat: 0 bytes sent, 0 bytes received in 0.07 seconds.
So there you have it. Docker container can see the endpoint and open port, yet it simple query doesn't work. My cluster is setup right since the java -jar command works on my mac command line.
Any ideas would be welcome
Solved! Go to Solution.
- Tags:
- Ezmeral
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 07:37 PM
08-28-2023 07:37 PM
Re: maprDB query works at command line but not in docker container
I guess, you installed mapr-client on your Mac, right?
if possible, please share your docker file, we can reproduce that issue.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 01:37 PM - last edited on 08-29-2023 11:19 PM by Sunitha_Mod
08-29-2023 01:37 PM - last edited on 08-29-2023 11:19 PM by Sunitha_Mod
Re: maprDB query works at command line but not in docker container
Yong-Liu,
No, I did not install mapr-client on the mac. All cluster interactions take place through the maprDB call. Here's my Dockerfile. I build the previous java with gradle hence the build/libs path. Thank you for your help.
FROM alizarion/centos7java8
USER root
COPY build/libs/mapr_java_client.jar /mapr_java_client.jar
USER root
RUN mkdir -p /opt/mapr/conf
RUN chmod 0775 /opt/mapr/conf
COPY conf/mapr-clusters.conf /opt/mapr/conf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:26 PM
08-29-2023 11:26 PM
SolutionI'm trying to mimic your issue, @Tim11 , I used below dependencies in the pom.xml, and then, build with mvn clean package, to build a fat jar(with dependencies), I didn't saw the error you mentioned in the threads, I 'll put that to docker latter today, hope I can reproduce your issue:
my steps as below:
1. build fat jar,
2. I uses windows laptop, so, I generated a service ticket for mapruser, then, add an env var :MAPR_TICKETFILE_LOCATION,
3. run like below:
c:\mike_maprdb\maprdb\target>java -cp maprdb-example-jar-with-dependencies.jar org.example.App
env:===C:\mike_maprdb\maprdb\mapr_service_ticket
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.mapr.fs.ShimLoader (file:/C:/mike_maprdb/maprdb/target/maprdb-example-jar-with-dependencies.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.mapr.fs.ShimLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
log4j:WARN No appenders could be found for logger (org.eclipse.jetty.util.log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
{"_id":"mike000222333","fans":0,"name":"mike","support":"gold","type":"user","yelping_since":"2016-09-22"}
<dependency>
<groupId>com.mapr.db</groupId>
<artifactId>maprdb</artifactId>
<version>7.1.0.6-mapr</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
