Friday, August 19, 2016

maven simple setup

Installation

1. download maven

2. Ensure JAVA_HOME environment variable is set and points to your JDK installation

3. extract maven and put to /opt/
tar xzvf apache-maven-3.3.9-bin.tar.gz

4. make soflink
ln -s apache-maven-3.3.9 maven

5. edit user .bash_profile and add this into it
export M2_HOME=/opt/maven 
export PATH=${M2_HOME}/bin:${PATH}
6. exit and login again to take effect and test maven
mvn --version

7. create a new project and let it generate a new pom.xml
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false


reference:
https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
http://www.tutorialspoint.com/maven/maven_environment_setup.htm

Thursday, August 18, 2016

jboss fuse simple setup

Environment
OS: RedHat Enterprise 7
Java: Oracle jdk1.8.0_91
Fuse: jboss-fuse-6.2.1.redhat-117

Firewall disable
systemctl stop firewalld
systemctl disable firewalld

SELinux disable
vi /etc/selinux/config
change to disabled

Java Setup

1. download Java from oracle website

2. edit /etc/hosts file and add your IP and hostname into it
172.20.1.100   fuse1
if you are setup cluster fuse, then add fuse2 and fuse3 as well to all node hosts file

3. unzip java and put to /opt
then make softlink
ln –s jdk1.8.0_91 jdk1.8.0
this is to easy to upgrade java in future. just extract new update java and change the softlink pointing
then add following line to .bash_profile
export JAVA_HOME=/opt/jdk1.8.0

4. exit and login again to make java take effect and test by using this command
java -version



Fuse Setup

NODE 1
1. unzip jboss fuse to /opt and make a softlink as well
ln –s jboss-fuse-full-6.2.1-redhat-117 fuse

2. edit <fuse-install-dir>/etc/system.properties to rename karaf instance as fuse1 (from root):
# Name of this Karaf instance
karaf.name=fuse1

3. start fuse
cd /opt/fuse
bin/fuse

4. From the Fuse CLI, create an ESB admin user using the following command, substitute <user name> and <user password> with actual values:
esb:create-admin-user --new-user <user name> --new-user-password <user password>

5. Shutdown Fuse and restart as a background service using:
bin/start

6. Connect to Fuse using admin user created above:
bin/client –u <user name> -p <user password>
7. Next create Fabric:
fabric:create --zookeeper-password <zookeeper-password> --zookeeper-data-dir zkdata
--resolver localhostname --wait-for-provisioning

8. As a practice, we do not deploy application services to root containers, so we can remove the jboss-fuse-full profile from the container:
container-remove-profile fuse1 jboss-fuse-full



NODE 2 & NODE 3
1. After unzip, JBoss Fuse will be installed in /opt/jboss-fuse-full-6.2.1-redhat-117. For convenience, create a symbolic link:
cd /opt/dportal
ln –s jboss-fuse-full-6.2.1-redhat-117 fuse

2. edit <fuse-install-dir>/etc/system.properties to rename karaf instance as fuse2 and fuse3 (from root), respectively:
Node 2 (172.20.1.101):
# Name of this Karaf instance
karaf.name=fuse2

Node 3 (171.20.1.102):
# Name of this Karaf instance
karaf.name=fuse3

3. Start Fuse:
$ cd /home/fmsapps/fuse
$ bin/fuse

4. Join fabric
fabric:join --zookeeper-password <zookeeper-password> --resolver localhostname
fuse1:2181

5. Shutdown Fuse and restart as a background service using:
$ bin/start
6. Connect to Fuse using admin user created above:
$ bin/client –u <user name> -p <user password>
At this point, 3 JBoss Fuse Fabric containers were created and started.
On 172.20.1.100 (fuse1), log in to Fuse Fabric CLI and issue the following command to create an
ensemble.
JBossFuse:fuseadmin@utdrvfuse1> ensemble-add utdrvfuse2 utdrvfuse3

Once the command is completed, the fabric container list should be similar to:
JBossFuse:fabric@fuse1> container-list
   [id] [version][connected] [profiles] [provision status]
   utdrvfuse1* 1.0 yes fabric, fabric-ensemble-0001-1 success
   utdrvfuse2 1.0 yes fabric, fabric-ensemble-0001-2 success
   utdrvfuse3 1.0 yes fabric, fabric-ensemble-0001-3 success

The Fuse setup is complete. Fuse management console can be accessed from http://172.20.1.100:8181



Monday, August 15, 2016

LinkChecker

Install Linckecker

# wget --no-check-certificate https://pypi.python.org/packages/source/L/LinkChecker/LinkChecker-9.3.tar.gz


Got 2 way to install

  • Manual installation where you download the source and initiate install yourself
  • Auto install Linckecker by using pip


Manual Installation
For Centos/RHEL 6 -> enable Software Collection to install Python 2.7
For Centos/RHEL 7 -> just use yum install python

Enable Software collection
RHEL -> # subscription-manager repos --enable rhel-server-rhscl-6-rpms
Centos -> # yum install centos-release-scl

Then install python27
# yum install python27
You need to enable it in order to use
# scl enable python27 bash

Install the remain package needed to run
# yum install gcc python-requests qt-devel

On How to install, you can read the doc at LinkChecker-9.3/doc/install.txt

# make -C doc/html
# python setup.py sdist --manifest-only
# python setup.py build

# python setup.py install

You can test run by using this command
# linkchecker www.google.com -Fcsv//tmp/google.csv


Troubleshooting
If you encounter this error “This program requires Python requests 2.2.0 or later” when you test run.
Downgrade the request version as Linkcheck 9.3 having bug with request ver 10
Downgrade using pip

# yum install python27-python-pip
# pip install requests==2.9.2



Auto Installation

# yum install gcc qt-devel

Enable software collection if you using Centos/RHEL 6 and install python27 & python27-python-pip
# yum install python27-python-pip python27

Then install Linkchecker using pip
# scl enable python27 bash
# pip install LinkChecker