Running TM1 as a service rather than an application can be a bit more secure as it's less likely to be stopped by accident. It is also often IT policy to run services where possible as users (with access rights) can control services remotely without using RDP or similar.
You have to dig in the manuals a bit to find how to create services after install, but the basics are straight forward...
Open a command prompt (Start->Run... "cmd") and change directory to the bin folder of where TM1 is installed
e.g.
CD C:\Program Files\Cognos\TM1\Bin
to create a service type:
tm1sd.exe -install "ServiceName" "DataDirectory"
to delete a service type:
tm1sd.exe -remove -n "ServiceName"
Note that when TM1 runs as a service it will automatically save changes to disk when the server is stopped and it will also load any unsaved logged information in the tm1s.log file on start. Both of these are questions put to the user when running as an application. This can be a good thing it prevents you accidently not saving a lot of data, but if you want control over the write to disk you should use an application.
Creating and deleting services
- Martin Ryan
- Site Admin
- Posts: 1988
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Creating and deleting services
Last edited by Martin Ryan on Tue Mar 20, 2012 12:06 am, edited 3 times in total.
Reason: Removed redundant switches as pointed out by another user
Reason: Removed redundant switches as pointed out by another user
- Martin Ryan
- Site Admin
- Posts: 1988
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Re: Creating and deleting services
Another nice thing about running TM1 as a service, rather than as an application, is that you can use TM1 to restart itself, via a batch file.
Create a batch (*.bat) file on the server box in a directory accessible by TI (usually easiest to put it in the data directory) and insert the following two lines into it
You can then use the ExecuteProcess command in the epilog of a TI process, e.g.
This can be useful, for example, if you don't have easy access to the development server and you need to restart it frequently for testing purposes. It is also a crude, though sometimes effective, way of managing models that frequently hit RAM limits.
Create a batch (*.bat) file on the server box in a directory accessible by TI (usually easiest to put it in the data directory) and insert the following two lines into it
Code: Select all
net stop <servicename>
net start <servicename>
Code: Select all
EXECUTECOMMAND('<path to database directory>\RESTART.BAT',0);
-
- Regular Participant
- Posts: 152
- Joined: Fri May 23, 2008 12:08 am
- OLAP Product: TM1 CX
- Version: 9.5 9.4.1 9.1.4 9.0 8.4
- Excel Version: 2003 2007
- Location: Melbourne, Australia
- Contact:
Re: Creating and deleting services
Actually if the batch file is in the data directory then all that is required is as the default directory path that TI assumes is the database directory.
Code: Select all
EXECUTECOMMAND('RESTART.BAT',0);
-
- Posts: 17
- Joined: Tue Jun 17, 2008 10:44 pm
- OLAP Product: TM1 9.1.4 64-bit
- Version: Olap Objects and TM1 Web
- Excel Version: 2003
- Location: Seattle, WA; Oakland, CA
Re: Creating and deleting services
One thing I might add is that you might need the MS Resource kit tools (rktools.exe) to get the 'sleep' command to stop the process from trying to restart before it has finished writing to disk.
Using 64-bit TM1, the write-down takes some what longer after the nightly chores finish running. We've run into problems where the service failed to restart and users were left without Tm1 availability.
Our batch looks like your net stop/net start but has sleep -x seconds between to allow the write to disk to complete.
So far works like a charm.
Using 64-bit TM1, the write-down takes some what longer after the nightly chores finish running. We've run into problems where the service failed to restart and users were left without Tm1 availability.
Our batch looks like your net stop/net start but has sleep -x seconds between to allow the write to disk to complete.
So far works like a charm.
- Martin Ryan
- Site Admin
- Posts: 1988
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Re: Creating and deleting services
As pointed out by Herman in the main forum...
Installing a TM1 service in 9.5 has changed slightly.....
Historically you would need to write the following code in Command Prompt world
TM1sd.exe -install TM1Server "c:\Dev\Tm1server"
NOW IN 9.5
TM1sd.exe -install -n TM1Server -z "c:\Dev\Tm1server"
It has new parameters of -n and -z that was not needed before (or not aware of) in the command prompt.
Examine this in the Operations Guide.
Installing a TM1 service in 9.5 has changed slightly.....
Historically you would need to write the following code in Command Prompt world
TM1sd.exe -install TM1Server "c:\Dev\Tm1server"
NOW IN 9.5
TM1sd.exe -install -n TM1Server -z "c:\Dev\Tm1server"
It has new parameters of -n and -z that was not needed before (or not aware of) in the command prompt.
Examine this in the Operations Guide.
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Jodi Ryan Family Lawyer
- Alan Kirk
- Site Admin
- Posts: 6610
- Joined: Sun May 11, 2008 2:30 am
- OLAP Product: TM1
- Version: PA2.0.9.18 Classic NO PAW!
- Excel Version: 2013 and Office 365
- Location: Sydney, Australia
- Contact:
Re: Creating and deleting services
Wise users who followed my "How To" guide always used these anyway.Martin Ryan wrote:As pointed out by Herman in the main forum...
Installing a TM1 service in 9.5 has changed slightly.....
Historically you would need to write the following code in Command Prompt world
TM1sd.exe -install TM1Server "c:\Dev\Tm1server"
NOW IN 9.5
TM1sd.exe -install -n TM1Server -z "c:\Dev\Tm1server"
It has new parameters of -n and -z that was not needed before (or not aware of) in the command prompt.
Examine this in the Operations Guide.
I wrote:My preference is to pass the parameter flags (eg, -n) as well as the parameters themselves (eg ProdServer) when installing a service
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.