Giter Site home page Giter Site logo

profilecloner's Introduction

profilecloner

JBoss WildFly / JBoss EAP 6.1+ Profile (and more) Cloner - by Tom Fonteyne
Usage:
 java -cp $JBOSS_HOME/bin/client/jboss-cli-client.jar:profilecloner.jar
    org.jboss.tfonteyne.profilecloner.Main
    --controller=<host> --port=<number> --username=<user> --password=<password>
    --file=<name> --add-deployments=<true|false>
    /from=value destinationvalue [/from=value destinationvalue] ....

Options:
  --controller=<host> | -c <host>       : Defaults to the setting in jboss-cli.xml if you have one,
  --port=<port>                           or localhost and 9999 (wildfly:9990)
  --username=<user> | -u <user>         : When not set, $local authentication is attempted
  --password=<password> | -p <password>
  --file=<name> | -f <name>             : The resulting CLI commands will be written to the file
                                          If not set, they are output on the console
  --add-deployments=<true|false> | -ad  : By default cloning a server-group will skip the deployments
                                          If you first copy the content folder and clone the deployments,
                                          you can enable this

Examples for "/from=value destinationvalue":
  Domain mode:
    /socket-binding-group=full-ha-sockets full-ha-sockets-copy
    /profile=full-ha full-ha-copy
    /profile=full-ha/subsystem=web web

  Standalone server:
    /subsystem=security security
    profile
   The latter being a shortcut to clone all subsystems in individual batches

Each set will generate a batch/run-batch. It is recommended to clone the profile last
The names from/to can be equal if you want to execute the script on a different controller.

 Secure connections need:
    -Djavax.net.ssl.trustStore=/path/to/store.jks -Djavax.net.ssl.trustStorePassword=password

Note that EAP 6.0.x is **not** supported.
The cloner will break on the "module-option" entries inside "login-module" sections.
Workaround is to remove those manually before cloning.
The file "jboss-cli-client.jar" does also not exist in those versions,
instead take a look at jconsole.sh for the equivalent set of files you will need.
As EAP 6.0.x is very old now, you really should be upgrading anyhow.

profilecloner's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

profilecloner's Issues

Wildfly 9.0.1.Final jgroups stack does not like :add-protocol() but does like the standard :add()

GenericCloner.java:

            // JGroups protocols are set with "add-protocol" instead of the normal "add"
            if ((addressString.matches(".*/subsystem=\"jgroups\"/stack=.*/protocol=.*"))
                // but do not do this for child resources
                && (!addressString.matches(".*/subsystem=\"jgroups\"/stack=.*/protocol=.*/.*=.*"))
                ) {
                destinationAddress.pop();
                commands.add(0, buildAdd("add-protocol", attributes));
                return commands;
            }

When I comment out the above block I get a working script that does not complain that child 'type' does not exist:

[domain@localhost:9990 /] /profile="ha"/subsystem="jgroups"/stack="tcp":add-protocol()
{
    "outcome" => "failed",
    "failure-description" => {"domain-failure-description" => "WFLYCTL0158: Operation handler failed: java.util.NoSuchElementException: No child 'type' exists"},
    "rolled-back" => true
}

Not working on JBoss EAP 6.0.1 (Update)

Hi,

I really need to get this working on JBoss EAP 6.0.1.

When I run the following command (have taken out sensitive info..) there isn't any output, its blank and an error isn't generated either.

java -cp /usr/share/jboss-as/modules/org/jboss/as/cli/main/jboss-as-cli-7.1.3.Final-redhat-4.jar:profilecloner.jar org.jboss.tfonteyne.profilecloner.Main --controller=hostname --port=9999 --username=dave --password=**** "/socket-binding-group=full-ha-sockets full-ha-sockets-copy"

or:

java -cp /usr/share/jboss-as/modules/org/jboss/as/cli/main/jboss-as-cli-7.1.3.Final-redhat-4.jar:profilecloner.jar org.jboss.tfonteyne.profilecloner.Main --controller=hostname --port=9999 --username=dave --password=**** "/profile=full-ha full-ha-copy"

I need to be able to clone the Full and Full-HA profile on JBoss EAP 6.0.1.

java -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

Thanks.

java.lang.IllegalArgumentException: newValue is null

bash$ java -cp /home/remote/klape/work/product-distributions/bin/client/jboss-cli-client.jar:./target/profilecloner-2014-08-24.jar org.jboss.tfonteyne.profilecloner.Main profile
Aug 28, 2014 12:55:24 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.7.GA-redhat-1
Aug 28, 2014 12:55:24 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.7.GA-redhat-1
Aug 28, 2014 12:55:24 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.18.GA-redhat-1
java.lang.IllegalArgumentException: newValue is null
        at org.jboss.dmr.ModelNode.set(ModelNode.java:499)
        at org.jboss.dmr.ModelNode.set(ModelNode.java:687)
        at org.jboss.dmr.ModelNode.add(ModelNode.java:1145)
        at org.jboss.tfonteyne.profilecloner.GenericCloner.getSource(GenericCloner.java:84)
        at org.jboss.tfonteyne.profilecloner.GenericCloner.copy(GenericCloner.java:75)
        at org.jboss.tfonteyne.profilecloner.Main.<init>(Main.java:134)
        at org.jboss.tfonteyne.profilecloner.Main.main(Main.java:113)

Wildfly 10 - CLI is running in a non-modular environment and cannot load commands from management extensions

Attempting to execute with Wildfly 10.0.0.Final on a Windows 10 PC.
I created the attached batch file using the example .sh file
I receive an ominous warning (see title) followed by a java exception and stacktrace:

C:\s\ProfileCloner>cliCloner test.txt
$0 16Aug2016 Connect to WF10 CLI export utility

C:\s\ProfileCloner>SET CLASSPATH=.;c:\s\java32\lib\tools.jar;c:\s\jclasses\drivers\mysql.jar;C:\s\jclasses\jsoup\jsoup-1.6.3.jar;C:\s\wildfly-10.0.0.Final\bin\client\jboss-cli-client.jar;c:\s\ProfileCloner\profileCloner.jar

C:\s\ProfileCloner>java org.jboss.tfonteyne.profilecloner.Main --controller=GERRYDESKTOPPC --username=matteg --password=secret --file=test.txt --add-deployments=false /from=subsystem/mail mail
Aug 16, 2016 11:42:45 AM org.xnio.Xnio
INFO: XNIO version 3.3.4.Final
Aug 16, 2016 11:42:45 AM org.xnio.nio.NioXnio
INFO: XNIO NIO Implementation Version 3.3.4.Final
Aug 16, 2016 11:42:45 AM org.jboss.remoting3.EndpointImpl
INFO: JBoss Remoting version 4.0.18.Final
Aug 16, 2016 11:42:46 AM org.jboss.as.cli.impl.CommandContextImpl printLine
INFO: Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.
Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.
java.lang.ArrayIndexOutOfBoundsException: Invalid address pair: mail
at org.jboss.tfonteyne.profilecloner.Address.(Address.java:44)
at org.jboss.tfonteyne.profilecloner.AddressStack.(AddressStack.java:43)
at org.jboss.tfonteyne.profilecloner.GenericCloner.(GenericCloner.java:78)
at org.jboss.tfonteyne.profilecloner.Main.(Main.java:131)
at org.jboss.tfonteyne.profilecloner.Main.main(Main.java:112)

C:\s\ProfileCloner>echo off

Waiting for 0 seconds, press a key to continue ...
C:\s\ProfileCloner>
cliCloner.bat.txt

Not working on WildFly 10.0.0.RC5

I'm trying to create a clone of full-ha profile, but the batch fails without giving any real cause for the failure.
When I've tried running the lines one by one, there are several ones which fail (won't list all here) but at least some seem to be depending on order of adds, ex:
domain@localhost:9990 /] /profile="kims-test"/subsystem="jsr77":add()
{
"outcome" => "failed",
"failure-description" => {"domain-failure-description" => "WFLYCTL0369: Required capabilities are not available:
org.wildfly.management.jmx in context 'profile=kims-test'; Possible registration points for this capability:
/profile=*/subsystem=jmx"},
"rolled-back" => true
}
but if I add jmx first, then jsr77 can be added (but in the batch file jsr77 was before jmx)
Some additions failed because they had name="xxx" and it complained that name was not a valid attribute

Sorry for a really messy report...
Any chance you could test this with WF10?

Error exporting jgroup TCPPING

Exporting the following configuration:

                <stack name="tcpping">
                    <transport type="TCP" socket-binding="jgroups-tcp"/>
                    <protocol type="TCPPING">
                        <property name="port_range">
                            0
                        </property>
                        <property name="timeout">
                            2000
                        </property>

I expect:

/profile=full-ha/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=port_range:add(value=0)
/profile=full-ha/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=timeout:add(value=2000)

instead I get:

/profile=full-ha/subsystem=jgroups/stack=tcpping/protocol=TCPPING:add-protocol(value=0)
/profile=full-ha/subsystem=jgroups/stack=tcpping/protocol=TCPPING:add-protocol(value=2000)

outbound-socket-binding not exported

I'm exporting from JBoss EAP 6.4.18 - the server I'm looking at has two outbound-socket-binding nodes in <socket-binding-group name="standard-sockets", both for mail, but neither were exported. Is this expected? Or a bug?

JBOSS EAP 6.4.23 Problem with injection of name="default" for some clone results.

When cloning an ha profile, for these subsystems noted below, the resulting jbcli in error is:

/profile="ha-adrien"/subsystem="jca"/workmanager="default"/long-running-threads="default":add(core-threads="50",keepalive-time={"time" => "10","unit" => "SECONDS"},max-threads="50",name="default",queue-length="50")

/profile="ha-adrien"/subsystem="jca"/workmanager="default"/short-running-threads="default":add(core-threads="50",keepalive-time={"time" => "10","unit" => "SECONDS"},max-threads="50",name="default",queue-length="50")

/profile="ha-adrien"/subsystem="ejb3"/service="timer-service":add(default-data-store="default-file-store",thread-pool-name="default")

The jboss-cli.sh error for example:
'name' is not found among the supported properties: [thread-factory, queue-length, core-threads, max-threads, handoff-executor, allow-core-timeout, keepalive-time]

Removing name="default" will work with success.

Not sure if this is a problem with the profilecloner or our environment.

Attached the subsystem xml from domain.xml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.