Thursday, December 31, 2009

Part 5. Lock and Load - Fire up the MicroStrategy Intelligence Server

Part 5. Lock and Load - Fire up the MicroStrategy Intelligence Server 

By now we should have a fully functioning database server that's already configured for MicroStrategy use, and the MicroStrategy suite fully installed. What's the next logical step? Let's start the Intelligence Server up! Before we start the server however, we do have some configuration steps do perform first. In this tutorial we're going to setup our ODBC DSN for the metadata, create the repository tables, and link the Intelligence Server to those tables. After all fo this, we'll start the server and look for any errors.

To start off, we're going to need to create our initial ODBC DSN. The MicroStrategy Connectivity Configuration Wizard will create the odbc.ini entries for you, you just need to fill out a few simple fields. Let's go ahead and navigate to our <install>/home/bin directory and launch 'mstrconnectwiz'

mstradm@l:/mstr/home/bin> ./mstrconnectwiz



Select the database type you want the repository to sit in. In our case, we're using PostgreSQL. Select that option and press Next.




Go ahead and fill out the details of our PostgreSQL database we setup in Step 3.



Data Source Name: The name of our odbc.ini entry with the database details
Host Name: The server name where our database resides. Since our database server is the same name as our Intelligence Server, we can use localhost.
Port Number: Port number that the database is listening on. We didn't make any changes, so leave this at default.
Database Name: The name of the database that we created in Step 3.
Default User Name: The database username for MicroStrategy that we created in Step 3.

Once all fields are filled out, press the 'Test' button to test our new connection. Type in the password that you created for the 'mstr' database user, and hit Connect.



Once your setup is connecting properly, go ahead and press Finish to exit the Wizard. If you were to navigate to <install>/home/odbc.ini now, you would see our new DSN entry.

Next, let's create the repository tables in our database. While still in the <install>/home/bin directory, launch 'mstrcfgwiz'

mstradm@l:/mstr/home/bin> ./mstrcfgwiz



With 'Metadata, History List and Statistics Repository Tables' highlighted, hit Next.

At this point, I'm not going to worry about History List or Statistics tables. We'll leave the configuration of those for another time. Since we're focused on the Metadata tables right now, uncheck the other two and hit Next.



Next, select the Data Source Name that we just created. Type in the user name, password, and hit Next.



If the wizard is able to connect, you'll be presented with a Summary screen. Select Finish to begin the table creation.



Once the wizard is done creating tables successfully, keep 'Return to Welcome page' checked and hit Close. This will put us back at the main page so that we can link up our Intelligence Server. *Note; If you receive any errors during the table creation process, re-check the steps performed in Part 3 of this series.



Now, let's link the Intelligence Server and Metadata up. Leave 'MicroStrategy Intelligence Server' checked and hit Next



Again, you'll need to specify the correct Data Source Name, user name, and password. Hit Next.



In the next screen you're going to need to connect to the Metadata with the MicroStrategy 'Administrator' user. Leave the password blank and hit Next.



Since is Metadata is brand new, we need to create a new server definition. Type in the name whatever name you'd like here. Keep 'Use as the active Server Definition' and hit Next.



Here is where you specify the Port number for the Intelligence Server to run on. I'm going to leave the default port of 34952 as we've already opened this port on the firewall back in Part 2. Also, the option 'Register Intelligence Server as a Service' looks to be disabled since we're not running this wizard as a superuser. Once we finish this setup we can register the server as a service easy enough with the 'mstrctl' command. Go ahead and hit Next.



Now you should see a Summary screen displaying the details of our Intelligence Server setup. Hit Finish.



Alright, we're finished with the Intelligence Server setup now. Go ahead and close the Configuration Wizard and go back to the command line.

Before starting, let's go ahead and register the server as a service. Navigate to the <install>/home/bin directory and run the following command with sudo

mstradm@l:/mstr/home/bin> sudo ./mstrctl -s IntelligenceServer rs
root's password:


Now, let's go ahead and start the server. To start as root, run the following command with sudo:

mstradm@l:/mstr/home/bin> sudo ./mstrctl -s IntelligenceServer start

You won't see any feedback on the command line, however if you want to see what the server is doing, navigate to <install>/log and run:

mstradm@l:/mstr/log> tail -f DSSErrors.log

This will echo the server output to the command line in real-time.

If you want to check on the status of the server, navigate back to <install>/home/bin and run:

mstradm@l:/mstr/home/bin> ./mstrctl -s IntelligenceServer gs | grep "<state"
<state can_be_paused="0">running</state>


As you can see from the output, the server is in 'running' state. It's alive! Also, if you want to check to make sure the server registered as a

service correctly, you can grep for "execution_mode" instead of "&lt;state"

mstradm@l:/mstr/home/bin>; ./mstrctl -s IntelligenceServer gs | grep "execution_mode"
<execution_mode>service</execution_mode>;


Here you can see Execution Mode is 'service', so we're all good!

So now that we have a running Intelligence Server, we can go ahead and start connecting some clients to it and have some real fun! Stay tuned...

Tuesday, December 29, 2009

Part 4. Installing MicroStrategy

Part 4.  Installing MicroStrategy

You may have thought that we would be tackling the Apache / Tomcat Server setup at this point, however that won't be until later.  We're now in a good position to install the MicroStrategy Suite on our new server and actually start it up to make sure things are looking good up to this point.

This tutorial is going to start off assuming that you've already downloaded the UNIX/Linux 64-bit MicroStrategy package, and have extracted all contents into the /mstr partition we created at setup.  If not, please do so now before continuing on.  If you're having trouble extracting the contents, simply right-click on the package and select 'Extract Here.'  You may need to change /mstr's security settings to allow your user write access, or simply extract the package contents with sudo.

Once the tarball has been extracted, you should have three new directories named:

./Documentation
./Installations
./ReleaseNotes

*Note: Beefore you start the installation, you may want to delete the original .zip package and tarball so that we don't run out of space on our installation partition.

We need to navigate to the ./Installations/QueryReportingAnalysis_Linux directory, and launch the installer with sudo.  *Note:  MicroStrategy recommends to install as root, and run as root, hence the sudo.


mstradm@linux-las9:/mstr/Linux/Installations/QueryReportingAnalysis_Linux> sudo ./setupLinux.bin



You should see the terminal print some information about 'Initializing InstallShield Wizard', then you'll be presented with your first GUI dialog for MicroStrategy.



Select your language and proceed.

Next is simply a Welcome page to MicroStrategy.



Selecting 'Next' will bring you to the MicroStrategy license agreement.  Accept the license terms and proceed.



On the next screen, you'll need to enter your user, company, and license key.  This will be the license key you received at the same time you received your download link for the Free Reporting Suite.  I already have my key which is what I'm going to use.



The next few wizard steps will have you specifying the location of your MicroStrategy component installation.  Here we're going to use the /mstr partition that we created when we setup the openSUSE environment.

For the home directory, I'm going to use /mstr/home



For the install directory, I'm going to use /mstr/install



For the log directory, /mstr/log



Next, we select the actual components that we're going to install.  By default, they should all be checked.  I'm going to leave it at this.



The next few screens will ask for the location for the various Web and Mobile components.  I'm going to keep the default location for all of these items.



*Since we're not using Tomcat and not WebLogic, we can simply hit 'Next' when presented with this screen:



BlackBerry Client Install Location:



Portlets Install Location:



Web Services (J2EE) Location:



Finally, we're ready to install.  You'll be presented with a final summary screen to view your installation details.  Once satisfied, hit 'Install'.



Now just sit and wait as our MicroStrategy components install!



Once the installation completes, the wizard will prompt you to continue on to the next steps to activate your new server installation.





Input your server name, location, use, and hit 'Next'.



Next, input the installer's (you) information.



And finally, confirm that you want to request an Activation code now.  *Note:  You will need an internet connection for this step.



If all is successful, you'll be presented with a confirmation dialog.



And we're all finished!  The next part of this series, we will go ahead and configure the Intelligence Server and Metadata, and start her up!


Monday, December 28, 2009

Part 3. Preparing PostgreSQL for Metadata use

Part 3. Preparing PostgreSQL for Metadata use

This section is going to start off with the assumption that you've already installed the PostgreSQL packages described in Step 1.  If not, please refer to that post before continuing.

At this point, the PostgreSQL server should not be running.  To check, open up a terminal, navigate to /usr/sbin, and type:


mstradm@linux-las9:/usr/sbin> sudo ./rcpostgresql status
Checking for PostgreSQL:                                             unused


Go ahead and start the server up:


mstradm@linux-las9:/usr/sbin> sudo ./rcpostgresql start
Initializing the PostgreSQL database at location /var/lib/pgsql/data done
Starting PostgreSQL                                                  done


At this point the database is running, however there's really nothing in it and no users other than 'postgres' created.  In order to log into the database for the first time, we need to switch to the 'postgres' user and type 'psql'.


mstradm@linux-las9:/usr/sbin> sudo su postgres
postgres@linux-las9:/usr/sbin> psql
psql (8.4.1)
Type "help" for help.

postgres=# 


Now you'll be sitting at a database prompt ready to type commands.  The first thing we can do is go ahead and create a password for the postgres database user.  At the prompt, type \password and you should be prompted for a new password as shown below:


postgres=# \password
Enter new password: 
Enter it again: 
postgres=# 


Now, type \quit to exit the psql prompt and go back to the main shell.

Next, let's create a database for MicroStrategy to use for the metadata that we're going to create and configure later.  While still using the 'postgres' user, type 'createdb DATABASE_NAME' and hit enter.  Should look like the following:


postgres@linux-las9:/usr/sbin> createdb METADATA


If the command completes successfully, you really shouldn't see anything on the screen.  If you'd like to check, log back into psql and execute \l (l as in L).  You'll see your new database listed in the output.


postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileg
es   
-----------+----------+----------+-------------+-------------+------------------
-----
 METADATA  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 


Before we move on to the next step, we need to "turn on" plpgsql for this new database.  If we don't, the MicroStrategy metadata configuration wizard will fail when creating the repository tables.  To do this, we will use the createlang command, passing 'plpgsql' as the second argument, and our database name as the third.


postgres@linux-las9:/usr/sbin> createlang plpgsql METADATA

Next we're going to need a database user for MicroStrategy to use when logging into the metadata.  For this, we're going to use the createuser command shown below:


postgres@linux-las9:/usr/sbin> createuser --superuser mstr


Yes, we're creating the MicroStrategy user named 'mstr' as a superuser of the database.  I'm primarily creating this user as a superuser for the sake of brevity, so if you're actually planning to deploy this into a real production environment, I'd pay some mind to properly selecting your user roles and privileges.

Launch psql again and set a password for the new 'mstr' account with ALTER USER.


postgres=# ALTER USER mstr WITH PASSWORD 'test';
ALTER ROLE


Now at this point, we have two users created for the database; postgres and mstr.  However, if you try to launch psql passing the -U (user) flag, you'll get the following error:


postgres@linux-las9:/usr/sbin> psql -U mstr
psql: FATAL:  Ident authentication failed for user "mstr"


This has to do with how we have the database authentication setup in the pg_hba.conf file.  To change, we need to navigate to the /var/lib/pgsql/data directory, and open pg_hba.conf with the text editor of your choice.  Scroll to the end of the file, and you should see connection settings listed.



Change the 'METHOD' from 'ident' to 'trust' for each line item.  After you complete the changes, the new settings should look like:



Go ahead and save your changes, however do not exit this file yet.  While we're here, let's make another change that will allow 2-tier connections to the database from non-local sources.  This could be simply connecting via a 2-tier connection in MicroStrategy Desktop, using the project duplication tool (which we will do later.), or connecting to the database with pgAdmin or another tool that isn't directly on the server machine.

What we need to do is add another line similar to those above, however specifying our outside IP address range and the connection method.  The line I'm going to add is:


host    all    all    192.168.10.100/20    md5


What this means is, any user can connect to any database, as long as the client IP address is within 192.168.10.100 - 192.168.10.120.  Also, the credentials will be encrypted since our method specifies md5.  So once I add this to my pg_hba.conf file, it now looks like:



Save the pg_hba.conf file.  One more file we need to modify to allow external access, and this file is again located in /var/lib/pgsql/data and is named postgresql.conf.  Go ahead and open this file in your text editor of choice, and find the following 'CONNECTIONS AND AUTHENTICATION' section:



Here, we need to uncomment the 'listen_addresses' line, and change 'localhost' to '*'.  Once complete, this section should look like:



Save the postgresql.conf file and exit.

We're finished!  Simply restart the PostgreSQL server and all changes should be in effect.


postgres@linux-las9:/usr/sbin> sudo ./rcpostgresql restart
Shutting down PostgreSQLserver stopped
                                                                     done
Starting PostgreSQL                                                  done


Part 2. Preparing openSUSE for Micro...

Part 2.  Preparing openSUSE for MicroStrategy Installation

In this section I'm going to talk about all of the OS-specific settings and configuration that we're going to want to change for our MicroStrategy installation.  This will not cover anything metadata or web related, this is specifically so that the Intelligence Server plays nice with our OS when it comes time to start up.

Firewall

By default, openSUSE 11.2 installs with the firewall enabled, and most ports are blocked.  The Intelligence Server listens on port 34952 by default, so we're going to want this port opened up for any external clients.  To open up the firewall for this port (or whatever port you want to run the I-Server on), keep reading.

Open up the YaST Control Center by going to 'Computer -> YaST', and enter in your password.

After the Control Center pops up, find the 'Security and Users' section.



From here, click on 'Firewall' to open up the configuration.  Once the configuration opens, select 'Allowed Services' in the left-hand pane.



Click on 'Advanced', and you should be presented with a screen where you can enter in allowed ports, separated by spaces.  Here I simply enter the port that the Intelligence Server is going to be running on, and select 'OK'.



On the Firewall Configuration screen, hit 'Next' and 'Finish'.  Your new settings will be applied, and port 34952 is now open.


Shared Memory and Semaphores

Most of the openSUSE 11.2 default memory and semaphore settings match the recommendations from MicroStrategy.  One setting in particular however, doesn't;  the maximum number of system wide semaphore sets.  This setting can be checked by opening a terminal screen, and typing:

mstradm@linux-las9:~> /sbin/sysctl -n kernel.sem | cut -f 4
1024

MicroStrategy's recommendation for this setting is 2048 (KB TN#30320).  To increase this setting, we're going to need to edit the /etc/sysctl.conf file.  I'm going to open this file in vi with sudo

mstradm@linux-las9:~> sudo vi /etc/sysctl.conf 
root's password:

and add the following to the end of the file

kernel.sem=250 256000 32 2048

The sysctl.conf file should look like this after:




Save the file.  Next we'll need to reload our new settings into the environment.  This can be done by typing:

mstradm@linux-las9:~> sudo /sbin/sysctl -p

Output:

net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
fs.inotify.max_user_watches = 65536
net.ipv4.conf.default.promote_secondaries = 1
net.ipv4.conf.all.promote_secondaries = 1
kernel.sem = 250 256000 32 2048

Now if you type the same command above to check, the output will be 2048.

mstradm@linux-las9:~> /sbin/sysctl -n kernel.sem | cut -f 4
2048


OpenSSL Library Links

Next, we're going to need to create some symbolic links to existing OpenSSL libraries installed on the system.  When the MicroStrategy installation wizard and server starts, it's looking for the two specific lib files by a different name.  The default name has the version number at the end of the filename, however MicroStrategy is looking for '.so.4'

First, we're going to navigate to /usr/lib64

To list our source filenames, type:

mstradm@linux-las9:/usr/lib64> ls -ltra *libssl.* *libcrypto.*
-r-xr-xr-x 1 root root 1605840 2009-10-23 21:19 libcrypto.so.0.9.8
-r-xr-xr-x 1 root root  326256 2009-10-23 21:19 libssl.so.0.9.8

Now that we have our file names, create a symbolic link to each one.  *Note, this must be done with sudo.

mstradm@linux-las9:/usr/lib64> sudo ln -s ./libssl.so.0.9.8 ./libssl.so.4
mstradm@linux-las9:/usr/lib64> sudo ln -s ./libcrypto.so.0.9.8 ./libcrypto.so.4

Now when we type the same ls command above, we should see our new links.

mstradm@linux-las9:/usr/lib64> ls -ltra *libssl.* *libcrypto.*
-r-xr-xr-x 1 root root 1605840 2009-10-23 21:19 libcrypto.so.0.9.8
-r-xr-xr-x 1 root root  326256 2009-10-23 21:19 libssl.so.0.9.8
lrwxrwxrwx 1 root root      17 2009-12-27 23:11 libssl.so.4 -> ./libssl.so.0.9.8
lrwxrwxrwx 1 root root      20 2009-12-27 23:11 libcrypto.so.4 -> ./libcrypto.so.0.9.8


GUI Installer

By default, when you launch the MicroStrategy installer for the first time, you'll most likely receive an X error, and the installer will tell you to re-run with the -console or -silent switch.  To get around this, open up a console and type:

mstradm@linux-las9:/usr/lib64> xhost +localhost
localhost being added to access control list

Now when you run the setup installer, you should be presented with the GUI Install wizard.

And this concludes the openSUSE 11.2 preparation.  Depending on the environment size, or machine specs, obviously some of the above (Shared Memory, OpenSSL file names) settings do have the potential to change.  All of this is fairly straight forward though, even if you're not extremely familiar with the command line.  With that said, I'll probably create a prep script to perform the steps above just so that I don't have to manually do them each time.  I'll post the script when/if I create it.

Part 1. openSUSE 11.2 64 bit Installation and Setup

Part 1.  openSUSE 11.2 64 bit Installation and Setup

This tutorial starts out with the assumption that you're already sitting at the openSUSE 11.2 main menu (either VirtualBox or physical server.)  If you're not at this point yet, you'll need to reference my previous Pre-Step 1 article.

From the openSUSE 11.2 main menu, arrow down to 'Installation' and hit Enter.  You should see a 'Loading Linux Kernel' progress dialog.



The installation wizard is quite intuitive, and hides a lot of the complexities that are involved in an OS installation.  When you're presented with the 'Welcome' screen, go ahead and browse through the License Agreement, then hit 'Next'.



The wizard performs a quick system analysis, then should present you with the 'Installation Mode' screen.  Select 'New Installation', then 'Next'.



On the next screen you'll select your timezone and hit 'Next' again.

After selecting the timezone, you'll be able to select the Desktop Environment of your choice.  I typically use Gnome (and can vouch that the MicroStrategy GUI components run fine under it), so I'm going to select 'GNOME' and hit 'Next'.



Now we're to the part where the wizard wants to know how to partition our disk.  By default, the suggested partitioning has a swap, root, and home partitions.  I'm going to resize the /home partition and add an /mstr partition for the MicroStrategy server components.  To do this, click on 'Edit Partition Setup'.



The 'Expert Partitioner' dialog pops up, however don't let the name fool you.  What we're doing here is extremely easy and straight forward.  First, expand the 'Hard Disks' tree so that it looks like below.



Notice how the 'Type' of our /dev/sda device is 'VBOX-HARDDISK'?  That's our primary disk, and each partition is listed underneath it.  Select the partition with a 'Mount Point' name of /home and click 'Resize'.  You'll see the Resize dialog, I'm going to resize /home to 5 GB.




Now we're going to need to create a new partition by pressing 'Add Partition...' at the bottom of the dialog.

The wizard walks you through creating the new partition.  Our new partition type is going to be 'Primary'.



You can keep the suggested size, as it's just filling up the rest of the free space created when we resized /home.



On the final partition screen, we can change the mount point of our new partition.  By default, the name is /usr.  We're going to change this to /mstr and hit 'Finish'.



Once you're back to the 'Expert Partitioner' dialog, go ahead and hit 'Accept'.  Your partition summary should look like the following:



On the next screen, you're going to setup the user to log into this VM.  Type in the name and password details, and hit 'Next'.



Finally, you'll be presented with a 'Summary' screen showing installation details such as mount points, software packages, system specs, etc.  Hit 'Install', and you should see a 'Confirm Installation' screen.  Hit 'Install' once more, and the installation will begin.



At this point, it might be a good idea to go find something to do.  Depending on the speed of your machine, this could take a while.  On my MacBook 2.0ghz c2d, it takes roughly 30 minutes.  Once the installation is finished, the VM will automatically reboot.  Now, the installer will run through an 'Automatic Configuration' which should only take a few minutes.

Finished!


Well, almost finished.  At this point, we're going to go ahead and add all of the packages that we're going to need to deploy our MicroStrategy environment.  The actual configuration that we're going to perform to the environment and software components will be addressed additional tutorials.

You should be staring at your openSUSE desktop at this point.  We're going to add our software packages with the YaST Software Manager.  Click on 'Computer', and select 'Install Software'.



The Software Manager may appear to take a while the first time you load it, however all subsequent loads should be quicker.

You should be staring at the Software Manager now.  Make sure the 'Available' tab is selected, and we can start to search for our packages to install.



To add a package to the to-be-installed queue, simply select the package and hit the 'Install' button.  The install will not start immediately, allowing you to add all packages then install at once.

Needed Packages:

Package Name
Description
postgresql
Basic Clients and Utilities for PostgreSQL
postgresql-server
The programs needed to create and run a PostgreSQL Server
libstdc++33-32bit
Standard C++ shared library (32bit)
tomcat6
Apache Servlet/JSP Engine
tomcat6-admin-webapps
host-manager and manager web apps for Apache Tomcat
apache2
Apache Web Server

There will most likely be some dependency packages already selected, that's fine.  After you've selected the packages above to be installed, go ahead and hit 'Apply'.

You may have also noticed that there was a 'Changes' section on the Software Manager screen with items in it.  That's also fine, these are all post-install changes that the system wants to do.  Part of these changes is the 'VirtualBox Guest Additions' package that you'll need installed to properly share folders with your host system, and resize the screen.

Once all packages are installed, perform a quick reboot and we're finished!  The next few tutorials will cover setting some OS configurations, setting up the database, and prepping Apache/Tomcat for Web Universal.