Revision 14028
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/config/VirtualBox_VMs/vegbiendev/README.TXT | ||
---|---|---|
1 |
to test the import: |
|
2 |
# -> "to set up the VM" |
|
3 |
# restore the "booted" snapshot under "+pg_restore" |
|
4 |
# start the VM |
|
5 |
ssh -t 128.111.220.240 |
|
6 |
$0 # nested shell |
|
7 |
export version=test_import |
|
8 |
declare -ax inputs; inputs=(inputs/ARIZ/) |
|
9 |
. bin/import_all # runtime: 50 min ("0:45:07.105389"+"4:05.03") |
|
10 |
kill % # cancel after_import() |
|
11 |
|
|
12 |
to set up the VM: |
|
13 |
ln -s /Volumes/vegbiendev/vegbiendev.vdi ~/VirtualBox\ VMs/vegbiendev/vegbiendev.vdi |
|
14 |
screen |
|
15 |
# press ENTER |
|
16 |
l=1 overwrite=1 inplace=1 src=/Volumes/vegbiendev/vegbiendev.vdi dest=~/VirtualBox\ VMs/vegbiendev/vegbiendev.file.vdi put # runtime: 5 h ("4:43:16") |
|
17 |
# move vegbiendev.vdi to the internal hard drive |
|
18 |
# press Ctrl-D |
|
19 |
(cd ~/VirtualBox\ VMs/vegbiendev/; mv vegbiendev.file.vdi vegbiendev.vdi) |
|
20 |
# open VirtualBox |
|
21 |
# select the vegbiendev VM |
|
22 |
# restore the "+bootloader+VirtualBox Guest Additions+eth1" snapshot |
|
23 |
# open Settings > System tab |
|
24 |
# in the Motherboard subtab, set Base Memory to 2048 MB |
|
25 |
# in the Processor subtab, set Processor(s) to 1 |
|
26 |
# boot the VM |
|
27 |
# when asked whether to skip mounting, press S |
|
28 |
ssh -t 128.111.220.240 |
|
29 |
rm inputs/GBIF/_MySQL/GBIFPortalDB-2013-02-20.data.sql |
|
30 |
sed --in-place -r 's/^(shared_buffers = )\S+/\11000MB/' schemas/postgresql.conf |
|
31 |
# = <1 GB; decrease to match VM's allocated memory (2 GB) |
|
32 |
sudo mkdir -p /var/lib/postgresql/9.3/main/ |
|
33 |
sudo chown postgres:postgres /var/lib/postgresql/9.3/main/ |
|
34 |
sudo -E -u postgres /usr/lib/postgresql/9.3/bin/initdb -D /var/lib/postgresql/9.3/main/ |
|
35 |
sudo ln -sf /etc/postgresql/9.3/main/*.conf /var/lib/postgresql/9.3/main/ |
|
36 |
make postgres_reload |
|
37 |
# at "Modifying postgresql.conf and pg_hba.conf", type y and press ENTER |
|
38 |
# at "kernel.shmmax ... Press ENTER to continue", press ENTER |
|
39 |
# at "restart PostgreSQL manually ... Press ENTER to continue": |
|
40 |
# open a new window |
|
41 |
ssh -t 128.111.220.240 |
|
42 |
# run what it says |
|
43 |
# press Ctrl-D |
|
44 |
# return to the previous window |
|
45 |
# press ENTER |
|
46 |
* to use a database backup: |
|
47 |
# { |
|
48 |
make mk_db # restore users, which are not part of the backup |
|
49 |
screen |
|
50 |
# press ENTER |
|
51 |
l=1 src='starscream.nceas.ucsb.edu:~/bien/' dest=. put backups/vegbien.r12025.backup # runtime: 25 min ("0:25:24") |
|
52 |
# press Ctrl-D |
|
53 |
sudo chgrp postgres backups/vegbien.r12025.backup |
|
54 |
sudo halt |
|
55 |
# at "System halted", close the VM and *uncheck* Restore current snapshot |
|
56 |
# create a VM snapshot named "+initdb+database backup" |
|
57 |
# boot the VM |
|
58 |
# when asked whether to skip mounting, press S |
|
59 |
ssh -t 128.111.220.240 |
|
60 |
screen |
|
61 |
# press ENTER |
|
62 |
time for schema in temp util py_util geoscrub herbaria IRMNG IUCN NCBI newWorld TNRS ARIZ; do |
|
63 |
bin/psql_verbose_vegbien <<<"CREATE SCHEMA \"$schema\";" |
|
64 |
"time" sudo -E -u postgres pg_restore --exit-on-error --verbose --dbname=vegbien --schema="$schema" backups/vegbien.r12025.backup |
|
65 |
# need to run as DB superuser to restore py_util |
|
66 |
done # runtime: 15 min ("11:44:05" - ~11:30) |
|
67 |
# must use for loop because pg_restore doesn't support multiple --schema |
|
68 |
# options (it just uses the last one) |
|
69 |
# (http://postgresql.1045698.n5.nabble.com/pg-restore-should-accept-multiple-t-switches-td2399138.html) |
|
70 |
# press Ctrl-D |
|
71 |
sudo halt |
|
72 |
# at "System halted", close the VM and *uncheck* Restore current snapshot |
|
73 |
# create a VM snapshot named "+pg_restore" |
|
74 |
# boot the VM |
|
75 |
# when asked whether to skip mounting, press S |
|
76 |
# create a VM snapshot named "booted" |
|
77 |
# close the VM and *check* Restore current snapshot |
|
78 |
# } |
|
79 |
* to use a clean database: |
|
80 |
# { |
|
81 |
(cd inputs/; for dir in IRMNG IUCN newWorld; do mv "$dir" ."$dir"; done) |
|
82 |
(cd inputs/; for dir in */; do dir="${dir%/}"; case "$dir" in analytical_db|ARIZ) : ;; *) mv "$dir" .archive/"$dir";; esac; done) |
|
83 |
make misc-Linux db inputs/install schemas/public/reinstall # runtime: 15 min ("15:11:16".."15:26:28") @starscream.vegbiendev |
|
84 |
# at "This will delete the current public schema of your VegBIEN DB", type y and press ENTER |
|
85 |
# } |
|
86 |
|
|
87 |
to install system updates: |
|
88 |
# boot the VM |
|
89 |
# when asked whether to skip mounting, press S |
|
90 |
sudo apt-get update |
|
91 |
sudo apt-get dist-upgrade |
|
92 |
sudo reboot # some system updates require system restart |
|
93 |
# when asked whether to skip mounting, press S |
|
94 |
sudo halt |
|
95 |
# at "System halted", close the VM and *uncheck* Restore current snapshot |
|
96 |
# create a VM snapshot named "+system updates" |
|
97 |
# boot the VM |
|
98 |
# when asked whether to skip mounting, press S |
|
99 |
# create a VM snapshot named "booted" |
|
100 |
|
|
101 |
to enable VM to access VirtualBox shared folders: |
|
102 |
(currently doesn't work, likely because of a bug in VirtualBox Guest Additions when installed on something other than a clean Linux install) |
|
103 |
sudo sed --in-place -r 's/^vboxsf:.*:$/&aaronmk/' /etc/group |
|
104 |
# press Ctrl-D |
|
105 |
ssh -t 128.111.220.240 |
Also available in: Unified diff
fix: config/VirtualBox_VMs/vegbiendev/README.TXT: to install system updates: added step to restart, because some system updates require this