From 0884acbcab07367474fde56c41189e2203224054 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 24 Nov 2008 11:59:37 +0000 Subject: Move FAQ_AIX information to installation instructions. The information on why the shared libraries are built the way they are was not relevant to end users and has been made a mailing list archive link in Makefile.shlib. --- doc/src/sgml/installation.sgml | 298 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 297 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 7c86d2521fb..c87bd3a4771 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1,4 +1,4 @@ - + <![%standalone-include[<productname>PostgreSQL</>]]> @@ -2041,6 +2041,302 @@ kill `cat /usr/local/pgsql/data/postmaster.pid` installation issues. </para> + <sect2 id="installation-notes-aix"> + <title>AIX + + + AIX + installation on + + + + PostgreSQL on AIX works, but getting it installed properly can be + challenging. Both AIX version 4.3 and 5.3 are supported in + theory. You can use GCC or the native IBM compiler xlc. In + general, using recent versions of AIX and PostgreSQL helps. Check + the build farm for up to date information about which versions of + AIX are known to work. + + + + Use the following configure flags in addition + to your own if you have Readline or libz + there: --with-includes=/usr/local/include + --with-libraries=/usr/local/lib. + + + + If you don't have a PowerPC or use GCC you might see rounding + differences in the geometry regression test. There will probably + be warnings about 0.0/0.0 division and duplicate symbols which you + can safely ignore. + + + + Some of the AIX tools may be a little different + from what you may be accustomed to on other platforms. If you are + looking for a version of ldd, useful for + determining what object code depends on what libraries, the + following URLs may help you: + , + . + + + + AIX 4.3.2 + + + On AIX 4.3.2, you need libm.a that is in the + fileset bos.adt.libm. Try the following command: + +$ lslpp -l bos.adt.libm + + + + + + GCC issues + + + On AIX 5.3, there have been some problems getting PostgreSQL to + compile and run using GCC. + + + + You will want to use a version of GCC subsequent to 3.3.2, + particularly if you use a prepackaged version. We had good + success with 4.0.1. Problems with earlier versions seem to have + more to do with the way IBM packaged GCC than with actual issues + with GCC, so that if you compile GCC yourself, you might well + have success with an earlier version of GCC. + + + + + Unix-domain sockets broken + + + AIX 5.3 has a problem + where sockadr_storage is not defined to + be large enough. In version 5.3, IBM increased the size of + sockaddr_un, the address structure for + Unix-domain sockets, but did not correspondingly increase the + size of sockadr_storage. The result of + this is that attempts to use Unix-domain sockets with PostgreSQL + lead to libpq overflowing the data structure. TCP/IP connections + work OK, but not Unix-domain sockets, which prevents the + regression tests from working. + + + + The problem was reported to IBM, and is recorded as bug report + PMR29657. If you upgrade to maintenance level 5300-03, that will + include this fix. Use the command oslevel -r + to determine what maintenance level you are at. An immediate + resolution is to alter _SS_MAXSIZE to = 1025 in + /usr/include/sys/socket.h. + + + + + Memory Management + + + + AIX can be somewhat peculiar with regards to the way it does + memory management. You can have a server with many multiples of + gigabytes of RAM free, but still get out of memory or address + space errors when running applications. One example + is createlang failing with unusual errors. + For example, running as the owner of the PostgreSQL installation: + +-bash-3.00$ createlang plpgsql template1 +createlang: language installation failed: ERROR: could not load library "/opt/dbs/pgsql748/lib/plpgsql.so": A memory address is not in the address space for the process. + + Running as a non-owner in the group posessing the PostgreSQL + installation: + +-bash-3.00$ createlang plpgsql template1 +createlang: language installation failed: ERROR: could not load library "/opt/dbs/pgsql748/lib/plpgsql.so": Bad address + + Another example is out of memory errors in the PostgreSQL server + logs, with every memory allocation near or greater than 256 MB + failing. + + + + The overall cause of all these problems is the default bittedness + and memory model used by the server process. By default, all + binaries built on AIX are 32-bit. This does not depend upon + hardware type or kernel in use. These 32-bit processes are + limited to 4 GB of memory laid out in 256 MB segments using one + of a few models. The default allows for less than 256 MB in the + heap as it shares a single segment with the stack. + + + + In the case of the createlang example, above, + check your umask and the permissions of the binaries in your + PostgreSQL installation. The binaries involved in that example + were 32-bit and installed as mode 750 instead of 755. Due to the + permissions being set in this fashion, only the owner or a member + of the possessing group can load the library. Since it isn't + world-readable, the loader places the object into the process' + heap instead of the shared library segments where it would + otherwise be placed. + + + + The ideal solution for this is to use a 64-bit + build of PostgreSQL, but that is not always practical, because + systems with 32-bit processors can build, but not run, 64-bit + binaries. + + + + If a 32-bit binary is desired, set LDR_CNTRL to + MAXDATA=0xn0000000, + where 1 <= n <= 8, before starting the PostgreSQL server, + and try different values and postgresql.conf + settings to find a configuration that works satisfactorily. This + use of LDR_CNTRL tells AIX that you want the + server to have MAXDATA bytes set aside for the + heap, allocated in 256 MB segments. When you find a workable + configuration, + ldedit can be used to modify the binaries so + that they default to using the desired heap size. PostgreSQL can + also be rebuilt, passing configure + LDFLAGS="-Wl,-bmaxdata:0xn0000000" + to achieve the same effect. + + + + For a 64-bit build, set OBJECT_MODE to 64 and + pass CC="gcc -maix64" + and LDFLAGS="-Wl,-bbigtoc" + to configure. (Options for + xlc might differ.) If you omit the export of + OBJECT_MODE, your build may fail with linker errors. When + OBJECT_MODE is set, it tells AIX's build utilities + such as ar, as, and ld what + type of objects to default to handling. + + + + By default, overcommit of paging space can happen. While we have + not seen this occur, AIX will kill processes when it runs out of + memory and the overcommit is accessed. The closest to this that + we have seen is fork failing because the system decided that + there was not enough memory for another process. Like many other + parts of AIX, the paging space allocation method and + out-of-memory kill is configurable on a system- or process-wide + basis if this becomes a problem. + + + + References and resources + + + + <ulink url="http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/lrg_prg_support.htm">Large Program Support</ulink> + + + AIX Documentation: General Programming Concepts: Writing and Debugging Programs + + + + + + <ulink url="http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/address_space.htm">Program Address Space Overview</ulink> + + + AIX Documentation: General Programming Concepts: Writing and Debugging Programs + + + + + + <ulink url="http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/resmgmt2.htm">Performance Overview of the Virtual Memory Manager (VMM)</ulink> + + + AIX Documentation: Performance Management Guide + + + + + + <ulink url="http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/memperf7.htm">Page Space Allocation</ulink> + + + AIX Documentation: Performance Management Guide + + + + + + <ulink url="http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/memperf6.htm">Paging-space thresholds tuning</ulink> + + + AIX Documentation: Performance Management Guide + + + + + <ulink url=" http://www.redbooks.ibm.com/abstracts/sg245674.html?Open">Developing and Porting C and C++ Applications on AIX</ulink> + + IBM Redbook + + + + + + + Statistics Collector Issues + + + + When implementing PostgreSQL version 8.1 on AIX 5.3, we + periodically ran into problems where the statistics collector + would mysteriously not come up successfully. This + appears to be the result of unexpected behaviour in the IPv6 + implementation. It looks like PostgreSQL and IPv6 do not play + very well together at this time on AIX. + + + + Any of the following actions fix the problem. + + + + Delete the IPv6 address for localhost: + +(as root) +# ifconfig lo0 inet6 ::1/0 delete + + + + + + + Remove IPv6 from net services. The + file /etc/netsvc.conf on AIX is roughly + equivalent to /etc/nsswitch.conf on + Solaris/Linux. The default, on AIX, is thus: + +hosts=local,bind + + Replace this with: + +hosts=local4,bind4 + + to deactivate searching for IPv6 addresses. + + + + + + + Cygwin -- cgit v1.2.3