-
1. Re: How to migrate an application at runtime
alesj Oct 27, 2015 9:45 AM (in response to giacomo.genovese)We have this tool:
* capedwarf-blue/BulkLoader.java at master · capedwarf/capedwarf-blue · GitHub
-
2. Re: How to migrate an application at runtime
giacomo.genovese Oct 27, 2015 12:06 PM (in response to alesj)Thanks.
Some instruction about how to use it?
-
4. Re: How to migrate an application at runtime
giacomo.genovese Nov 3, 2015 1:13 PM (in response to alesj)I'm sorry Ales but I need more information about how to use/run this tool. I'm new in this Jboss environment.
Only code there.
I found some documentation about how migration is done in a AppScale environment but nothing for Capedwarf.
Thanks.
-
5. Re: How to migrate an application at runtime
alesj Nov 4, 2015 4:21 AM (in response to giacomo.genovese)Try to see how the test does it -- it should not be too hard.
-
6. Re: How to migrate an application at runtime
giacomo.genovese Jan 12, 2016 6:35 AM (in response to alesj)Hi Ales,
When I try to run BulkLoader, I type :
$cd capedwarf-blue-master/tools/src/main/java/org/jboss/capedwarf/tools/
//to decompile
$javac BulkLoader.java
and I get error:
BulkLoader.java:32: error: package org.apache.http does not exist
import org.apache.http.HttpResponse;
^
BulkLoader.java:33: error: package org.apache.http.client does not exist
import org.apache.http.client.HttpClient;
^
BulkLoader.java:34: error: package org.apache.http.client.methods does not exist
import org.apache.http.client.methods.HttpGet;
^
BulkLoader.java:35: error: package org.apache.http.client.methods does not exist
import org.apache.http.client.methods.HttpPut;
^
BulkLoader.java:36: error: package org.apache.http.entity does not exist
import org.apache.http.entity.ContentType;
^
BulkLoader.java:37: error: package org.apache.http.entity does not exist
import org.apache.http.entity.FileEntity;
^
BulkLoader.java:38: error: package org.apache.http.impl.client does not exist
import org.apache.http.impl.client.CloseableHttpClient;
^
BulkLoader.java:39: error: package org.apache.http.impl.client does not exist
import org.apache.http.impl.client.HttpClients;
^
BulkLoader.java:72: error: cannot find symbol
private static void doUpload(Arguments args) {
^
symbol: class Arguments
location: class BulkLoader
BulkLoader.java:103: error: cannot find symbol
private static void sendPacket(UploadPacket packet, HttpClient client, String url) throws IOException {
^
symbol: class UploadPacket
location: class BulkLoader
BulkLoader.java:103: error: cannot find symbol
private static void sendPacket(UploadPacket packet, HttpClient client, String url) throws IOException {
^
symbol: class HttpClient
location: class BulkLoader
BulkLoader.java:112: error: cannot find symbol
private static void doDump(Arguments args) {
^
symbol: class Arguments
location: class BulkLoader
BulkLoader.java:165: error: cannot find symbol
private static Integer getPacketSize(Arguments args) {
^
symbol: class Arguments
location: class BulkLoader
BulkLoader.java:169: error: cannot find symbol
private static String getFilename(Arguments args) {
^
symbol: class Arguments
location: class BulkLoader
BulkLoader.java:173: error: cannot find symbol
private static String getUrl(Arguments args) {
^
symbol: class Arguments
location: class BulkLoader
BulkLoader.java:51: error: cannot find symbol
Arguments arguments = new Arguments(args);
^
symbol: class Arguments
location: class BulkLoader
BulkLoader.java:51: error: cannot find symbol
Arguments arguments = new Arguments(args);
^
symbol: class Arguments
location: class BulkLoader
BulkLoader.java:78: error: cannot find symbol
try (DumpFileFacade dumpFileFacade = new DumpFileFacade(new File(filename))) {
^
symbol: class DumpFileFacade
location: class BulkLoader
BulkLoader.java:78: error: cannot find symbol
try (DumpFileFacade dumpFileFacade = new DumpFileFacade(new File(filename))) {
^
symbol: class DumpFileFacade
location: class BulkLoader
BulkLoader.java:81: error: cannot find symbol
try (CloseableHttpClient client = HttpClients.createDefault()) {
^
symbol: class CloseableHttpClient
location: class BulkLoader
BulkLoader.java:81: error: cannot find symbol
try (CloseableHttpClient client = HttpClients.createDefault()) {
^
symbol: variable HttpClients
location: class BulkLoader
BulkLoader.java:83: error: cannot find symbol
UploadPacket packet = new UploadPacket(partFile);
^
symbol: class UploadPacket
location: class BulkLoader
BulkLoader.java:83: error: cannot find symbol
UploadPacket packet = new UploadPacket(partFile);
^
symbol: class UploadPacket
location: class BulkLoader
BulkLoader.java:92: error: cannot find symbol
packet = new UploadPacket(partFile);
^
symbol: class UploadPacket
location: class BulkLoader
BulkLoader.java:104: error: cannot find symbol
HttpPut put = new HttpPut(url);
^
symbol: class HttpPut
location: class BulkLoader
BulkLoader.java:104: error: cannot find symbol
HttpPut put = new HttpPut(url);
^
symbol: class HttpPut
location: class BulkLoader
BulkLoader.java:106: error: cannot find symbol
put.setEntity(new FileEntity(packet.getFile(), ContentType.create("application/capedwarf-data")));
^
symbol: class FileEntity
location: class BulkLoader
BulkLoader.java:106: error: cannot find symbol
put.setEntity(new FileEntity(packet.getFile(), ContentType.create("application/capedwarf-data")));
^
symbol: variable ContentType
location: class BulkLoader
BulkLoader.java:107: error: cannot find symbol
HttpResponse response = client.execute(put);
^
symbol: class HttpResponse
location: class BulkLoader
BulkLoader.java:125: error: cannot find symbol
try (DumpFileFacade dumpFileFacade = new DumpFileFacade(file)) {
^
symbol: class DumpFileFacade
location: class BulkLoader
BulkLoader.java:125: error: cannot find symbol
try (DumpFileFacade dumpFileFacade = new DumpFileFacade(file)) {
^
symbol: class DumpFileFacade
location: class BulkLoader
BulkLoader.java:126: error: cannot find symbol
try (CloseableHttpClient client = HttpClients.createDefault()) {
^
symbol: class CloseableHttpClient
location: class BulkLoader
BulkLoader.java:126: error: cannot find symbol
try (CloseableHttpClient client = HttpClients.createDefault()) {
I tried the same for BulkLoaderTest, but I suppose that "javac" and "java" are not the right commands to run the scripts.
Could you suggest the right way to do it?
Thanks a lot.
-
7. Re: How to migrate an application at runtime
alesj Jan 13, 2016 4:48 AM (in response to giacomo.genovese)Try running the test from an IDE.
Then simply try to mock / adjust what the test does.
And probably running things from IDE is the easiest, as it will already setup the classpath for you (if you get your Maven config right).
-
8. Re: How to migrate an application at runtime
giacomo.genovese Mar 1, 2017 7:02 AM (in response to giacomo.genovese)Hi all,
I'm investigating on Wildfly HA Clustering in order to migrate the entire PaaS Capedwarf Instance.
I created two Standalone Instances, into two different machines, deploying the same applications and enabling Clustering.
Once the cluster is on, I executed some read and write operations on the Instance 1. Then, I decided to switch off such instance to force migration of services to Instance 2 and everything seems to work well. The Instance 2 maintains an updated status of all the operations done.
I would ask you:
- May I consider this operation like a migration of a CapeDwarf Instance?
- Do I missing something that make loss data in the Instance 2?
Thanks a lot for your support.
Regards,
Giacomo.
-
9. Re: How to migrate an application at runtime
alesj Mar 3, 2017 3:47 AM (in response to giacomo.genovese)Good question.
Imo, it should work.
Let me check with Infinispan devs.
-
10. Re: How to migrate an application at runtime
sannegrinovero Mar 6, 2017 5:27 AM (in response to giacomo.genovese)Hi Giacomo, I'm not a CapeDwarf expert, but have good experience with Infinispan.
Yes the approach you suggest sounds good: Infinispan will immediately start transferring a full replica of all state to the other node as soon as they are connected. To avoid data loss, just make sure that the state transfer operation is complete before you shut down or disconnect the first node. I usually check on state transfer by keeping an eye on its logs, but with more recent versions there are several better options; for example the Health API can be accessed in various ways: http://blog.infinispan.org/2017/03/checking-infinispan-cluster-health-and.html That would allow you to make a 100% replica of the Infinispan stored data.
There's another problem you might have though: Infinispan is a key/value store, so if the Key(s) used by CapeDwarf include any application-specific metadata, one would need to make sure these didn't change, or the entries will still exist in practice, but the application layer wouldn't be able to retrieve them from the distributed map. I am not sure if this could be a problem in practice, one would need to have a look into the CD code, or test the process.
HTH
-
11. Re: How to migrate an application at runtime
giacomo.genovese Mar 6, 2017 9:28 AM (in response to sannegrinovero)Thanks a lot for your comment.
About this issue:
There's another problem you might have though: Infinispan is a key/value store, so if the Key(s) used by CapeDwarf include any application-specific metadata, one would need to make sure these didn't change, or the entries will still exist in practice, but the application layer wouldn't be able to retrieve them from the distributed map. I am not sure if this could be a problem in practice, one would need to have a look into the CD code, or test the process.
alesj, please, do you have any answer?
Thanks a lot for your contribution!
-
12. Re: How to migrate an application at runtime
alesj Mar 6, 2017 9:32 AM (in response to giacomo.genovese)Like I said, imo, it should work.
Try it, and provide feedback in the case of any failures.
-
13. Re: How to migrate an application at runtime
giacomo.genovese May 9, 2017 7:24 AM (in response to sannegrinovero)Hi Sanne,
I'm trying to find the best way to check the Cache status before shutdown the old instance.
The goal is to speed up the procedure and free the space in the VM of the old machine as soon as possible.
I found this link too.
My problem is that I don't have CacheContainerHealth object in my Mbeans view in CapeDwarf.
It should be an integrated module of Infinispan, isn't it? Can I add it?
Thanks a lot.