Board index » off-topic » Re: How to start/stop server configuration remotely?

Re: How to start/stop server configuration remotely?


2006-03-16 08:52:40 PM
off-topic18
Yakushkov Mikhail wrote:
Quote
How can I stop and stop a server configuration remotely?
Since it's running as a service you can just connect to the remote
machine via Computer Management, presuming that your machine and the
remote server are on the same domain. Expand the list of services and
start or stop the configuration.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
How to ask questions the smart way:
www.catb.org/~esr/faqs/smart-questions.html
 
 

Re:Re: How to start/stop server configuration remotely?

How can I stop and stop a server configuration remotely?
I've got two server configuration installed on server1. I like to perform
server configuration backup from remote machine server2 (a build server).
I cannot find any information about such situation only how start/stop server
localy. My StarTeam server running as a Windows-service.
Any suggestions?
 

Re:Re: How to start/stop server configuration remotely?

I've found an answer by myself. At least it works if StarTeam server runs
as service. The key is SC command.
so here is the usage of this command for the case of star/stop a service:
start server:
sc \\computername start StarTeamServer-<configuration name>
stop server:
sc \\computername stop StarTeamServer-<configuration name>
where <configuration name>- the name of target configuration without <>.
Note you must avoid any spaces in service name!
It's impossible just to pause/resume this service.
This command takes some time and is asynchronuos so you must wait some time
or query service status. You can query status of StarTeam service using this
command:
sc \\computername query StarTeamServer-<configuration name>
MY>How can I stop and stop a server configuration remotely?
MY>
MY>I've got two server configuration installed on server1. I like to
MY>perform server configuration backup from remote machine server2 (a
MY>build server). I cannot find any information about such situation
MY>only how start/stop server localy. My StarTeam server running as a
MY>Windows-service.
MY>
MY>Any suggestions?
MY>
 

{smallsort}

Re:Re: How to start/stop server configuration remotely?

Thank you Craig, I've found an answer by my self. Google rules! Probably
I need a way to perform those operations from nightly backup script. So hand
using Computer Management isn't an option in this scenario.
C>Yakushkov Mikhail wrote:
C>
Quote
>How can I stop and stop a server configuration remotely?
>
C>Since it's running as a service you can just connect to the remote
C>machine via Computer Management, presuming that your machine and the
C>remote server are on the same domain. Expand the list of services and
C>start or stop the configuration.
C>
 

Re:Re: How to start/stop server configuration remotely?

"Yakushkov Mikhail" < XXXX@XXXXX.COM >wrote in message
Quote
I've found an answer by myself. At least it works if StarTeam server runs
as service. The key is SC command.
..........or a script using WMI can also control services remotely.
Quote
Note you must avoid any spaces in service name!
.........or put quotation marks around the service name
Quote
It's impossible just to pause/resume this service.
.........meanning I presume the starteamserver service. It is possible to
issue a PAUSE command via SC to a service that will actually pause, which
starteamserver I think will not.
 

Re:Re: How to start/stop server configuration remotely?

"Yakushkov Mikhail" < XXXX@XXXXX.COM >wrote in message
Quote
I've found an answer by myself. At least it works if StarTeam server
runs as service. The key is SC command.

It's impossible just to pause/resume this service.
Why do you need to stop the server?
If you're doing a backup, then all you need to do is lock it (this
prevents activity on the database and is equivalent to "pause") and
unlock it afterwards (equivalent to "resume").
To lock the server (in a Windows batch file):
%stcmd% Server-mode -s %access% -mode lock
where stcmd stands for the local path to "stcmd.exe"
eg. "C:\Program Files\Borland\StarTeam 2005 R2\stcmd.exe"
and access="Administrator:password@machine:port"
machine is where the StarTeam Server is running
port is the TCP/IP on which it is accessed
To unlock the server (in a Windows batch file):
%stcmd% Server-mode -s %access% -mode unlock
These can both be issued remotely providing you have network access.
The only time you would need to stop the server is to run a Purge.
--
Regards, Rob E.
 

Re:Re: How to start/stop server configuration remotely?

Thank you for replay.
RE>Why do you need to stop the server?
I just try to stick to manual :) "lock it for 30 minutes, shut the server
down, perform backup, start the server up."
RE>If you're doing a backup, then all you need to do is lock it (this
RE>prevents activity on the database and is equivalent to "pause") and
RE>unlock it afterwards (equivalent to "resume").
If you sure I'll use it.
RE>To lock the server (in a Windows batch file):
RE>%stcmd% Server-mode -s %access% -mode lock
RE>where stcmd stands for the local path to "stcmd.exe" eg. "C:\Program
RE>Files\Borland\StarTeam 2005 R2\stcmd.exe"
RE>
RE>and access="Administrator:password@machine:port"
RE>machine is where the StarTeam Server is running
RE>port is the TCP/IP on which it is accessed
RE>To unlock the server (in a Windows batch file):
RE>%stcmd% Server-mode -s %access% -mode unlock
RE>These can both be issued remotely providing you have network access.
thank you I'll use it in my super-pooper-backup-script.
 

Re:Re: How to start/stop server configuration remotely?

Quote
>I've found an answer by myself. At least it works if StarTeam server
>runs as service. The key is SC command.
>
DH>..........or a script using WMI can also control services remotely.
DH>
SC command easy to use from a batch file or NAnt build file. It present on
Windows XP, 2003 and possibly other. But any way it could be used in right
place. Thank you.
Quote
>Note you must avoid any spaces in service name!
>
DH>.........or put quotation marks around the service name
DH>
You aren't right. It is not a file name. I just tried your approach and it
doesn't work. You should leave the spaces out.
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:
Quote
>It's impossible just to pause/resume this service.
>
DH>.........meanning I presume the starteamserver service. It is
DH>possible to issue a PAUSE command via SC to a service that will
DH>actually pause, which starteamserver I think will not.
DH>
It's possible to issue pause command but it returns an error:
[SC] ControlService FAILED 1052:
probably lock=pause and unlock=resume.
 

Re:Re: How to start/stop server configuration remotely?

Rob Evans wrote:
Quote
Why do you need to stop the server?
If you're doing a backup, then all you need to do is lock it (this
prevents activity on the database and is equivalent to "pause") and
unlock it afterwards (equivalent to "resume").
Um, if you have a Native-II repository you don't need to lock or stop
the server at all. Just backup the DB server using the appropriate tool
for your server, then backup the repository once that's complete.
With Native-I / Pre-ST 2005 you must stop the server, though.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
IB 6 versions prior to 6.0.1.6 are pre-release and may corrupt
your DBs! Open Edition users, get 6.0.1.6 from mers.com
 

Re:Re: How to start/stop server configuration remotely?

Quote
>Why do you need to stop the server?
>If you're doing a backup, then all you need to do is lock it (this
>prevents activity on the database and is equivalent to "pause") and
>unlock it afterwards (equivalent to "resume").
Um, if you have a Native-II repository you don't need to lock or stop
the server at all. Just backup the DB server using the appropriate
tool for your server, then backup the repository once that's complete.
I'm surprised. How is it possible? I think DB and repository could not be
in sync. At least I should lock server.
Anyway I made already a NAnt custom task for locking/unlocking StarTeam server
and plan to use them in my script insteed of shutting down/starting up. NAnt
rules! Locking of the server isn't a problem for us because nobody works
till night with the server. So locking and even shutting down is pretty safe
for us and our development process.
Quote

With Native-I / Pre-ST 2005 you must stop the server, though.
Ok, I will remember it.
 

Re:Re: How to start/stop server configuration remotely?

"Mike Eshva" < XXXX@XXXXX.COM >wrote:
Quote
>>Why do you need to stop the server?
>>If you're doing a backup, then all you need to do is lock it
(this
>>prevents activity on the database and is equivalent to "pause")
and
>>unlock it afterwards (equivalent to "resume").
>Um, if you have a Native-II repository you don't need to lock or
stop
>the server at all. Just backup the DB server using the appropriate
>tool for your server, then backup the repository once that's
complete.
I'm surprised. How is it possible? I think DB and repository could
not be
in sync. At least I should lock server.
It is true - the DB and repository could get out of sync. If you back
up the DB first, this simply means the backup of the repository has
data not referenced by the DB. But, if the DB is backed up after the
repository, there may be data referenced by the DB that is missing
from the repository backup - this is a bad situation.
My tape backup software doesn't allow me to back up the DB before the
repository (in the one run), so I lock StarTeam.
Quote
Anyway I made already a NAnt custom task for locking/unlocking
StarTeam server
and plan to use them in my script insteed of shutting down/starting
up. NAnt
rules! Locking of the server isn't a problem for us because nobody
works
till night with the server. So locking and even shutting down is
pretty safe
for us and our development process.

>
>With Native-I / Pre-ST 2005 you must stop the server, though.
Ok, I will remember it.
Even in Native-I / Pre-ST 2005 days, I only locked StarTeam. And, I've
restored from those backups and successfully restarted StarTeam
processing.
--
Regards, Rob E.
 

Re:Re: How to start/stop server configuration remotely?

Rob Evans wrote:
Quote
It is true - the DB and repository could get out of sync. If you back
up the DB first, this simply means the backup of the repository has
data not referenced by the DB. But, if the DB is backed up after the
repository, there may be data referenced by the DB that is missing
from the repository backup - this is a bad situation.
Correct. Put another way, It's *OK* for the DB and the repository to
be out of sync *if* the repository contains everything the DB needs
(plus possibly more). It's OK for the repository to be "ahead" of the
DB, but not OK for the DB to be "ahead" of the repository.
However, the Native-II repository is so stable that even if the DB was
ahead of the repository the only effect you would see is errors when
you tried to access the specific file versions not in the repository.
Everything else would work fine.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better? Use QC!
qc.borland.com -- Vote for important issues
 

Re:Re: How to start/stop server configuration remotely?

Mike Eshva wrote:
Quote
I'm surprised. How is it possible? I think DB and repository could
not be in sync. At least I should lock server.
It's possible because Native-II vaults store the full file of every
version, not just a reverse delta. If you backup the repository *after*
the DB then you already have all the versions you need for the DB.
You do *not* need to lock the server *if* you have a Native-II vault.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Useful articles about InterBase development:
blogs.teamb.com/craigstuntz/category/21.aspx
 

Re:Re: How to start/stop server configuration remotely?

Rob, Craig thank you very much! Now I understand almost everything about
StarTeam backup.
 

Re:Re: How to start/stop server configuration remotely?

Thanks to Craig and Rob, we've covered nearly everything.
Since we've gone into such detail, here's a couple more useful details.
(1) It's a good idea to stage your backup. I backup the StarTeam server to
another disk, DB first, and then vault (nII) and then a separate process
controlled by our IT team copies to tape from that other disk. This keeps
my backup cycle super short, like about 10min, and keeps things nicely in
sync. If anyone checks in during the backup, it's possible I get a stray
archive, but that's a trivial risk.
(2) It's been said that you only have to stop your server for a purge, and
technically that is true. However, there are good reasons to a periodic
stop/start. I haven't bounced my StarTeam server for a very very long time,
and I noticed that when I did bounce it I lost a lot of audit history to the
startup audit purge. Now that 's totally normal, but I got spoiled having
old audit history around and kinda forgot that it would be purged next
restart. Also, it's just a good safety measure to stop/start once in a
while to make sure that the startup is smooth and error-free.
(3) I've said it a bunch of times, but it's worth repeating. Do a test
restore regularly. Best thing to do is maintain a complete test server.
This confirms that your backup is restorable and also provides a good place
to test new ideas without impacting your live repository.