Skip to content

Commit c459061

Browse files
committed
get install_pg_shard_xtm.sh back lo life
1 parent 8cc8695 commit c459061

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

install_pg_shard_xtm.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
#!/bin/sh
22

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
57
PG_XTM_DIR=$PG_DIR/contrib/pg_dtm
68

79
########################################################################
810
# Stop old stuff
911
########################################################################
12+
cd $PG_DIR
1013
./install/bin/pg_ctl -D ./install/data1 stop
1114
./install/bin/pg_ctl -D ./install/data2 stop
1215
./install/bin/pg_ctl -D ./install/data3 stop
@@ -17,12 +20,12 @@ rm -rf install
1720
########################################################################
1821
# Build and run dtm and postgres
1922
########################################################################
20-
make -j 8 install # assuming configured with --prefix=./install
23+
make -j 4 install # assuming configured with --prefix=./install
2124

2225
cd $PG_SHARD_DIR
2326
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
2629

2730
cd $PG_XTM_DIR
2831
make clean
@@ -32,6 +35,7 @@ make install
3235
cd dtmd
3336
make clean
3437
make
38+
killall dtmd
3539
rm -rf /tmp/clog/*
3640
./bin/dtmd &
3741

@@ -41,9 +45,9 @@ cd $PG_DIR
4145
./install/bin/initdb -D ./install/data2
4246
./install/bin/initdb -D ./install/data3
4347

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
4751

4852
echo "port = 5433" >> ./install/data2/postgresql.conf
4953
echo "port = 5434" >> ./install/data3/postgresql.conf
@@ -71,11 +75,11 @@ echo "log_statement = 'all'" >> ./install/data3/postgresql.conf
7175
echo "127.0.0.1 5433" > ./install/data1/pg_worker_list.conf
7276
echo "127.0.0.1 5434" >> ./install/data1/pg_worker_list.conf
7377

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
7680

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
7983

8084

8185
./install/bin/createdb `whoami`

0 commit comments

Comments
 (0)