Wednesday, October 14, 2015

Nexus: Maven pulls everything but the main jar of drools and jboss through POM dependency

I encountered an error in the eclipse in which maven was not able to pull jar files as specified in the pom file related to the drools.6.3.0.Final. The library files are pulled from a local Nexus repository in which both the jboss public proxy has been setup and added in the mirrors of the local maven settings.xml file.

The problem turned out to be that the pom file in the folder '/root/.m2/repository/org/jboss/dashboard-builder/dashboard-builder-bom/6.3.0.Final/" is named as " dashboard-builder-bom-6.3.0.Final.pom.lastUpdated" instead of "
dashboard-builder-bom-6.3.0.Final.pom". 

After renamed the pom file back and do a maven force update on the project in eclipse the error was gone.

Tuesday, October 13, 2015

Redis: Running redis server in docker container and access it from Windows host

Start the boot2docker on Windows host, run the following commands to create a container instance:

> docker run -i -t -p 6379:6379 --name=redis ubuntu bash

Note that the "-p 6379:6379" expose the port 6379 (which is the port on which redis server run by default) of the docker container as the port of the docker vm, so that it can be accessed from the Windows host. In the "redis" container, run the following command to install the necessary tools for building redis:

> sudo apt-get update
> sudo apt-get upgrade
> sudo apt-get install build-essential
> sudo apt-get install tk8.5 tcl8.5
> sudo apt-get install wget

In the "redis" container, run the following command to download and build the redis

> cd /opt
> wget http://download.redis.io/redis-stable.tar.gz
> tar xvzf redis-stable.tar.gz
> cd redis-stable
> make distclean
> make test

In the "redis" container, run the following command to start running the redis server:
> cd /opt/redis-stable/src
> ./redis-server

Open a console windows on the Windows host and type the following command to find out the boot2docker ip address:

> boot2docker ip

which should return something like 192.168.59.103  (Note that the address 192.169.59.103 is the ip address of the docker vm, which by default the docker container is mapped to)

Now start a redis client from the Windows console windows (if you have not downloaded the redis client binary, can download it from https://github.com/ServiceStack/redis-windows) by entering the following command line in the console of the Windows host:

> cd [your-redis-windows-binary-directory]
> redis-cli.exe -h 192.168.59.103

That's it. This is the link to some C# demo code (using the ServiceStack.Redis library via nuget) which connect to the redis server running in the docker container:

https://dl.dropboxusercontent.com/u/113201788/Redis/RedisDemoCSharp.zip


Thursday, June 18, 2015

Lessons on setup DevStack on a single server instance running AWS EC2

These are some lessons which I learned when I was trying out the openstack on the AWS EC2 server instance.

Before one starts, it is a good idea to make sure that one does not run an operational mysql in the server instance. Openstack's controller node requires mariadb, which kinds of replace the default mysql. I encountered several errors on a testing instance in which mysql was installed prior and operating. Installing openstack in this case failed with errors such as "unit mariadb.service failed to load: no such file or directory" when running "sudo service mariadb start" during the "./.stack.sh" execution.

Another important lesson is that one must make sure the server instance is allocated enough memory, openstack requires large amount of memory, AWS EC2 instance such as t1.micro instance usually is not sufficient to run the DevStack (at least in my case)

If you do not have git instance, run the following commands to install git:

> sudo apt-get update
> sudo apt-get install git

After that, can follow the guidelines from the link here to set up:

Link: http://docs.openstack.org/developer/devstack/

If you want to install devstack in docker container of a sort, can try the dockenstack (https://github.com/ewindisch/dockenstack), my experience with it is that it did not work well for me though.









Wednesday, June 17, 2015

docker on centos 7: are you trying to connect to a tls-enabled daemon without tls

After install docker on centos 7 and try to run a simple docker command such as "sudo docker images", it failes with this error message:

"Get http:///var/run/docker.sock/v1.18/images/json: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?"

After some trial and error, it appears that centos actually does not launch docker service (not sure something to do with firewall in centos 7), anyway, running the "sudo service docker start" fix the problem.

Install and start docker on centos 7

Nice post on how to install and start docker on centos 7:

Link: http://www.liquidweb.com/kb/how-to-install-docker-on-centos-7/

Deploy spring mvc application in cloud

After login to the cloud computing instance, run either the "uname -a" or "cat /etc/redhat-release" to discuss the linux os version of the instance.

Follows the following link to install and run tomcat server:
http://tecadmin.net/install-tomcat-8-on-centos-rhel-and-ubuntu


If your spring mvc uses MySQL for database backend, follows the following link to install and run mysql:

http://www.rackspace.com/knowledge_center/article/installing-mysql-server-on-centos
(for centos 7): https://devops.profitbricks.com/tutorials/install-mysql-on-centos-7/

Once you have the environment setup, follow the link below to deploy your Spring MVC framework into the cloud computing instance:

link: http://www.mkyong.com/maven/how-to-deploy-maven-based-war-file-to-tomcat/


Check Linux OS version of a cloud computing instance

To list the linux kernel version, etc, run:

> uname -a

If the os is redhat family, run:

> cat /etc/redhat-release