Friday, January 1, 2010

Part 7. Wrap up

Part 7. Wrap up

Up to this point we've been using completely free software and have a basic deployment of MicroStrategy setup.  Unfortunately, that ends here.  Which non-free piece of software am I talking about?  Microsoft Windows.  In order to really do some serious MicroStrategy development, you need to be working on MicroStrategy Desktop.  Also, Desktop is the ideal place for most of the MicroStrategy Administration to maintain your environment.

Now, I'm not going to walk through the process of setting up MicroStrategy Desktop on Windows; it's seriously trivial.  You launch the Wizard, Next > Next > Next > Finish.  Quite straight forward, and not really worth a multi-step tutorial.  If help is needed, there are plenty of MicroStrategy resources to help in this basic setup in the knowledge base, or manuals.  There is no configuration trickery or gotchas that you really need to worry about.

I do want to note however, when you perform the Desktop installation, install the 'MicroStrategy Tutorial' component.  This will basically copy over an access Metadata and a 2-tier project source already created in Desktop, so you can browse around and take a look at a pre-built environment.  If you want to be really clever, right click on the 'MicroStrategy Tutorial' project and click 'Duplicate Project'.  You can duplicate this project into your new 3-tier Metadata to play with!  For most of my future tutorials covering development and SDK work, I'll probably be using this project to demo my examples.  The source data for these reports is in an Access database too, so I'm planning on doing a data migration from Access to a new PostgreSQL server, for a fully functional 3-tier environment.

Lastly, I want to mention that the purpose of this series was not necessarily explaining all the steps involved in creating a new deployable MicroStrategy environment.  Obviously there's a lot of things we didn't do yet; such as change the Administrator password, Activate the MicroStrategy installation, perform any server configuration optimization, etc.  The purpose was to deploy a full environment (minus Desktop!) on free software.  The VirtualMachine, OS, Database, Web Server, Application Server, Reporting Suite.. it's all free.  This serves as a great foundation for any hobbyest (MicroStrategy hobbyest??) to have a personal installation to test with.


Part 6. Setting up MicroStrategy Web Universal

Part 6. Setting up MicroStrategy Web Universal

So here are we, nearing the end of this series.  With all of the work we've done, we really still can't do anything with the system yet.  Even after this tutorial, you'll not be able to start doing any real work yet.  However, we are inching closer and closer, and it will all come together in the end.  In this tutorial, we're going to setup Apache and Tomcat, and deploy the MicroStrategy Web Universal environment.

First things first, let's go ahead and startup Tomcat if it's not already running.  Navigate to /usr/sbin and run:

mstradm@linux-las9:/usr/sbin> sudo ./rctomcat6 start
Starting Tomcat (/usr/share/tomcat6)                                                                                                                  done

At this point, Apache/Tomcat is now running on port 8080.  If you were to open a web browser and go to http://localhost:8080, you should just simply see a blank page (no errors.)

Next thing we need to do is setup our roles and users for Tomcat AND MicroStrategy administration.  Navigate to /usr/share/tomcat6/conf and sudo open tomcat-users.xml with your favorite text editor.  The default file should look like:



Out of the box, this file isn't really being used.  You can see, the <tomcat-users> node is commented out, so really this whole file is a big comment file.  Go ahead and uncomment the contents within <tomcat-users>



Next, let's add a couple of roles.  Namely, a 'manager' role for Tomcat Web Manager functionality, and 'admin' for MicroStrategy Web Administration functionality.  The syntax is simply <role rolename="role_name" />  Do this for the 'manager' and 'admin' roles.



Now that we have our roles created, let's create a new user for the MicroStrategy Web AND Tomcat administration.  I'm going to create the web user as 'mstr':



You can see after the 'roles' element, we're specifying tomcat, manager, and admin.  You can also see where we set the password.  Be sure to take note of this, we'll need it to log into the Tomcat WebApp Manager and MicroStrategy.  Also, take note of just how simple all of the passwords are.  This would be a good time to go ahead and change those to something a bit more complicated.  If further information is needed, there are plenty of resources on the web for setting up Tomcat security.

So after you finish making your tomcat-users.xml edits, save the file and restart tomcat:

mstradm@linux-las9:/usr/share/tomcat6/conf> sudo /usr/sbin/rctomcat6 restart
Shutting down Tomcat (/usr/share/tomcat6)
                                                                                                                                                      done
Starting Tomcat (/usr/share/tomcat6)                                                                                                                  done
Now open up a web browser from your openSUSE server, and go to http://localhost:8080/manager/html



From this WebApp Manager, we're going to deploy both MicroStrategy Web and Web Services.  Scroll down the WebApp Manager page to where you see "WAR file to deploy", and click 'Browse'.



Navigate to <install>/install/WebUniversal and you should see MicroStrategy.war.  Select that war file, and then click 'Deploy'.  This may take a few minutes, so if you don't see anything happening right away don't worry.  When the WebApp Manager is finished, you'll see it listed under 'Applications' and it should already be started.  Also at this time, if you want to deploy WebServices now's a good time to do it.  The deployment is exactly the same, however you'll use the MicroStrategyWS.war file from <install>/install/WebServicesJ2EE



As you can see, MicroStrategy Web was installed under /MicroStrategy which translates to http://localhost:8080/MicroStrategy .  Go ahead and click the /MicroStrategy path link.



Ah hah!  There's MicroStrategy Web is up and functional.  Click on the 'Web Administrator' link and enter the MicroStrategy user you defined in the tomcat-users.xml file.  You should be taken to the Web Administration page where you can now connect Web up to the Intelligence Server.



Now, simply add localhost into the 'Add a server manually' field and click Connect.



We're connected!  Unfortunately, that's about all that we can do at this point, as we don't actually have any projects built.  However, the foundation is now built and ready for some real work!

The next part in this series will be the last; and briefly cover connecting to your Intelligence Server with Desktop (from Windows) and getting started.

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