Installing NEOSYS: Difference between revisions
Line 400: | Line 400: | ||
= USING RSYNC TO BACKUP SERVERS = | = USING RSYNC TO BACKUP SERVERS = |
Revision as of 19:49, 28 October 2006
INSTALLING NEOSYS SERVICE
Main installation:
Downloading and running installation files
- http://www.neosys.com/support/accounts.exe Install to X:\Neosys
- http://www.neosys.com/support/adagency.exe Install to X:\Neosys
Creating shortcuts
Make desktop shortcut ‘Maintenance’ from X:\Neosys\Neosys\Adagency.bat
Activating NEOSYS using authorization number
Start NEOSYS Maintenance and it will give a “Computer Number” and ask for an “Authorisation No”
Send the computer number to NEOSYS admin to get the authorization no.
If you cannot get the authorization number immediately then you can close NEOSYS and when you reopen NEOSYS it will still give the same computer number and accept the same authorization number.
Installing initial Database
First time entering maintenance you will enter a command box (like NEOSYS F5)
Type FILEMAN and then restore. You will need a BACKUP.ZIP file in C:\ containing the initial database.
Creating a .CMD file to start NEOSYS Service:
In x:\neosys create a file startmain.cmd
x: cd \neosys\neosys Start neosys.js /system ADAGENCY /database databasecode /user NETSERVICE /pass NETSERVICE
(where databasecode is the code of the database)
In x:\neosys create a file starttest.cmd
x: cd \neosys\neosys Start neosys.js /system ADAGENCY /database testdatabasecode /user NETSERVICE /pass NETSERVICE
(where testdatabasecode is the code of the testdatabase)
Differences for Pure Accounts Module Only Installations
Accounts module only has a slightly different startup command. In the above, replace /system adagency with /system accounts to startup a service and use accounts.bat instead of adagency.bat to start up maintenance. Other than that, accounts module setup is identical. Pure accounts clients are very few and tend not to upgrade often so care needs to be taken when upgrading. Upgrade is perhaps surprisingly done using the adagency.exe file.
Creating a .CMD file to copy maindata to testdata
In x:\neosys create a file copymain2test.cmd
Xcopy x:\neosys\data\maindatabasecode x:\neosys\data\testdatabasecode /s /y
Setting up daily scheduled tasks
Maindata – 3 processes starting 6:00 am, 6:01 am, 6:02 am
Testdata – 1 process at 6:04 am
Copy Maindata to Testdata – 1 process at 2:45 am
For multiple sites on the same computer put the second site starting five minutes later at 6:05, third site starting five minutes earlier at 5:55, the third site starting five minutes later at 6:10 and so on.
Measuring the speed of NEOSYS
In NEOSYS maintenance press F5:
Filespeed Measures the speed at to create and delete a file with 1000x1Kb records - lower time is better
Procspeed Measures the processor speed – higher speed is better
Memspeed Measures the memory speed – higher speed is better
SSL / HTTPS:
Get SELFSSL – iis60rkt.exe from Microsoft
(deselect all options – except SSL) – Install
Start > Programs > IIS Resources > Self SSL
Type command – use standard one, but put V:9995 instead of V:7
In case the secure port 443 has to change, you need to change it here
((need sample command))
((explanation on how to handle multiple sites))
CLOSING NEOSYS SERVICES
Two automatic ways:
- NEOSYS services will automatically initiate a database integrity check, “backup” and close down at 2am by default.
To change the time of the automatic process do F5 ED DEFINITIONS
line 3 is the minimum time to start the backup and shutdown (default 7500 ie 02:00) line 4 is the maximum time to start the backup and shutdown (default 7800 ie 02:05)
both times must be in seconds past midnight
press F5 and type PRINT ICONV(’02:00’,’MTH’) to calculate this easily
- NEOSYS will automatically close down during the upgrade procedure.
Three manual ways:
Warning: NEOSYS services do not shutdown automatically on server shutdown so you need to use one of these methods before shutting down or rebooting a server.
- To close individual services, press Esc three times on a service and then ctrl+C once or twice. Repeat for each service that you want to close.
This can only be done if you can actually see the services on the screen but the services will not be visible if they were started by scheduled tasks while administrator was not logged in to the server … unless you login as /console with remote desktop.
- To close all services for one site/neosys installation, use the NEOSYS Support Menu – Stop/Restart NEOSYS
Currently this has no option to stop the services for any other neosys sites/installations on the same server
- To close all services for all sites and installations of NEOSYS under a particular folder, use NEOSYS maintenance (or any other program) to create and then delete a GLOBAL.END file in the parent folder of all the neosys installations. eg if the installations are located in x:\hosts\clientcode\neosys etc then create and delete a file called x:\hosts\GLOBAL.END
- In NEOSYS Maintenance press F5 to get a NEOSYS command prompt
- Type ED DOS ..\..\GLOBAL.END and press Enter
(use ED DOS GLOBAL.END instead if you only want to close the services of the current site)
- Press F9 to create the GLOBAL.END file
- Wait until the processes close. Should be almost immediate.
- Press alt+D twice to delete the GLOBAL.END file otherwise Neosys services will refuse to start
UPGRADING NEOSYS
Upgrading NEOSYS: important pointers
If you have the time backup the entire NEOSYS folder or
To backup just the programs copy Neosys\Neosys, Neosys.net, Neosys.mac
To backup the data copy DATA
Run http://www.neosys.com/support/adagency.exe
The installation procedure first creates a GLOBAL.END file in the NEOSYS programs folder causing all serving processes to terminate. Maintenance processes must be terminated manually.
Next, the installation procedure attempts to update the WAITING.EXE file and, if the processes haven’t terminated quickly enough, this will fail asking for retry or abort. Retry immediately or once all the processes have terminated.
The last step of the installation procedure is to delete the GLOBAL.END file to allow processes to start normally. If you choose to abort the installation for any reason then the GLOBAL.END file will have to be deleted manually since its presence prevents any processes from starting up.
DEALING WITH DAMAGED FILES
General cause, solution and recovery of damaged files
"A Damaged file has been found..... ((the rest of this message to be completed))
Group format Error:
OS File : BOOKING.TEXTS
Group# : 00000932
Record length incorrect or frame linkage error.
1. Cause: Rare but nasty problem on server caused by power failure, killing NEOSYS or server hardware or operating system failure. Did you kill NEOSYS while upgrading or something? Was there a power cut. Check the server log for reboot Event Viewer > System Log
Also note to check disk free space especially on servers not dedicated to neosys
2. Solution: Depends on the cause and usually often requires aggressive interrogation to discover the cause.
3. Recovery: It is URGENT to stop using NEOSYS and fix the damaged file because it will cause NEOSYS to crash everytime it happens to update that part of the file. NEOSYS crashing while updating often produces unrecoverable inconsistencies in the database that can only be fixed by programmers sitting for hours trying to edit the database .... or by restoring from a backup causing loss of work
Fixing damaged files that have no process for recreating them
Some damaged files can be rebuilt using NEOSYS utilities especially index files with filenames starting with !. Other damaged files can be “fixed” to prevent NEOSYS crashes as follows but some records will most probably be lost. Depending on the file loss of a few records may not be too bad compared to restoring a database but the client should be informed and make the decision. Depending on the file it is usually best to lose the records. We can make a list of files that one can afford to lose records and those files that can be rebuilt programmatically from other files. Booking order texts they can lose records but inform them and especially the numbers mentioned in FIXFILE
FIXFILE will not run if there are neosys services still running so before doing the FIXFILE command, shut down services from the Support menu or with the Global command:
F5
FIXFILE filename
(Select option 1 to update the file)
In case you get any Overwrite messages – type YES, as these are the actual files being updated.
Alternative is restore from a previous backup in this case losing a days work. Nasty, and even worse, it will be impossible to reproduce the days work and especially the exact purchase order, booking order, invoices, receipt and payment numbers.
Fixing damaged file that have a process to recreate them
ADS file can be recreated with F5 CREATEADS
ANALYSIS file can be recreated with F5 CREATEANALYSIS
Fixing damaged index files with names starting with !
Whilst backing up or using NEOSYS the following error message might appear:
"A Damaged file has been found.....
Group format Error:
OS File : !ADS
Group# : 00000932
Record length incorrect or frame linkage error.
1. Ensure that no-one is using NEOSYS
2. Log into NEOSYS on the server
3. Press F5 to get a TCL command box
4. Type REINDEXADS and press enter.
5. Wait until it finishes and you get back to the command box
6. Type OFF in the command box and you will quit NEOSYS.
Other reindex commands are:
REINDEXACCOUNTS recreates !ACCOUNTS and !BATCHES
REINDEXADDRESSES
REINDEXADS
REINDEXBOOKINGS recreates !BOOKING.ORDERS
REINDEXBRANDS
REINDEXCLIENTS
REINDEXINVS recreates !INVOICES
REINDEXJOBS
REINDEXMATERIALS
REINDEXPLANS
REINDEXPRODINVS recreates !PRODUCTION.INVOICES
REINDEXPRODORDERS recreates !PRODUCTION.ORDERS
REINDEXRATECARDS
REINDEXSCHEDULES
REINDEXSUPPLIERS
REINDEXTIMESHEETS
REINDEXVEHICLES
REINDEXMEDIA does the following
REINDEXPLANS
REINDEXSCHEDULES
REINDEXADS
REINDEXMATERIALS
REINDEXBOOKINGS
REINDEXFILES does the following
REINDEXCLIENTS
REINDEXBRANDS
REINDEXSUPPLIERS
REINDEXVEHICLES
REINDEXRATECARDS
REINDEXPRODUCTION does the following
REINDEXJOBS
REINDEXPRODORDERS
REINDEXPRODINVS
REINDEXTIMESHEETS
REINDEXALL does the following
REINDEXMEDIA
REINDEXPRODUCTION
REINDEXFILES
REINDEXINVS
REINDEXACCOUNTS
REINDEXADDRESSES
USING RSYNC TO BACKUP SERVERS
Notes
http://en.wikipedia.org/wiki/Rsync
rsync doesnt do any encryption so must be run over ssh
rsync uses port 873
rsync only copies over only the bits of the files that have changed but this is not effective for files like ZIP which are completely recreated.
Setting up rsync server
install rsync using cygwin/setup.exe
To expose /cygdrive/x/neosys folder as name "neosys" without any security so be careful that port 873 is not open
create file /etc/rsyncd.conf
[neosys]
path = /cygdrive/x/neosys
comment = location of all neosys data and programs
to start rsync manually
rsync --daemon
Setting up rsync client
Setup a target folder
md x:\hosts
md x:\hosts\clientname
install rsync using cygwin/setup.exe
Connecting Interactively
tunnel local port 873 to remote port 873 eg by using putty/ssh in the usual way or:
ssh -L 873:127.0.0.1:873 administrator@clientname.support.neosys.com -p 19580
then in a new shell
rsync -avz localhost::neosys/ /cygdrive/x/hosts/clientname --delete --ignore-errors --exclude=/proc --exclude=/cygdrive/[a-z]
(or just –az for warnings and errors only)
Connecting Automatically
(this seems to hang in some cases on cygwin)
Use rsync to issue the ssh command like this:
rsync -az –e “ssh –p 19580” administrator@clientname.support.neosys.com:neosys/ /cygdrive/x/hosts/clientname/ --delete --ignore-errors --exclude=/proc --exclude=/cygdrive/[a-z]
e.g.
rsync -avz -e "ssh -p 19580" administrator@adlined.neosys.com:/cygdrive/d/neosys/ /cygdrive/d/hosts/adlined/ --delete --ignore-errors --exclude=/proc --exclude=/cygdrive/[a-z]
Connecting without password (not best possible security)
On client as administrator
ssh-keygen –t dsa –b 1024 (generates priv/pub keys in .ssh no passphrase for autologin)
chmod 600 ~/.ssh/id_dsa (priv must not be accessible to anybody but owner)
(copy the PUBLIC key to the server)
scp -P 19580 ~/.ssh/id_dsa.pub administrator@servername.neosys.com:/home/Administrator/.ssh/
On server as administrator
cd ~/.ssh
cat id_dsa.pub >> authorized_keys (add the clients public key to the list of auth keys)
chmod 644 authorised_keys (if new then make sure auth keys accessible to other processes)
Back on Client as Administrator to test
ssh administrator@adlined.neosys.com -p 19580 should login without password now
Connecting without password (allow rsync only)
Administrator@una-srvr ~
$ mkdir /home/Administrator/rsync
Administrator@una-srvr ~
$ ssh-keygen -t dsa -b 2048 -f /home/Administrator/rsync/mirror-rsync-key
DSA keys must be 1024 bits
Administrator@una-srvr ~
$ ssh-keygen -t dsa -b 1024 -f /home/Administrator/rsync/mirror-rsync-key
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/Administrator/rsync/mirror-rsync-key
.
Your public key has been saved in /home/Administrator/rsync/mirror-rsync-key.pub
.
The key fingerprint is:
b0:a1:bc:b1:fa:7a:d7:2b:76:9d:34:20:ff:d8:ab:19 Administrator@una-srvr
ssh-keygen -t dsa -b 1024 -f /home/Administrator/rsync/mirror-rsync-key
scp -P 19580 ~/rsync/mirror-rsync-key.pub administrator@adlined.neosys.com:/home/Administrator
on ssh server
vi ~/rsync/checkrsync
- !/bin/sh
case "$SSH_ORIGINAL_COMMAND" in
*\&*) echo "Rejected" ;; *\(*) echo "Rejected" ;; *\{*) echo "Rejected" ;; *\;*) echo "Rejected" ;; *\<*) echo "Rejected" ;; *\`*) echo "Rejected" ;; rsync\ --server*) $SSH_ORIGINAL_COMMAND ;; *) echo "Rejected" ;;
esac
chmod 700 ~/rsync/checkrsync