1
1
#! /bin/sh
2
2
3
- PG_SHARD_DIR=~ /pg_shard
4
- PG_DIR=~ /postgresql95
3
+ PG_SHARD_DIR=~ /code/pg_shard
4
+ PG_DIR=~ /code/postgres95
5
+ # we need to move pg_dtm directory there (or better make it directory-independent)
6
+ # also apply xtm.patch
5
7
PG_XTM_DIR=$PG_DIR /contrib/pg_dtm
6
8
7
9
# #######################################################################
8
10
# Stop old stuff
9
11
# #######################################################################
12
+ cd $PG_DIR
10
13
./install/bin/pg_ctl -D ./install/data1 stop
11
14
./install/bin/pg_ctl -D ./install/data2 stop
12
15
./install/bin/pg_ctl -D ./install/data3 stop
@@ -17,12 +20,12 @@ rm -rf install
17
20
# #######################################################################
18
21
# Build and run dtm and postgres
19
22
# #######################################################################
20
- make -j 8 install # assuming configured with --prefix=./install
23
+ make -j 4 install # assuming configured with --prefix=./install
21
24
22
25
cd $PG_SHARD_DIR
23
26
make clean
24
- PATH=~ /code/postgresql /install/bin/:$PATH make
25
- PATH=~ /code/postgresql /install/bin/:$PATH make install
27
+ PATH=$PG_DIR /install/bin/:$PATH make
28
+ PATH=$PG_DIR /install/bin/:$PATH make install
26
29
27
30
cd $PG_XTM_DIR
28
31
make clean
@@ -32,6 +35,7 @@ make install
32
35
cd dtmd
33
36
make clean
34
37
make
38
+ killall dtmd
35
39
rm -rf /tmp/clog/*
36
40
./bin/dtmd &
37
41
@@ -41,9 +45,9 @@ cd $PG_DIR
41
45
./install/bin/initdb -D ./install/data2
42
46
./install/bin/initdb -D ./install/data3
43
47
44
- sed -i ' ' " s/ shared_preload_libraries =.*/shared_preload_libraries = 'pg_dtm,pg_shard'/ " ./install/data1/postgresql.conf
45
- sed -i ' ' " s/ shared_preload_libraries =.*/shared_preload_libraries = 'pg_dtm'/ " ./install/data2/postgresql.conf
46
- sed -i ' ' " s/ shared_preload_libraries =.*/shared_preload_libraries = 'pg_dtm'/ " ./install/data3/postgresql.conf
48
+ echo " shared_preload_libraries = 'pg_dtm,pg_shard'" >> ./install/data1/postgresql.conf
49
+ echo " shared_preload_libraries = 'pg_dtm'" >> ./install/data2/postgresql.conf
50
+ echo " shared_preload_libraries = 'pg_dtm'" >> ./install/data3/postgresql.conf
47
51
48
52
echo " port = 5433" >> ./install/data2/postgresql.conf
49
53
echo " port = 5434" >> ./install/data3/postgresql.conf
@@ -71,11 +75,11 @@ echo "log_statement = 'all'" >> ./install/data3/postgresql.conf
71
75
echo " 127.0.0.1 5433" > ./install/data1/pg_worker_list.conf
72
76
echo " 127.0.0.1 5434" >> ./install/data1/pg_worker_list.conf
73
77
74
- echo " 127.0.0.1 5433" > ./install/data2/pg_worker_list.conf
75
- echo " 127.0.0.1 5434" >> ./install/data2/pg_worker_list.conf
78
+ # echo "127.0.0.1 5433" > ./install/data2/pg_worker_list.conf
79
+ # echo "127.0.0.1 5434" >> ./install/data2/pg_worker_list.conf
76
80
77
- echo " 127.0.0.1 5433" > ./install/data3/pg_worker_list.conf
78
- echo " 127.0.0.1 5434" >> ./install/data3/pg_worker_list.conf
81
+ # echo "127.0.0.1 5433" > ./install/data3/pg_worker_list.conf
82
+ # echo "127.0.0.1 5434" >> ./install/data3/pg_worker_list.conf
79
83
80
84
81
85
./install/bin/createdb ` whoami`
0 commit comments