share MQ Libraries installed on server1 to share on server2 liberty server.xml - websphere

We have configured WLP and MQ to use JMS messaging. On a server1 where the Liberty Servers and MQ installed we referred the MQ libraries as below and it's working fine. However, we are not sure from server2 when we make connection to MQ we are using client transport type with port number. How to refer the below MQ libraries on the server2 server.xml? Any help or guidance on this? Thanks
server.xml from server1
server2 JMS connection
<properties.wmqJms
transportType="CLIENT"
hostName="Host1"
port="9001"
channel="SYSTEM.DEF.SVRCONN"
queueManager="QM1"/>

You'll need to copy the file wmq.jmsra.rar to the disk of server2 and then set the path to that file in server.xml using a variable:
<variable name="wmqJmsClient.rar.location" value="/path/to/wmq/rar/wmq.jmsra.rar"/>
See: https://www.ibm.com/docs/en/was-liberty/nd?topic=dmal-deploying-jms-applications-liberty-use-mq-messaging-provider

Related

Deploying gradle spring application on a 1and1 cloud server

I have an apache/2.4.18 ubuntu server and I want to host my spring application on it. I generated a JAR file and can run it on the server. It starts an embedded tomcat server on port 8090.
However when i navigate to 'my-site-ip:8090' the connection times out.
I have zero experience deploying web applications so any help would be appreciated.
I've created a TCP rule for port 8090 and still no joy.
The solution was adding a proxy to the Myapp.conf file as below:
ProxyRequests off
ProxyPreserveHost On
ProxyPass / http://localhost:8090/
ProxyPassReverse / http://localhost:8090/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
It´s very hard to explain all the steps in one answer but you can follow these steps to get into the full configuration by your own. I did the same on my 1&1 cloud server.
First of all you need root access to your server.
Normally, on your server the port 80 and 443 should already be open. Else you can define that in the 1&1 Admin Portal. If your Server already has the apache configuration you should be able to see the apache site if you go to your server address. You can find details and the full setup if you dont have an apache installed for this step here:
How To Install the Apache Web Server on Ubuntu
The second step would be to configure a virtual host on your apache webserver.
This is cool because you can define multiple domains and there applications on your server. So http://yourServer.com(port 80 or 443 from extern) goes to yourApp1. (port 8090 from intern).
In this step you will tell apache if your enter your url to go to your app with port 8090
How To Set Up Apache Virtual Hosts on Ubuntu
The last step would be to install your spring-boot app as a service on your machine. The docs of Spring describes it very well.
Installation as an init.d Service
If you install the app as a service you are able to start and stop the app with the service command.
service myapp start
And dont forget to add the plugin for maven or gradle to your pom.xml. This is necessary to run the app as a service.
If you follow these Steps you should be able to reach you app without specify a port and be ready to go with your app in production if necessary.
The best approach for this would be to use the apache proxy. This should get it done.
https://blog.marcnuri.com/running-apache-tomcat-and-apache-httpd-on-port-80-simultaneously/

Can not assign EC2 instance Public IP to Mosquitto MQTT broker

I have installed Mosquitto MQTT in one of the EC2 instance(ubuntu) and broker running fine with localhost.
I can able to publish/subscribe in the local machine and as well another EC2 instance (both EC2 in same subnet 172.31.X.X)
Now, i want to connect the broker from a PC outside for (publish/subscribe). So, i tried to configure the broker IP to EC2 instance public IP.
VirtualBox:cat /etc/mosquitto/mosquitto.conf
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
listener 1883 50.24.39.66
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
VirtualBox:
VirtualBox:sudo mosquitto -c /etc/mosquitto/mosquitto.conf
1495801790: mosquitto version 1.4.8 (build date Fri, 19 Feb 2016 12:03:16 +0100) starting
1495801790: Config loaded from /etc/mosquitto/mosquitto.conf.
1495801790: Opening ipv4 listen socket on port 1883.
1495801790: Error: Cannot assign requested address
carun#carun-VirtualBox:~$
But, while restarting the broker am getting the above error "Cannot assign requested address"
Done so far,
Allowed (inboud/outbound) all access to EC2.
Disabled firewall in EC2
-Allowed all security level access to EC2 security group.
But no luck,
So question,
How to assign a EC2 Public IP to the broker?
How can I access MQTT broker out side of world?
Thanks in advance for your help!
Remove the ip address (50.24.39.66) from the end of listener line (or just remove the whole line) to allow mosquitto to bind to all available IP addresses

Monitor a remote IBM Websphere with VisualVM and JMX

I am trying to monitor a remote IBM WAS with VisualVM but I can't connect.
To enable JMX on the IBM Websphere open the WebSphere administrative console and:
navigate to: Server -> Server Types -> WebSphere application servers ->[SERVER_NAME]
Expand Java and Process Management and click Process definition
Click Java Virtual Machine
In the Generic JVM arguments field append the following properties:
-Djavax.management.builder.initial= -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1099 -Djava.rmi.server.hostname=XX.228.75.XX
Restart the server
When the server starts, open VisualVM and add a new Remote Connection:
In the connection field, put the server host and the port previously configured, for instance 1099.

Why does JMX connection to Amazon EC2 fail?

I set up JMX on one of services running on Amazon EC2 instance but it doesn't work properly. I'm using VisualVM to connect and after short period of pending it fails with timeout. Looks like it fails because of missing response data or lags. I checked that JMX port is enabled in security group and also tried with different port with no JMX enabled and also with port not enabled in security group settings and both fails immediately, so it looks different. My EC2 instance and desktop both have Ubuntu 12.04 and JDK 7 installed.
It turns out ports don't make sense since connection is SSL secured. I have a private key and have no idea how to use it with JConsole or VisualVM.
JMX needs an RMI registry operating on an open port. By default the RMI registry port is chosen randomly at the startup time and it doesn't play well with firewalls.
Since JDK7u4 you can use
-Dcom.sun.management.jmxremote.rmi.port=<port>
to set the RMI port to be used. Then you can enable that port in the security group.
Note the .rmi. part of the above setting because this usually gets confused with the com.sun.management.jmxremote.port setting. You should not!
This works for me. Set the JMX options on your server:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=<some port>
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=localhost
Open up an SSH tunnel:
ssh -i /path/to/key -D <some port> username#public_dns_address
Start VisualVM:
jvisualvm -J-Dnetbeans.system_socks_proxy=localhost:<some port> -J-Djava.net.useSystemProxies=true
Add a remote connection to the server. Add a JMX connection using the port you've specified for JMX.
To be clear, in all three cases above, should be the same port.

hadoop api configuration on the client machine

ultra-noob. I have a server machine with cdh3u1 pseudo-distrib, and a client machine with a java application using the cdh3u1 API.
How do I configure the client to talk to the server? I've been googling for hours and couldn't find where is the "client configuration" file. The "hdfs-default", "core-default" and "mapred-default" and their "-site" counterparts all look like server (namenode and datanode) config to me.
Is it just "multipurpose client server" config and I should cherry-pick the attributes in these files that are appropriate to the client? which are they? probably missing something big here...
Thanks, Ido
make sure that the client machine can access the hadoop server machine ip. If you use a virtualbox for the hadoop server (cdh3 vm), then add a "host-only" network interface (see details here: host-only networking with virtualbox. I'm assuming that your static ip for the hadoop server is 192.168.56.101 and that you're able to ping it from your client.
configure a hostname for your hadoop server machine in both the server and client machine. If you want to name your hadoop server "local-elephant", add the following line to /etc/hosts in both machines: 192.168.56.101 local-elephant.
in the server machine goto /etc/hadoop/conf change the values of the following properties from "localhost" to "local-elephant": in core-site.xml the value of fs.default.name and in mapred-site.xml the value of mapred.job.tracker.
in the client machine, create core-site.xml and mapred-site.xml in the classpath of your java application. In those files put only the fs.default.name and mapred.job.tracker properties.

Resources