Amazon Cloud Installation - PatientOS

assistantashamedData Management

Nov 29, 2012 (4 years and 8 months ago)

326 views



PatientOS



PatientOS

Amazon Cloud Installation

Technical Guide




Version

0.8
6




Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
1

of
15



Revision History

Date

Version

Description

Author

0
8
/
27
/2008

0.82

Software Installation

of PatientOS v
0.
86

Greg Caulton
















































Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
2

of
15



Contents

1.

OVERVIEW
................................
................................
................................
................................
................................
........

3

1.1

P
ROCESS

................................
................................
................................
................................
................................
........

3

1.2

D
EFINITIONS

................................
................................
................................
................................
................................
.

3

2.

AMAZON CLOUD

................................
................................
................................
................................
.............................

4

2.1

E
NVIRONMENT

................................
................................
................................
................................
..............................

4

2.2

S
TART AN INSTANCE OF
U
BUNTU

................................
................................
................................
................................
.

4

2.3

C
ONNECT TO INSTANCE

................................
................................
................................
................................
................

5

3.

SOFTWARE INSTALLATIO
N

................................
................................
................................
................................
........

6

3.1

P
ATIENT
OS

D
OWNLOAD
................................
................................
................................
................................
...............

6

3.2

P
ATIENT
OS

I
NSTALLATION

................................
................................
................................
................................
..........

7

3.3

P
OSTGRE
SQL

I
NSTALLATION

................................
................................
................................
................................
.......

7

DATABASE INSTALLATIO
N

................................
................................
................................
................................
.................

8

3.4

I
NITIAL
C
LUSTER


C
REAT
E
D
ATABASE

................................
................................
................................
.......................

8

C
REATE
D
ATABASE
L
OGIN

................................
................................
................................
................................
.......................

9

4.

START APPLICATION

................................
................................
................................
................................
..................

11

4.1

A
PPLICATION
S
ERVER
................................
................................
................................
................................
.................

11

4.2

NX

C
LIENT

................................
................................
................................
................................
................................
.

12

4.3

S
TART
C
LIENT
................................
................................
................................
................................
.............................

13

4.4

P
ATIENT
OS

ON THE
A
MAZON
C
LOUD

................................
................................
................................
........................

14


Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
3

of
15


Amazon Cloud Installation

Technical Guide

1.

Overview

1.1

Process


The basic steps to installing PatientOS
on the Amazon cloud are a
s follows


a)

Backend System

a.

Install the PatientOS software.

b.

C
reate a PostgreSQL database

c.

Import the PatientOS database contents.

d.

Start the PatientOS application server.

e.

Start the PatientOS client.


1.2

Definitions


POS

Refers to the PatientOS software as a syst
em.

Java

Programming language developed by
Sun

PostgreSQL

An Open Source (free) database server, an alternative Oracle, SQLServer, etc.

Application Server

The ‘backend’

䨲䕅⁳grv敲 w桩捨⁣li敮e猠s潮湥nt⁴漮

Cli敮t

T桥⁲i捨c(fat) 捬i敮t⁧r慰aic⁵獥r int敲fa捥
drI)⁷it栠w桩捨ct桥⁵獥r猠snter慣t.






























Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
4

of
15


2.

Amazon Cloud


Follow the Amazon specific instructions to setup an account and get the command line tools needed to create our Lin
ux
server.


http://docs.amazonwebservices.com/AWSEC2/2008
-
05
-
05/GettingStartedGuide/


2.1

Environment


Here are the commands I used to setup my environment




2.2

Start an
instance of Ubuntu


This command starts a medium size instance with an Ubuntu Hardy 8.0.4 32 bit desktop install



ec2
-
run
-
instances ami
-
f39e7a9a
-
t c1.medium
-
k gsg
-
keypair



The command output returns the instance number which we will use to control the

system.




Wait a minute before continuing.
Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
5

of
15



2.3

Connect to instance


The first command shows the instance information, the other commands ensure you can connect to the server.


Allow a few minutes for the instance to start. Once you describe the instances
and can see the DNS address
(xxxx.amazonaws.com) you are ready to continue.



ec2
-
describe
-
instances


ec2
-
authorize default
-
p 22

ec2
-
authorize default
-
p 80

ec2
-
authorize default
-
p 443



Repeat the ec2
-
describe
-
instances command until ‘pending’ changes
to a DNS name in the format

ec2
-
nn
-
nnn
-
nn
-
255.compute
-
1.amazonaws.com




Now use SSH
(
or
Putty on Windows

using the Connection

SSH

Auth


Private key for authentication
)
to connect to the
server. You must use your secure key (configuration is specific to

your SSH installation).



ssh
ec2
-
67
-
202
-
48
-
202.compute
-
1.amazonaws.com





Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
6

of
15


3.

Software Installation

3.1

PatientOS
Download


Download the software



cd /usr/local

wget http://downloads.sourceforge.net/patientos/patientos
-
0
86
-
setup.tar.gz





Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
7

of
15


3.2

PatientOS Install
ation

3.2.1

Unzip


Unzip the file and expand the archive in your chosen directory. A single subdirectory patientos will be created from your
current directory.



gzip
-
d
patientos
-
0
86
-
setup.tar.gz

tar
-
xf
patientos
-
0
86
-
setup.tar





3.3

PostgreSQL
Installation

3.3.1

Software

PostgreSQL is
not included in the Amazon Hardy install. Execute the following command as root

(press Y when prompted).



sudo aptitude inst
all postgresql



Edit the postgresql.conf file and ensure that listen_addresses does not have a # comment symbol in the line, it should read



vi
/etc/postgresql/8.3/main/postgresql.conf


vi commands:

/listen

(
and enter
to search for
the word
listen)

0

(be
ginning of line)

x

(delete the #)


listen_addresses = '*'


:wq

(
saves the change)



Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
8

of
15


Database Installation


3.4

Initial Cluster


Create Database


Before the PatientOS can start properly a database is needed with a username and password the application server
can
connect to. There also needs to be PatientOS specific contents in the database.



mkdir
-
p /usr/local/pgsql/data

cho
wn
-
R postgres /usr/local/pgsql

su
-

postgres


/
usr/lib/postgresql/8.3/bin/initdb
-
D /usr/local/pgsql/data

exit

/etc/init.d/postgresq
l
-
8.3 start

su
-

postgres

createdb
-
E UTF8 demopos


Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
9

of
15


Create Database Login


Create the demopos user and grant privileges for the demopos database



createuser
-
P demopos



Enter the password demopos twice and then enter
y to be a super user
.



Grant pri
vileges for the demopos database



psql
-
t template1

grant all on database demopos to demopos;

\
q




Edit

pg_hba.conf
and
add
line
s

for demopos to
grant access to connect to the database on localhost


vi
/etc/postgresql/8.3/main/pg_hba.conf


local all

all
password

host all all 127.0.0.1/32
password

host all all ::1/128
password


password is needed so that the user can login without being the same operating
system user name


Any changes to pg_hba.conf and you must restart the server (logged in as root)




exit

/etc/init.d/postgresql
-
8.3

stop

/etc/init.d/postgresql
-
8.3

start


Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
10

of
15



3.4.1

Import PatientOS Database Contents


Execute the psql command to load the
DEMO
data
base.sql file.



psql
-
U demopos demopos <

/usr/local/patientos
/0
86
/server/database/database.sql



Many
COMMENT,
CREATE and ALTER commands will scroll by. There will be a couple of

“role does not exist”

er
rors
near the end of the output that can be ignor
ed.


Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
11

of
15


4.

Start Application

4.1

Application Server


The application server can now be started.

The following command will run the server in the background until stopped.


Create a user patientos and assign ownership to the file




useradd patientos

mkdir /home/p
atientos

chown patientos /home/patientos

chown
-
R patientos /usr/local/patientos/
0
86

passwd patientos

(assign a password for the login)




su
-

patientos

cd /usr/local/patientos/
0
86
/server/appserver/bin

nohup ./appserver.sh
> appserver.log 2>&1
&



Monitor the log file



tail
-
f
appserver
.
log



Wait until the following output is seen (
scheduler issue to be resolved)






Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
12

of
15


4.2

NX
Client


Download the

NX Client for windows (or linux depending on where you want to login from)


http://www.nomachine.com/download.php


Run the installer and create a new connection with the IP Address for Amazon




Log
in with user name


patientos


and the password you assigned earlier


You should now be able to access the Ubuntu desktop.




Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
13

of
15



4.3

Start Client


4.3.1

Open terminal program




4.3.2

Run the command



cd /usr/local/patientos/
0
86
/client/bin

./patientos.sh



and login as de
mo/demo


Amazon Cloud Installation

Last printed
3/16/2013 5:27:00 AM

Technical Guide

Version
0.85




Page
14

of
15



4.4

PatientOS on the Amazon Cloud


Now you have PatientOS with good performance ASP style on the Amazon Cloud