Sean's Musings as a Service

Sean's Musings as a Service

Getting started with IBM UrbanCode Deploy on Ubuntu 13.04

  • Published:
  • categories: ibm
  • tags: automation, deploy, ibm, urbancode

So I have been playing around with UrbanCode Deploy for demos and testing on local VMs, just today I decided to install it on a VM in my home LAN ESXi server. The install process is fairly painless, to make this self-contained I just needed to install mysql, the mysql jdbc driver, and a Java 6+ jre or jdk.

This is an example done on Ubuntu 13.04, install the pre-requisites and setup a basic mysql database to use:

sgwilbur@uc:~$ sudo apt-get install mysql-server libmysql-java
...
sgwilbur@uc:~$ mysql -u root -p
sgwilbur@uc:~/uc-deploy$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.5.32-0ubuntu0.13.04.1 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
mysql> CREATE DATABASE uDeploy;
Query OK, 1 row affected (0.03 sec)

mysql> CREATE USER 'udeploy'@'localhost' IDENTIFIED BY 'passw0rd';
Query OK, 0 rows affected (0.06 sec)

mysql> GRANT ALL ON uDeploy.* TO 'udeploy'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

Here is an example of the mysql commands I ran here if you want to copy and paste:

CREATE DATABASE uDeploy;
CREATE USER 'udeploy'@'localhost' IDENTIFIED BY 'passw0rd';
GRANT ALL ON uDeploy.* TO 'udeploy'@'localhost' WITH GRANT OPTION;
Now that we have mysql setup, we can setup UrbanCode Deploy.
sgwilbur@uc:~$ ls
chef-repo ;chef-solo ;jdk-7u25-linux-x64.gz ;URBANCODE_DEPLOY_V6.0_MP_EN.zip
sgwilbur@uc:~$ cd /opt
sgwilbur@uc:/opt $ sudo tar xvzf ~/jdk-7u25-linux-x64.gz
... < removed uninteresting output from extract command >
sgwilbur@uc:/opt$ sudo chmod -R 755 jdk1.7.0_25
sgwilbur@uc:/opt$ cd
sgwilbur@uc:~$ mkdir uc-deploy && cd uc-deploy
sgwilbur@uc:~/uc-deploy$ 7za x ../URBANCODE_DEPLOY_V6.0_MP_EN.zip

Before we start the installation, we just need to copy the mysql JDBC jar to the local install directory, there are a few links created by default on Ubuntu so just make sure you copy the actual file.

sgwilbur@uc:~/uc-deploy$ ls -als /usr/share/java/
total 816
  4 drwxr-xr-x   2 root root   4096 Oct 18 13:39 .
  4 drwxr-xr-x 105 root root   4096 Oct 18 13:39 ..
  4 -rw-r--r--   1 root root   2617 Mar  8  2013 libintl.jar
804 -rw-r--r--   1 root root 822524 Oct 20  2011 mysql-connector-java-5.1.16.jar
  0 lrwxrwxrwx   1 root root     31 Oct 20  2011 mysql-connector-java.jar -> mysql-connector-java-5.1.16.jar
  0 lrwxrwxrwx   1 root root     24 Oct 20  2011 mysql.jar -> mysql-connector-java.jar
sgwilbur@uc:~/uc-deploy$ cp /usr/share/java/mysql-connector-java-5.1.16.jar lib/ext

Now we are ready to do the installation, just set a temporary JAVA_HOME for the command and follow the prompts.

sgwilbur@uc:~/uc-deploy$ sudo JAVA_HOME=/opt/jdk1.7.0_25 ./install-server.sh 
[sudo] password for sgwilbur: 
Buildfile: install.with.groovy.xml

install:
    [unzip] Expanding: /home/sgwilbur/uc-deploy/conf.zip into /tmp/install-1172838463089040965.tmp
     [echo] Found sub-installer UCDeployInstaller.groovy
IMPORTANT: READ CAREFULLY
Two license agreements are presented below.
1. IBM International License Agreement for Evaluation of Programs
2. IBM International Program License Agreement

< ... TRUNCATED FULL LICENSE INFORMATION, YOU CAN READ THIS ON YOUR OWN TIME AND INSTALL ... >

L/N:  L-PASH-98BHN9
D/N:  L-PASH-98BHN9
P/N:  L-PASH-98BHN9

     [echo] Do you accept the license? [y,n]
y
     [echo] 
     [echo] Installing IBM UrbanCode Deploy version 6.0.0.424813
     [echo] Enter the directory where the IBM UrbanCode Deploy should be installed. [Default: /opt/ibm-ucd/server]
     
     [echo] The specified directory does not exist. Do you want to create it? Y,n [Default: Y]
     
     [echo] 
     [echo] Installing IBM UrbanCode Deploy to: /opt/ibm-ucd/server
     [echo] Please enter the home directory of the JRE/JDK used to run the server. [Default: /opt/jdk1.7.0_25]
     
     [echo] JVM Version detected: 1.7.0_25
     [echo] JAVA_HOME: /opt/jdk1.7.0_25
     [echo] What host name will users access the web UI at? [Default: uc]
uc.vl4rl.local
     [echo] Do you want the Web UI to always use secure connections using SSL? Y,n [Default: Y]
     
     [echo] Enter the port on which the Web UI should listen for secure HTTPS requests. [Default: 8443]
443
     [echo] Enter the port on which the Web UI should redirect unsecured HTTP requests from. [Default: 8080]
80
     [echo] Enter the port to use for agent communication. [Default: 7918]
     
     [echo] Do you want the Server and Agent communication to require mutual authentication?  This requires a manual key exchange between server and each agent. See documentation for more details. y,N [Default: N]
     
     [echo] When installing a server as a part of an existing cluster or when using a pre-populated database, it is not necessary to create the database schema. This step must be performed when installing a standalone server to a fresh database or when installing the first server in a cluster.
     [echo] Create database schema? Y,n [Default: Y]
n
     [echo] Please enter the database connection information for this server to use when connecting to the existing database:
     [echo] The following database types are supported: derby, mysql, oracle, sqlserver, postgres.
     [echo] Enter the database type to use. [Default: derby]
mysql
     [echo] Enter the database driver. [Default: com.mysql.jdbc.Driver]
     
     [echo] Please place the jar file containing the driver for your database inside the lib/ext directory in the IBM UrbanCode Deploy installer. MySQL driver version 5.0.8 is recommended for best compatibility. (press enter to continue)
     
     [echo] Enter the database connection string. Eg. jdbc:mysql://localhost:3306/ibm_ucd
jdbc:mysql://localhost:3306/uDeploy
     [echo] Enter the database username. [Default: ibm_ucd]
udeploy
     [echo] Enter the database password. [Default: password]
passw0rd
    [mkdir] Created dir: /opt/ibm-ucd/server/bin
    [mkdir] Created dir: /opt/ibm-ucd/server/conf/server
    [mkdir] Created dir: /opt/ibm-ucd/server/endorsed
    [mkdir] Created dir: /opt/ibm-ucd/server/lib
    [mkdir] Created dir: /opt/ibm-ucd/server/licenses
    [mkdir] Created dir: /opt/ibm-ucd/server/native
    [mkdir] Created dir: /opt/ibm-ucd/server/patches
    [mkdir] Created dir: /opt/ibm-ucd/server/extensions
    [mkdir] Created dir: /opt/ibm-ucd/server/var/log
    [mkdir] Created dir: /opt/ibm-ucd/server/var/temp
     [copy] Copying 1 file to /opt/ibm-ucd/server/conf
   [genkey] Generating Key for server
     [sync] Copying 153 files to /opt/ibm-ucd/server/lib
     [copy] Copying 1 file to /opt/ibm-ucd/server/lib/ext
     [sync] Copying 5565 files to /opt/ibm-ucd/server/opt/tomcat
     [copy] Copying 1 file to /opt/ibm-ucd/server/bin
   [genkey] Generating Key for tomcat
     [copy] Copying 1 file to /opt/ibm-ucd/server/opt/tomcat/conf
    [mkdir] Created dir: /opt/ibm-ucd/server/bin/init
     [copy] Copying 2 files to /opt/ibm-ucd/server/bin
     [copy] Copying 1 file to /opt/ibm-ucd/server/bin
     [copy] Copying 1 file to /opt/ibm-ucd/server/bin
    [unzip] Expanding: /home/sgwilbur/uc-deploy/udconf.zip into /tmp/install-3460594158790739485.tmp
     [copy] Copying 18 files to /opt/ibm-ucd/server/conf
     [copy] Copying 91 files to /opt/ibm-ucd/server
     [copy] Copying 4 files to /opt/ibm-ucd/server/bin
[propertyfile] Updating property file: /opt/ibm-ucd/server/conf/server/installed.properties
[propertyfile] Updating property file: /opt/ibm-ucd/server/conf/server/installed.properties
   [delete] Deleting directory /tmp/install-3460594158790739485.tmp
     [echo] Creating new encryption key.
[propertyfile] Updating property file: /opt/ibm-ucd/server/conf/server/installed.properties
[propertyfile] Updating property file: /opt/ibm-ucd/server/conf/server/installed.properties
[propertyfile] Updating property file: /opt/ibm-ucd/server/conf/server/installed.properties
[propertyfile] Creating new property file: /opt/ibm-ucd/server/conf/installed.version
     [echo] After starting the server, you may access the web UI by pointing your web-browser at
     [echo] https://uc.vl4rl.local:443 to complete the Installation.
     [echo] Installer Complete. (press return to exit installer)

So you should be done with the installation, we can run the startup and should be able to access the server from the localhost. This is fine for testing, but if you are setting this up on a centralized server for testing with you can make one more update. Below is the property that limits access to only localhost when this value is null as it seems to be set by default during the installation.

sgwilbur@uc:~/uc-deploy$ cd /opt/ibm-ucd/server
sgwilbur@uc:/opt/ibm-ucd/server$ grep -R --include=*.properties 'install.server.web.ip' *
conf/server/installed.properties:install.server.web.ip=null

sgwilbur@uc:/opt/ibm-ucd/server$ grep -R --include=*.xml 'install.server.web.ip'

opt/tomcat/conf/server.xml:  address="${install.server.web.ip}"
opt/tomcat/conf/server.xml:  address="${install.server.web.ip}"
;

So while this is fine for testing, to setup a real server you will need to either, update the installed.properties file to specify your address statically or remove the address=* lines from the server.xml file and permit tomcat to bind to any available. In this case I just updated the installed.properties file with my static ip address (here 192.168.1.13), if you have any trouble check what addresses your tomcat instance is binding to as a first step. The only ones I really care about here are the 80/443 lines.

sgwilbur@uc:/opt/ibm-ucd/server$ netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:3142            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:3306          127.0.0.1:43910         TIME_WAIT  
tcp        0      0 192.168.1.13:22         192.168.1.170:57903     ESTABLISHED
tcp        0      0 127.0.0.1:3306          127.0.0.1:43913         ESTABLISHED
tcp        0    176 192.168.1.13:22         192.168.1.170:57796     ESTABLISHED
tcp        0      0 127.0.0.1:3306          127.0.0.1:43912         ESTABLISHED
tcp6       0      0 :::7918                 :::*                    LISTEN     
tcp6       0      0 192.168.1.13:80         :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 192.168.1.13:443        :::*                    LISTEN     
tcp6       0      0 :::3142                 :::*                    LISTEN     
tcp6       0      0 127.0.0.1:43910         127.0.0.1:3306          TIME_WAIT  
tcp6       0      0 127.0.0.1:43912         127.0.0.1:3306          ESTABLISHED
tcp6       0      0 127.0.0.1:43909         127.0.0.1:3306          TIME_WAIT  
tcp6       0      0 127.0.0.1:43911         127.0.0.1:3306          TIME_WAIT  
tcp6       0      0 127.0.0.1:43913         127.0.0.1:3306          ESTABLISHED

Either way YMMV, drop me a line if this is helpful, you want to see something specific, or if you have questions.

Reference: