Le blog de Jean David TECHER, un Réunionnais à Saint-Priest/Lyon

Aller au contenu | Aller au menu | Aller à la recherche


< 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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 >

vendredi 2 décembre 2011

Building Slony branch 2.1 with EnterpriseDB 8.4 Advanced Server

Since Slony 2.0.4 is the version bundled/supported by EnterpriseDB Advanced Server 8.4, here are the required steps to build againts Slony >= 2.1.0, without deleting Slony 2.0.4 binaries.
  • Install the prerequisites
    sudo apt-get install perl build-essential bison flex autoconf
  • Create a temporary symbolic link to libdir.
    sudo mkdir -pv /opt/slony/2.1.0
    sudo ln -s /opt/PostgresPlus/8.4AS/lib /opt/slony/2.1.0/lib
    
  • Download Slony's sources
    cd /tmp/
    wget -q "http://git.postgresql.org/gitweb/?p=slony1-engine.git;a=snapshot;h=0a9346436b0369b887945219bd43b611fd79c6ca;sf=tgz" -O - | tar xzf -
    cd slony1-engine-0a93464/
  • Configure, compile
    ./configure \
    --prefix=/opt/slony/2.1.0 \
    --with-pgconfigdir=/opt/PostgresPlus/8.4AS/bin/ \
    --with-perlsharedir=/opt/slony/2.1.0/lib \
    --with-pgsharedir=/opt/slony/2.1.0/share \
    --with-perltools=/opt/slony/2.1.0/scripts \
    --with-pglibdir=/opt/slony/2.1.0/lib \
    --with-pgpkglibdir=/opt/slony/2.1.0/lib
    
    grep -lriE '\$libdir' . | while read file;do sed -i 's:\$libdir:/opt/slony/2.1.0/lib:g' $file;done
    
    make
    
  • Delete the symbolic link and install
    sudo rm -rf /opt/slony/
    sudo make install
    

Slony 1.2: Documentation in PDF format available

The PDF is available

Get PDF

ModeURL
Online http://www.davidgis.fr/download/slony-1.2.22.pdf
Zip format http://www.davidgis.fr/download/slony-1.2.22.pdf.zip

Building PDF from source

You need to have dblatex installed (version 0.2.12-4 or above)
./configure  --with-pgconfigdir=/opt/PostgresPlus/8.3R2AS/dbserver/bin/ --with-docs=yes

make -C doc

cd doc/adminguide/

make slony.xml

sed -i "s:<article:<chapter:g;s:</article:</chapter:g" slony.xml

dblatex -t tex -o slony-tmp.tex slony.xml

grep -vE '^(\\end{document}|\\subsection\*)$$' slony-tmp.tex > slony.tex

echo "\end{document}" >>  slony.tex

pdflatex slony.tex 
pdflatex slony.tex 
pdflatex slony.tex 

lundi 28 novembre 2011

Slony 1.2: Using EnterpriseDB Advanced Server 8.3.0.112 with Slony 1.2.23 instead of Slony 1.2.11

It is possible to build Slony 1.2.23 against EnterpriseDB but the use of slonik will fail. The patch has been done put on branch Slony 2.X not in Slony 1.2.X. Here we will see how to compile Slony 1.2.23 against EnterpriseDB 8.3.0.112.

1. Binaries: Download / Installation

VersionDownload
Linux 32 Bitshttp://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86.tar.bz2'
Linux 64 Bitshttp://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86-64.tar.bz2'
    IMPORTANT: KEEP IN MIND THAT MY GOAL IS NOT TO REPLACE THE SLONY'S BINARIES 1.2.11 BUNDLED WITH ENTERPRISEDB 8.3.0.112. SINCE ENTERPRISEDB IS NOT RESPONSIBLE/ DOES NOT SUPPORT FOR THE USE OF SLONY 1.2.23, I'VE DECIDED TO CHOICE A "HARDCODED" PATH FOR SLONY 1.2.23: /opt/slony/1.2.23. IT IMPLIES THAT SLONY'S BINARIES 1.2.11 WILL NOT BE REPLACED :)
  • Download the required file
    # 32 Bits
    wget -q http://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86.tar.bz2
    # 64 bits
    wget -q http://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86-64.tar.bz2
  • (As root), decompress to '/'
    # 32 Bits
    tar xjf EDB830112_Slony-1.2.23_linux-x86.tar.bz2 -C /
    # 64 bits
    tar xjf http://www.davidgis.fr/download/EDB830112_Slony-1.2.23_linux-x86-64.tar.bz2 -C /
slonik and slon are located to /opt/slony/1.2.23/bin. The required libraries are located to /opt/slony/1.2.23/lib

How to compile yourself

  1. As root, be sure to have all the prerequisites
    apt-get install build-essential perl bison flex
  2. As root, we are going to create a (temporary) symbolic link
    mkdir -pv /opt/slony-1.2.23
    ln -s /opt/PostgresPlus/8.3R2AS/dbserver/lib /opt/slony-1.2.23/lib
  3. As enterprisedb, download the last Slony's sources from branch 1.2
    wget "http://git.postgresql.org/gitweb/?p=slony1-engine.git;a=snapshot;h=af01af7786f0f4f6c5c5ea991200be04a431f586;sf=tgz" -O - | tar xvzf -
    cd slony1-engine-af01af7/
  4. As enterprisedb, apply the patch to build SLony against EnterpriseDB 8.3.0.112
    cd ~/slony1-engine-af01af7/
    wget http://www.davidgis.fr/download/patch_EnterpriseDB.patch  -O - | patch -p1
    Notice: the required patch could be found at Slony's Git Repository (http://git.postgresql.org/gitweb/?p=slony1-engine.git;a=commit;h=32728b33d460d650445b89281d134e33958fde34 It has been submitted by Mark Mielke (http://lists.slony.info/pipermail/slony1-general/2011-May/011681.html)
  5. As enterprisedb, configure Slony
    ./configure \
    --prefix=/opt/slony-1.2.23 \
    --with-pgconfigdir=/opt/PostgresPlus/8.3R2AS/dbserver/bin/ \
    --with-perlsharedir=/opt/slony-1.2.23/lib \
    --with-pgsharedir=/opt/slony-1.2.23/share \
    --with-perltools=/opt/slony-1.2.23/scripts \
    --with-pglibdir=/opt/slony-1.2.23/lib \
    --with-pgpkglibdir=/opt/slony-1.2.23/lib
    Replace now '$libdir' by the harcoded path '/opt/slony-1.2.23/lib'
    grep -lriE '\$libdir' . | while read file;do sed -i 's:\$libdir:/opt/slony-1.2.23/lib:g' $file;done
    Compile
    make
  6. As root, delete the symbolic link
    rm -rf /opt/slony-1.2.23
    Install Slony
    cd ~enterprisedb/slony1-engine-af01af7
    make install
    Put the required rights on '/opt/slony', something like
    chmod 777 -R /opt/slony

dimanche 27 novembre 2011

Création d'un domU PVOPS Ubuntu Hardy 8.04 64 bits sous Xen 4.2 unstable / Kernel 3.1.0

Voici mes différentes notes à ce sujet. L'installation se fait à partir des xen-tools

1. Xen-tools: Fichier de configuration

Remarque: contrairement à Ubuntu Lucid, il n'est pas nécessaire d'utiliser pygrub
root@mercury:~# cat /etc/xen-tools/templates/xen-tools-Ubuntu-hardy.conf
lvm = xenvg
install-method = debootstrap
size   = 20Gb      # Disk image size.
memory = 1024    # Memory size
swap   = 2048Mb    # Swap size
fs     = ext3     # use the EXT3 filesystem for the disk image.
dist   = hardy     # Default distribution to install.
image  = sparse   # Specify sparse vs. full disk images.
gateway   = 192.168.2.253
netmask   = 255.255.255.0
broadcast = 192.168.2.255
passwd = 1
accounts = 0
kernel      = /boot/vmlinuz-`uname -r`
initrd      = /boot/initrd.img-`uname -r`
#arch = i386
arch  = amd64
mirror = http://fr.archive.ubuntu.com/ubuntu
ext3_options   = noatime,nodiratime,errors=remount-ro
ext2_options   = noatime,nodiratime,errors=remount-ro
xfs_options    = defaults
reiser_options = defaults
serial_device = hvc0
disk_device = xvda
output    = /etc/xen/machines
extension = .cfg
role=udev

Création de la machine

Par l'invocation de la commande xen-create-image
root@mercury:~# xen-create-image --force --hostname=mercury-xen06  --ip=192.168.2.231   --config=/etc/xen-tools/templates/xen-tools-Ubuntu-hardy.conf

General Information
--------------------
Hostname       :  mercury-xen06
Distribution   :  hardy
Mirror         :  http://fr.archive.ubuntu.com/ubuntu
Partitions     :  swap            2048Mb (swap)
                  /               20Gb  (ext3)
Image type     :  full
Memory size    :  1024b
Kernel path    :  /boot/vmlinuz-3.1.0
Initrd path    :  /boot/initrd.img-3.1.0

Networking Information
----------------------
IP Address 1   : 192.168.2.231 [MAC: 00:16:3E:BF:B6:67]
Netmask        : 255.255.255.0
Broadcast      : 192.168.2.255
Gateway        : 192.168.2.253


Creating swap on /dev/xenvg/mercury-xen06-swap
Done

Creating ext3 filesystem on /dev/xenvg/mercury-xen06-disk
Done
Installation method: debootstrap
Done

Running hooks
Done

Role: udev
	File: /etc/xen-tools/role.d/udev
Role script completed.

Creating Xen configuration file
Done
Setting up root password
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
All done


Logfile produced at:
	 /var/log/xen-tools/mercury-xen06.log

Installation Summary
---------------------
Hostname        :  mercury-xen06
Distribution    :  hardy
IP-Address(es)  :  192.168.2.231 
RSA Fingerprint :  a1:07:37:a1:b7:1f:2c:2c:95:8c:a2:60:68:98:8e:04
Root Password   :  N/A