Brooklyn Starting Blueprint: VMs created but Brooklyn can't SSH in - java

I have just started using Brooklyn and I am trying to get the example from the deploying blueprints page working fully through my AWS account.
The Maven build completed successfully and I can successfully launch the Brooklyn Web UI from ~/apache-brooklyn-0.7.0-M2-incubating/usage/dist/target/brooklyn-dist using the steps on the running Brooklyn page.
When I launch the blueprint, I can see all the VMs launching in my AWS Console UI. I can also see the key pairs and security groups created. But the blueprint eventually fails because (I believe) Brooklyn cannot ssh into the VMs, see the first log output below. I assume Brooklyn attempts to login to the VMs using the created key pairs somehow?
Based on the info in the locations page, I created a ~/.brooklyn/brooklyn.properties file and added the following configuration:
brooklyn.location.jclouds.aws-ec2.identity = MyAwsAccessKeyID
brooklyn.location.jclouds.aws-ec2.credential = MyAwsSecretAccessKey
brooklyn.location.jclouds.aws-ec2.privateKeyFile = /home/username/key4brooklyn.pem
I created the key4brooklyn.pemfile from the AWS Console UI and restarted Brooklyn however the blueprint still does not work, it creates the VMs but cannot access the VMs, see log output below.
2015-03-02 23:31:27,295 INFO Starting MySqlNodeImpl{id=lzJhHxwD}, obtaining a new location instance in JcloudsLocation[aws-ec2:MyAwsAccessKeyID/aws-ec2] with ports [22, 3306]
2015-03-02 23:31:27,369 INFO Starting NginxControllerImpl{id=QYRLgQPh}, obtaining a new location instance in JcloudsLocation[aws-ec2:MyAwsAccessKeyID/aws-ec2] with ports [22, 8000]
2015-03-02 23:31:27,612 INFO Resize DynamicWebAppClusterImpl{id=iJNs2ltC} from 0 to 1
2015-03-02 23:31:28,830 INFO Starting JBoss7ServerImpl{id=MWMGwHXx}, obtaining a new location instance in JcloudsLocation[aws-ec2:MyAwsAccessKeyID/aws-ec2] with ports [22, 9443, 10999, 8443, 8080, 9990]
2015-03-02 23:31:37,870 INFO Creating VM aws-ec2#MySqlNodeImpl{id=lzJhHxwD} in JcloudsLocation[aws-ec2:MyAwsAccessKeyID/aws-ec2]
2015-03-02 23:31:38,508 INFO Creating VM aws-ec2#JBoss7ServerImpl{id=MWMGwHXx} in JcloudsLocation[aws-ec2:MyAwsAccessKeyID/aws-ec2]
2015-03-02 23:31:38,983 INFO Creating VM aws-ec2#NginxControllerImpl{id=QYRLgQPh} in JcloudsLocation[aws-ec2:MyAwsAccessKeyID/aws-ec2]
2015-03-02 23:34:55,349 INFO Not able to load publicKeyData from inferred files, based on privateKeyFile: tried [/home/username/key4brooklyn.pem.pub] for aws-ec2#MySqlNodeImpl {id=lzJhHxwD}
2015-03-02 23:34:55,353 INFO Not able to load publicKeyData from inferred files, based on privateKeyFile: tried [/home/username/key4brooklyn.pem.pub] for aws-ec2#JBoss7ServerImpl {id=MWMGwHXx}
2015-03-02 23:34:55,351 INFO Not able to load publicKeyData from inferred files, based on privateKeyFile: tried [/home/username/key4brooklyn.pem.pub] for aws-ec2#NginxControllerImpl {id=QYRLgQPh}
I am using Ubuntu 14.04 with Oracle Java 7 installed, it is a VirtualBox VM.

Looking at the log output, the problem is here:
2015-03-02 23:34:55,349 INFO Not able to load publicKeyData from inferred files, based on privateKeyFile: tried [/home/username/key4brooklyn.pem.pub] for aws-ec2#MySqlNodeImpl {id=lzJhHxwD}
The privateKeyFile configuration key needs to specify an id_rsa or id_dsa style key pair in two files. The corresponding *.pub file will be auto-detected if publicKeyFile is not configured. There are better instructions for creating an ssh key available. It is confusing and better error reporting around keys (including fail-fast) is in the latest SNAPSHOT builds and will be included in the M3 milestone release. Also note that the id_rsa file must have one and only one private key and must not contain the public key. Tedious that there are so many formats!
The ~/.ssh/id_rsa or other configured key-pair is just used by Brooklyn for setting up ssh access to the VM after it is provisioned. By default, jclouds (which we use under the covers) will create a temporary AWS key-pair to get initial access to the VM. We'll then automatically add the ~/.ssh/id_rsa.pub to the VM's ~/.ssh/authorized_keys (creating a user on the VM that by default has the same name as the user who is running the Brooklyn process).
The key4brooklyn.pem file you downloaded is the private part of the AWS key-pair. By default, this will not be used because jclouds will create its own key-pair.
If you wanted jclouds to use your pre-existing key pair then you'd have to use the following configuration setting:
brooklyn.location.jclouds.aws-ec2.keyPair = MyKeypairName
Where MyKeypairName is the name of the key-pair according to AWS.

Related

Jboss eap 7 configuration

I have downloaded the Jboss eap 7 to my system. I want to deploy my war/ ear file or configure my application source in the server. Can anyone help me with the steps for doing the same
You can deploy your ear/war using the JBoss Command Line Interface (CLI):
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=127.0.0.1:9999 --user=manager --password=password deploy path/to/your.ear
This can be scripted if required. Undeploying is the same:
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=127.0.0.1:9999 --user=manager --password=password undeploy your.ear
To stop, start, restart & status check the JBOSS service, use following commands :
• systemctl stop jboss-eap-rhel.service
• systemctl start jboss-eap-rhel.service
• systemctl restart jboss-eap-rhel.service
• systemctl status jboss-eap-rhel.service
To add management console user, use following steps :
• cd /data/jboss-eap-7.0/binlssh ./add-user.sh
• what type of user do you wish to add?
a. Management User (mgmt-users.properties)
b. Application User (application-users.properties)
• Enter a and go to next (i.e. (a) :a)
• Enter the details of the new user to add.
Using realm ‘ManagementRealm’ as discovered from the existing property files.
Username : xyz
• If user already exists, it shows update option otherwise it shows create option.
• User ‘xyz’ already exists and is enabled, would you like to…
a. Update the existing user password and roles
b. Disable the existing user
c. Type a new username
• Enter a and go to next (i.e. (a) :a)
• Password : ******
• What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none) [ManagementRealm] :
• Just leave as blank and enter
• Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a remoting connection for server to server EJB calls.
yes/no? yes
To add environment variable, use following steps :
• Go to following path i.e. ../jboss-eap-7.0/bin/ and open the file standalone.conf and add Denvironment=prod
Example:
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true -Denvironment=prod"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
If JBOSS 8080 and 9990 ports are unable to access from remote, use following steps :
Go to following path i.e. ../jboss-eap-7.0/standalone/configuration and open the file standalone.xml and point actual IP address as mentioned in example.
Example :
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:172.16.26.68}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:172.16.26.68}"/>
</interface>
</interfaces>
After configured above mentioned steps, hit this URL http://localhost:9990/console/App.html and then it shows authentication prompt window for management username and password. After that tap start link in Deployments tab. Choose the war file and deploy.

No able to connect to spark cluster via sparklyr package when my custom package method is invoked via OpenCpu

I have created an R package that makes use of the sparklyr capabilities within a dummy hello function. My package does a very simple thing as connection to a spark cluster, print the spark version and disconnect. The package is successfully clean and build and is successfully executed from R and Rstudio.
# Connect to Spark cluster
spark_conn <- sparklyr::spark_connect(master = "spark://elenipc.home:7077", spark_home = '/home/eleni/spark-2.2.0-bin-hadoop2.7/')
# Print the version of Spark
sv<- sparklyr::spark_version(spark_conn)
print(sv)
# Disconnect from Spark
sparklyr::spark_disconnect(spark_conn)
It is very important for me to be able to execute the hello function from OpenCpu rest api. (I have used opencpu api for executing many other custom created packages.)
When invoking opencpu api like:
curl http://localhost/ocpu/user/rstudio/library/myFirstBigDataPackage/R/hello/print -X POST
i get the following response:
Failed while connecting to sparklyr to port (8880) for sessionid (89615): Gateway in port (8880) did not respond.
Path: /home/eleni/spark-2.2.0-bin-hadoop2.7/bin/spark-submit
Parameters: --class, sparklyr.Shell, '/home/rstudio/R/x86_64-pc-linux-gnu-library/3.4/sparklyr/java/sparklyr-2.2-2.11.jar', 8880, 89615
Log: /tmp/ocpu-temp/file26b165c92166_spark.log
---- Output Log ----
Error occurred during initialization of VM
Could not allocate metaspace: 1073741824 bytes
---- Error Log ----
In call:
force(code)
Of course allocate more memory to both java & spark executor does not resolve the issue. permission issues are also discarded as i already configured the etc/apparmor.d/opencpu.d/custom file so as to permit opencpu to have rwx privileges on spark. It seems to be a connectivity issue that i do not know how to face. During method invocation via opencpu api spark logs do not even print something.
For you info my environment configuration is as follows:
java version "1.8.0_65"
R version 3.4.1
RStudio version 1.0.153
spark-2.2.0-bin-hadoop2.7
opencpu 1.5 (compatible with my Ubuntu 14.04.3 LTS)
Thank you very much for you support and time!!!

JMX doesn't work in Tomcat

I have the following configuration:
I deployed a sample SymmetricDS engine in Tomcat 8. It should have a JMX MBean I have to connect to. The configuration file symmetric-server.properties has the following values:
# Enable Java Management Extensions (JMX) web console.
#
jmx.http.enable=true
# Port number for Java Management Extensions (JMX) web console.
#
jmx.http.port=31417
# Enable Java Management Extensions (JMX) remote agent.
#
jmx.agent.enable=true
# Port number for the Java Management Extensions (JMX) remote agent.
#
jmx.agent.port=31418
And yet when I go to localhost:31417 I get 404 and when I launch the JConsole this application is nowhere to be found.
But when I start SymmetricDS with command bin\sym and it launches using the embedded jetty server, I can see the HTTP Adaptor on localhost:31417 and can connect via JConsole to the local application, yet I cannot connect remotely to localhost:31418:
I downloaded the sources of the SymmetricDS and in the file
symmetric-server\src\main\java\org\jumpmind\symmetric\SymmetricWebServer.java
there are only three configuguration taken from file symmetric-server.properties -- from default values it seems that they are jmx.http.port for HTTP Adaptor, https.port for HTTPS and http.port for SymmetricWebServer.
I also tried changing jmx.agent.enable to false and manually overriding java command line options in sym_service.conf by adding:
wrapper.java.additional.13=-Dcom.sun.management.jmxremote
wrapper.java.additional.14=-Dcom.sun.management.jmxremote.port=31417
wrapper.java.additional.15=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.16=-Dcom.sun.management.jmxremote.ssl=false
to no avail.
Could you please help me, what am I doing wrong?
Update
After greping sources I found SystemConstants.java, in which again there were ports for http, https and jmx.http, but none for remote agent

GWT - Netbeans cant start dev mode

I have netbeans with the GWT4NB plugin installed. My code can compile and works with production mode. But when I try to launch the dev mode aka hosted mode in Netbeans the GWTShell window doesn't load. Getting this to work would be greatly useful for debugging. Here is my error in the console:
GWT4NB https://gwt4nb.dev.java.net
GWT installation directory: C:\Users\Guillaume\.netbeans\6.9\framework\gwt-2.1.0
init:
debug-connect-gwt-shell-hosted-15:
Unknown argument: -style
Google Web Toolkit 2.1.0
GWTShell [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logdir directory] [-logLevel level] [-gen dir] [-bindAddress host-name-or-address] [-codeServerPort port-number | "auto"] [-out dir] [url]
where
-noserver Prevents the embedded web server from running
-port Specifies the TCP port for the embedded web server (defaults to 8888)
-whitelist Allows the user to browse URLs that match the specified regexes (comma or space separated)
-blacklist Prevents the user browsing URLs that match the specified regexes (comma or space separated)
-logdir Logs to a file in the given directory, as well as graphically
-logLevel The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
-gen Debugging: causes normally-transient generated types to be saved in the specified directory
-bindAddress Specifies the bind address for the code server and web server (defaults to 127.0.0.1)
-codeServerPort Specifies the TCP port for the code server (defaults to 9997)
-out The directory to write output files into (defaults to current)
and
url Automatically launches the specified URL
Java Result: -1
init:
The problem seems to be the unknown -style argument. I tried changing this argument in build-gwt.xml under the gwt 2.0 section, no changes. Why isnt gwt 2.1 not in the xml config file also?
I have the same issue and fix it manually on every restart by setting the gwt version as '2.0' even if I am actually on 2.2.
The problem is caused by the fact that the GWT4NB does not undertand the version of GWT you are using and so tries with GWT 1.5, that is pretty different from modern ones.

Unable to deploy in Netbeans 6.7.1 and Glassfish v2.1.1

I am trying to deploy a simple WebService in Netbeans 6.7.1 and Glassfish v2.1.1 and am getting the following error. I am using GlassfishESBv2.2 and windows 7 machine. I have tried googling and implemented things as shown in
http://forums.netbeans.org/topic10055-0-asc-0.html . Still unable to deploy. Though the message says that application server is not started, from the Server tab , I am able to see a message which indicates Glassfish has started.Also , doing a netstat after trying to deploy returns this, which means that Glassfish is running.
C:>netstat -an | findstr "4848"
TCP 0.0.0.0:4848 0.0.0.0:0 LISTENING
I have been trying real hard to get this resolved. Any help is highly appreciated.
Error Message :
The Sun Java System Application Server could not start.
More information about the cause is in the Server log file.
Possible reasons include:
- IDE timeout: refresh the server node to see if it's running now.
- Port conflicts. (use netstat -a to detect possible port numbers already used by the operating system.)
- Incorrect server configuration (domain.xml to be corrected manually)
- Corrupted Deployed Applications preventing the server to start.(This can be seen in the server.log file. In this case, domain.xml needs to be modified).
- Invalid installation location.
C:\Users\xyz\Documents\NetBeansProjects\HWebService\nbproject\build-impl.xml:564: Deployment error:
The Sun Java System Application Server could not start.
More information about the cause is in the Server log file.
Possible reasons include:
- IDE timeout: refresh the server node to see if it's running now.
- Port conflicts. (use netstat -a to detect possible port numbers already used by the operating system.)
- Incorrect server configuration (domain.xml to be corrected manually)
- Corrupted Deployed Applications preventing the server to start.(This can be seen in the server.log file. In this case, domain.xml needs to be modified).
- Invalid installation location.
See the server log for details.
BUILD FAILED (total time: 29 seconds)
I've described the solution please visit here...
http://forums.netbeans.org/post-65058.html

Categories