Hello Andrey,

1.      I have check the setting of cache is Partitioned and run two nodes 
again. These program codes are respectively as follows:
One node(shell 
script)==============================================================================================
<bean id="ignite.cfg" 
class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="cacheConfiguration">
            <list>
            <bean class="org.apache.ignite.configuration.CacheConfiguration">
              <property name="name" value= "oneCache"/>
              <property name="cacheMode" value="PARTITIONED"/>
              <property name="indexedTypes">
                <list>
                    <value>java.lang.String</value>
                    <value>java.lang.String</value>
                </list>
              </property>
            </bean>
            </list>
        </property>
===============================================================================================================
The other node(maven 
java)==========================================================================================
cacheConf.setIndexedTypes(String.class, String.class);

cacheConf.setCacheMode(CacheMode.PARTITIONED);

IgniteCache cache = igniteVar.getOrCreateCache(cacheConf);
===============================================================================================================

2.      Yes, I can see the information of 2 servers after I close the other 
node in the following text.

I thinks that both of the One node and the other node are linked, but I can not 
put or get data into the oneCache.
===============================================================================================================
[26-01-2018 17:23:46][INFO 
][disco-event-worker-#28%null%][GridDiscoveryManager] Topology snapshot [ver=2, 
servers=2, clients=0, CPUs=4, heap=4.5GB]

[26-Jan-2018 17:23:46][WARN 
][disco-event-worker-#28%null%][GridDiscoveryManager] Node FAILED: 
TcpDiscoveryNode [id=abe48607-8b7a-4413-9711-c7a14ecbd1a5, 
addrs=[0:0:0:0:0:0:0:1%lo, 127.0.0.1, 127.0.0.1], 
sockAddrs=[ubuntu/127.0.0.1:47501, /0:0:0:0:0:0:0:1%lo:47501, 
/127.0.0.1:47501], discPort=47501, order=2, intOrder=2, 
lastExchangeTime=1516958573637, loc=false, ver=1.9.0#20170302-sha1:a8169d0a, 
isClient=false]
===============================================================================================================
In addition, the following ports are created on localhost, as:
One node(shell script)
java     12266     root   TCP *:40447 (LISTEN)
java     12266     root   TCP *:49187 (LISTEN)
java     12266     root   TCP *:46451 (LISTEN)
java     12266     root  TCP *:47100 (LISTEN)
java     12266     root  TCP *:11211 (LISTEN)
java     12266     root  TCP *:8080 (LISTEN)
java     12266     root  TCP *:47500 (LISTEN)
The other node(maven java)
java     12349     root  TCP *:47101 (LISTEN)
java     12349     root  TCP *:11212 (LISTEN)
java     12349     root  TCP *:8081 (LISTEN)
java     12349     root  TCP *:47501 (LISTEN)

However, I can not to print data from the oneCache in the console of the maven 
java project.


3.      I am not sure if 
url:http://127.0.0.1:8080/ignite?cmd=qryfldexe&pageSize=100&cacheName=oneCache&qry=select+*+from+String

meet your command “SELECT _val FROM ....” to show all data in oneCache via 
restful api or not.

Rick

From: Andrey Mashenkov [mailto:andrey.mashen...@gmail.com]
Sent: Friday, January 26, 2018 4:52 PM
To: user@ignite.apache.org
Subject: Re: One problem about Cluster Configuration(cfg)

Rick,

1. As you are able to put entry to cache, you should see cache.get() result in 
console.
Please, check cache is not Local, but Partitioned or Replicated.

2. Also check the topology version message. You should see 2 servers in it.

3. Try to select value explicitly via _val field. E.g. "SELECT _val FROM ...."

On Fri, Jan 26, 2018 at 6:30 AM, 
<linr...@itri.org.tw<mailto:linr...@itri.org.tw>> wrote:
Hi Andrey,

I was so pleased to hear from you.

Please allow me to explain in detail my problem.

In the following, there is my java code to put and get one KV data 
("keyString", "valueString")  into the cache  ”oneCache”.
===============================================================================================================
Ignite igniteVar = Ignition.getOrStart(cfg);

CacheConfiguration cacheConf = new CacheConfiguration();

cacheConf.setName("oneCache");

cacheConf.setIndexedTypes(String.class, String.class);

IgniteCache cache = igniteVar.getOrCreateCache(cacheConf);

cache.put("keyString", "valueString");

System.out.println(cache.get("keyString"));
===============================================================================================================
Although the compiler works well, the execution (put data and get data) does 
not run, as follows.


1.      Restful api: 
http://127.0.0.1:8080/ignite?cmd=qryfldexe&pageSize=100&cacheName=oneCache&qry=select+*+from+String



{"successStatus":0,"sessionToken":"","error":"","response":{"items":[],"last":true,"fieldsMetadata":[{"schemaName":"oneCache","typeName":"STRING","fieldName":"_KEY","fieldTypeName":"java.lang.String"},{"schemaName":"oneCache","typeName":"STRING","fieldName":"_VAL","fieldTypeName":"java.lang.String"}],"queryId":0}}


2.      The execution result of the other node(maven.project.java) is as the 
attachement(JPG) for detail.

From the above information, I thinks that the oneCache exists, but there is not 
"keyString", "valueString" data in oneCache.

Rick


From: Andrey Mashenkov 
[mailto:andrey.mashen...@gmail.com<mailto:andrey.mashen...@gmail.com>]
Sent: Thursday, January 25, 2018 5:54 PM
To: user@ignite.apache.org<mailto:user@ignite.apache.org>
Subject: Re: One problem about Cluster Configuration(cfg)

Rick,

Looks like ok.
You run 2 nodes, then you kill one and other node report that killed node was 
dropped from grid.

What the issue is?

On Thu, Jan 25, 2018 at 12:38 PM, 
<linr...@itri.org.tw<mailto:linr...@itri.org.tw>> wrote:
Hi Andrey,


1.      There are no other running nodes when I triggered the two nodes.



2.      If I firstly triggered the One node(shell script), and then triggered 
the other node(maven.project.java).

I  closed the other node(maven.project.java) and the One node was still 
running. The proram result of the One node show that:


[25-Jan-2018 17:32:25][WARN ][tcp-disco-msg-worker-#2%null%][TcpDiscoverySpi] 
Local node has detected failed nodes and started cluster-wide procedure. To 
speed up failure detection please see 'Failure Detection' section under javadoc 
for 'TcpDiscoverySpi'



[25-01-2018 17:32:25][INFO 
][disco-event-worker-#28%null%][GridDiscoveryManager] Added new node to 
topology: TcpDiscoveryNode [id=664c870e-6b93-4328-a95b-9e04d5b4f59c, 
addrs=[0:0:0:0:0:0:0:1%lo,  127.0.0.1], sockAddrs=[ubuntu/ 
127.0.0.1:47501<http://127.0.0.1:47501>, /0:0:0:0:0:0:0:1%lo:47501, 
/127.0.0.1:47501<http://127.0.0.1:47501>], discPort=47501, order=10, 
intOrder=6, lastExchangeTime=1516872738417, loc=false, 
ver=1.9.0#20170302-sha1:a8169d0a, isClient=false]



[25-01-2018 17:32:25][INFO 
][disco-event-worker-#28%null%][GridDiscoveryManager] *Topology snapshot 
[ver=10, servers=2, clients=0, CPUs=4, heap=4.5GB]*



[25-Jan-2018 17:32:25][WARN 
][disco-event-worker-#28%null%][GridDiscoveryManager] Node FAILED: 
TcpDiscoveryNode [id=664c870e-6b93-4328-a95b-9e04d5b4f59c, 
addrs=[0:0:0:0:0:0:0:1%lo, 127.0.0.1], 
sockAddrs=[ubuntu/127.0.0.1:47501<http://127.0.0.1:47501>, 
/0:0:0:0:0:0:0:1%lo:47501, /127.0.0.1:47501<http://127.0.0.1:47501>], 
discPort=47501, order=10, intOrder=6, lastExchangeTime=1516872738417, 
loc=false, ver=1.9.0#20170302-sha1:a8169d0a, isClient=false]



[25-01-2018 17:32:25][INFO 
][disco-event-worker-#28%null%][GridDiscoveryManager] Topology snapshot 
[ver=11, servers=1, clients=0, CPUs=4, heap=1.0GB]


Rick

From: Andrey Mashenkov 
[mailto:andrey.mashen...@gmail.com<mailto:andrey.mashen...@gmail.com>]
Sent: Thursday, January 25, 2018 5:10 PM
To: user@ignite.apache.org<mailto:user@ignite.apache.org>
Subject: Re: One problem about Cluster Configuration(cfg)

Hi Rick,

Do you have a luck to resolve this?
Or you still observe the issue when configuring ipFinder via API?

On Thu, Jan 25, 2018 at 11:29 AM, 
<linr...@itri.org.tw<mailto:linr...@itri.org.tw>> wrote:
Hi all,

By the way, I run two nodes on localhost, and the multicastGroup ip and port 
are default settings in the example-cache.xml, as:
===============================================================================================================
<bean 
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                  <property name ="multicastGroup" value="228.1.2.4"/>
                  <property name="addresses">
                      <list>
                        <!--In distributed environment, replace with actual 
host IP address. -->
                        <value>127.0.0.1:47500..47509</value>
                      </list>
                  </property>
                </bean>
===============================================================================================================

Rick

From: linr...@itri.org.tw<mailto:linr...@itri.org.tw> 
[mailto:linr...@itri.org.tw<mailto:linr...@itri.org.tw>]
Sent: Thursday, January 25, 2018 3:51 PM
To: user@ignite.apache.org<mailto:user@ignite.apache.org>
Subject: One problem about Cluster Configuration(cfg)

Hi all,

I have tried to construct a cluster with two nodes.

my run environment 
==============================================================================================
OS: Ubuntu 14.04.5 LTS
Java version: 1.7
Ignite version: 1.9.0
===============================================================================================================

One node with a “example-cache.xml” was triggered by the shell script as the 
following command:./bin/ignite.sh config/example-cache.xml
The execution results of the program is as:
shell script result 
================================================================================================
Local node [ID=D411C309-E56A-4773-ABD1-132ADE62C325, order=1, clientMode=false]
Local node addresses: [ubuntu/0:0:0:0:0:0:0:1%lo, /127.0.0.1<http://127.0.0.1>]
Local ports: TCP:8080 TCP:11211 TCP:47100 UDP:47400 TCP:47500

[25-01-2018 15:23:44][INFO ][main][GridDiscoveryManager] Topology snapshot 
[ver=1, servers=1, clients=0, CPUs=4, heap=1.0GB]
[25-01-2018 15:23:48][INFO ][Thread-23][G] Invoking shutdown hook...
[25-01-2018 15:23:48][INFO ][Thread-23][GridTcpRestProtocol] Command protocol 
successfully stopped: TCP binary
[25-01-2018 15:23:48][INFO ][Thread-23][GridJettyRestProtocol] Command protocol 
successfully stopped: Jetty REST
[25-01-2018 15:23:48][INFO ][Thread-23][GridCacheProcessor] Stopped cache: 
oneCache
===============================================================================================================

The other node was triggered by the maven project (java 1.7) as the following 
command: mvn compile exec:java -Dexec.mainClass=…
In addition, my java code is as:
Java code 
======================================================================================================
TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();

TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(ipFinder);

IgniteConfiguration cfg  = new IgniteConfiguration();

cfg.setClientMode(false);

cfg.setDiscoverySpi(spi);

Ignite igniteVar = Ignition.getOrStart(cfg);

CacheConfiguration cacheConf = new CacheConfiguration();
cacheConf.setName("oneCache");
cacheConf.setIndexedTypes(String.class, String.class);
IgniteCache cache = igniteCache.getOrCreateCache(cacheConf);
===============================================================================================================

The execution results of the java program is as:
Maven project(java) result 
=========================================================================================
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in 
[jar:file:/root/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in 
[jar:file:/root/.m2/repository/org/slf4j/slf4j-jdk14/1.7.25/slf4j-jdk14-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Program execution lock….
===============================================================================================================

And, If I closed One node(shell script), the Maven project program started 
running, as:
===============================================================================================================
[15:32:13] Performance suggestions for grid  (fix if possible)
[15:32:13] To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true
[15:32:13]   ^-- Enable G1 Garbage Collector (add '-XX:+UseG1GC' to JVM options)
[15:32:13]   ^-- Specify JVM heap max size (add '-Xmx<size>[g|G|m|M|k|K]' to 
JVM options)
[15:32:13]   ^-- Set max direct memory size if getting 'OOME: Direct buffer 
memory' (add '-XX:MaxDirectMemorySize=<size>[g|G|m|M|k|K]' to JVM options)
[15:32:13]   ^-- Disable processing of calls to System.gc() (add 
'-XX:+DisableExplicitGC' to JVM options)
[15:32:13] Refer to this page for more performance suggestions: 
https://apacheignite.readme.io/docs/jvm-and-system-tuning
[15:32:13]
[15:32:13] To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}
[15:32:13]
[15:32:13] Ignite node started OK (id=753b6c7e)
[15:32:13] Topology snapshot [ver=1, servers=1, clients=0, CPUs=4, heap=3.5GB]
===============================================================================================================

I have no idea to connect both nodes and share the same oneCache under the 
above situation.

If any further information is needed, I am glad to be informed and will provide 
to you as soon as possible.

I am looking forward to hearing from you.

Rick




--
本信件可能包含工研院機密資訊,非指定之收件者,請勿使用或揭露本信件內容,並請銷毀此信件。 This email may contain 
confidential information. Please do not use or disclose it in any way and 
delete it if you are not the intended recipient.


--
本信件可能包含工研院機密資訊,非指定之收件者,請勿使用或揭露本信件內容,並請銷毀此信件。 This email may contain 
confidential information. Please do not use or disclose it in any way and 
delete it if you are not the intended recipient.



--
Best regards,
Andrey V. Mashenkov


--
本信件可能包含工研院機密資訊,非指定之收件者,請勿使用或揭露本信件內容,並請銷毀此信件。 This email may contain 
confidential information. Please do not use or disclose it in any way and 
delete it if you are not the intended recipient.



--
Best regards,
Andrey V. Mashenkov


--
本信件可能包含工研院機密資訊,非指定之收件者,請勿使用或揭露本信件內容,並請銷毀此信件。 This email may contain 
confidential information. Please do not use or disclose it in any way and 
delete it if you are not the intended recipient.



--
Best regards,
Andrey V. Mashenkov


--
本信件可能包含工研院機密資訊,非指定之收件者,請勿使用或揭露本信件內容,並請銷毀此信件。 This email may contain 
confidential information. Please do not use or disclose it in any way and 
delete it if you are not the intended recipient.

Reply via email to