
Stargate Developer’s Guide
Wireless Sensor Networks
Doc. # 7430-0317-13 Rev. B
Page 21
The first step is to make sure you have PostgreSQL installed and running on the Linux host.
The next step is to take a ‘snapshot’ of the Stargate database and copy it to the Linux host as
follows:
Open a command console on the Stargate –
$ cd /mnt/cf1
$ pg_dump -U tele -C -F t -f taskdb.sql.tar task
$ scp taskdb.sql.tar root@<Linux IP address>:/tmp
The Stargate database snapshot is contained in a file named taskdb.sql.tar located in the /tmp folder.
The next step is to import this snapshot into the Linux host PostgreSQL database as follows:
Open a command console on the Linux host –
$ createuser tele –d –A -U postgres
$ pg_dump -U tele -C -F t -f taskdb.sql.tar task
$ pg_restore -C -U tele -O -d template1 taskdb.sql.tar
The result is the Stargate and the Linux host have the same task database.
The last step is to run a script on the Linux host that will periodically import the new database
records from the /tmp/*.txt files uploaded via ftp by the Stargate. Copy the <CDROM>\8160-0025-
14_A\config\insert-pgsql.sh script file into the /etc/init.d folder on the Linux host. Edit this file and
make sure the PSQL and TABLE symbols are set appropriately. The TABLE symbol needs to match
the TABLE symbol used in the do-file-xfer.sh script running on the Stargate.
To start the Linux host end of the database replication, open a command console on the Linux host
and execute the following:
$ cd /etc/init.d
$ ./insert-pgsql.sh
COPY
INSERT 0 2
This script will check for .txt files uploaded into the /tmp folder every 2 hours (default) and insert
the records into the local PostgreSQL database. When new records have been inserted you will see
output similar to that at the console prompt above.
You can now connect MOTE-VIEW to the Linux host database replica and you should see record
updated every 2 hours.
3.2.6
Apache Web Server
Another option for hosting applications on the Stargate is using the Apache web server. The Apache
web server allows for remote web based client connections using a web browser such as Internet
Explorer or Netscape.
A version of the Apache web server is located on the Stargate support CDROM.
To install the Apache web server on the Stargate perform the following steps.
1.
Copy the <CDROM>\8160-0025-14_A\apps\share\apache\apache.tgz archive into the / folder on
the Stargate. Follow the instructions in the <CDROM>\8160-0025-
14_A\apps\share\apache\README.txt file for the basic installation but
stop
after the
/etc/apache/setup command step.
2.
Make the following Stargate specific fixes:
Open a command console on the Stargate –
Содержание Stargate
Страница 1: ...Stargate Developer s Guide Rev B January 2006 Document 7430 0317 13 ...
Страница 50: ......
Страница 51: ......