3 Replies Latest reply on Sep 3, 2008 2:31 PM by soon5

    Clusterwide File Transfer

    soon5

      Hy there,

      I have a JBoss 4.2.1 Cluster running with two nodes, but more in plan. I use Farm deployment for my war / ear files, which works fine so far. Some of the Web Apps need some datafiles, which are stored in the /data Folder.

      I have to add or replace these files, thats why i didn't put them into the War file, because then i had to do a redeployment every time i replace a file.

      My Question is, is there a Chance, that i can use the ClusterFileTransfer system, to automaticaly replicate files in the /data Folder to the cluster, like it is done in farm deployment?

      That whould be great, because then i wouldn't have to replace the Files on all nodes by myself.

      Thanks so far,

      Greetings Soon5

        • 1. Re: Clusterwide File Transfer
          soon5

          I forgot to mention, programmatic ways using the JBoss API or hinds in that direction are welcome as well. I don't expect an out of the box solution.

          Greetings Soon5

          • 2. Re: Clusterwide File Transfer
            justkeys

            I also would like to do that: reuse that jboss code to distribute my config files to all nodes in the cluster.

            What i currently do is this: i just put them in the farm folder, and ignore the deployment-errors about them :)

            then i make a softlink deploy/data.war to the farm folder; this way, my remote java client application can also download these config files (but of course also my ear file huh)

            I read the file in my server code like this:

            properties.load(new FileInputStream(new File(System.getProperty("jboss.server.home.dir") + "/deploy/data.war/config.properties")));

            • 3. Re: Clusterwide File Transfer
              soon5

              Hy,

              I have another workaround. I have a replicated TreeCache in my Cluster. I read the Files on one node, and put them as byte[] into the cache, with an aditional String what the Filename is.

              The Array is instantlly replicated to the other nodes. There I take the File from the Cache and write it to the Disk again.

              I have a little more Code, which checks the timestamp of all Files in the Cluster, so a new one is replicated instanttly, and some other to clean the cache after Transfer, because I don't want to keep the byte[] in the cache for the whole time.

              But whats the benefit in using the TreeCache? I don't have to care about the network.

              Greetings Soon5