-
Notifications
You must be signed in to change notification settings - Fork 2
/
setupec2.txt
84 lines (63 loc) · 3.79 KB
/
setupec2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
step 1.
launch instance with ubuntu
free tier. standard settings except:
add http in security group. and https.
might be convenient: postgres access as well (tunnel?)
key: import id_rsa.pub from .ssh/
...eeek. should be id_rsa?
step 2.
create elastic IP (network and security, left)
allocate new address
action -> associate adress. pick instance
======== instance should now be running happily ===========
step 3.
ssh to ubuntu@<elastic dns>
install required packages
sudo apt-get install git authbind make postgresql openjdk-7-jdk
#ubuntu workaround
sudo su
export LANGUAGE="en_US.UTF-8"
echo 'LANGUAGE="en_US.UTF-8"' >> /etc/default/locale
echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale
(unsudo)
sudo pg_createcluster 9.3 main --start
step 4. edit psql settings. end of /etc/postgresql/9.3/main/pg_hba.conf should be
=============================================
# Database administrative login by Unix domain socket
local all postgres trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
===============================================
then restart:
sudo /etc/init.d/postgresql restart
step 5.
upload backup.tar.gz to instance with scp
scp backup.tar.gz [email protected]:/home/ubuntu
then: tar xzf backup.tar.gz
step 5.
restore database
psql --user postgres -f db.txt template1
step 6.
start server
sudo make restart
step 7.
update dns record to point to elastic dns
step 8.
restore keys in in .ssh/authorized_keys there should be
===========================
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2SmMrrtt9j8CT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eATQ== tobey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9+nHXy6Nt9Tc+2yyard9Ehcun2D01UE5RQlm7GJmZWkxXZKPkF205K6YecgHNRVIArkHx3hXNlfoSUSOtFIuO8N8q4Ae6EK1UzNQfkDtglYvLKQ64I8me/sf64RHjEDdGVNWQkd7um+DlN2MaPt540bMIfLDvcieBgpU3mfL1k8kCmxKhjlGGtQC+t4ahP33JXNFkFjviy1rabj46pCQWOzHbjYImwf8f7N0XmS0qy0UZYm7NdUTzTMb6IIXF9Fw+R2g6KCDXVVTMG7znXwlRupbMHFP32fOgHplTqY2pfO/eLWCB0G2d7L/yCZ/QA7I3bXODzruufqPWPoZAVARV [email protected]
===========================