SpaceWalk安装(一) postgresql 安装
来源:互联网 发布:线缆测试仪福禄克网络 编辑:程序博客网 时间:2024/05/29 16:48
Setup of the PostgreSQL database
You should have PostgreSQL server running somewhere. Let's assume you will run the server on the same machine as Spacewalk itself:
yum install -y 'postgresql-server > 8.4'# we do this to get postgresql84-server on RHEL 5chkconfig postgresql on# on Fedora 16 run:postgresql-setup initdb# everywhere else run:service postgresql initdbservice postgresql start
Create database, user, and plpgsql language there:
su - postgres -c 'PGPASSWORD=spacepw; createdb spaceschema ; createlang plpgsql spaceschema ; yes $PGPASSWORD | createuser -P -sDR spaceuser'
Configure the user to use md5 password to connect to that database. Put the lines like following to/var/lib/pgsql/data/pg_hba.conf. Avoid the common pitfall:Make sure you put them *before* those existing lines that are for all..
local spaceschema spaceuser md5host spaceschema spaceuser 127.0.0.1/8 md5host spaceschema spaceuser ::1/128 md5local spaceschema postgres ident
Then reload PostgreSQL:
service postgresql reload
and test the connection:
PGPASSWORD=spacepw psql -a -U spaceuser spaceschemaPGPASSWORD=spacepw psql -h localhost -a -U spaceuser spaceschema
Please note that you will want the TCP connection allowed as well because the JDBC driver cannot use the Unix domain socket. So even if the Python and Perl stack will use the Unix domain socket if you do not specify the hostname, JDBC will still go to localhost via TCP.
If you want to have the database on a separate box you will likely need to change this line in pg_hba.conf from 127.0.0.1/8 to something else:
host spaceschema spaceuser 127.0.0.1/8 md5
and also to add line to /var/lib/pgsql/data/postgresql.conf
listen_addresses = '*'
The contrib package
If your PostgreSQL server is installed on different machine than where you setup your Spacewalk server, please make sure thepostgresql-contrib >= 8.4 (or postgresql84-contrib on RHEL 5) is installed on the PostgreSQL server.
Note If Using Postgresql 9.0 or Higher
Depending on what version of the JDBC drivers you have available you may hit this issue:http://stackoverflow.com/questions/4868762/hibernate-3-3-2ga-improperly-loads-bytea-data-from-postgresql-9-0-and-all-type-m
This would have the effect of displaying a hex number instead of the contents of a config file that you have uploaded. If you hit this issue the easiest workaround is to add this line to postgresql.conf:
bytea_output = 'escape'
Tune up PostgreSQL
Tune up PostgreSQL's performance by running pgtune:
yum install pgtunepgtune --type=web -c 600 -i /var/lib/pgsql/data/postgresql.conf >/tmp/pgtune.conf# Review the changes bydiff -u /var/lib/pgsql/data/postgresql.conf /tmp/pgtune.confcp /var/lib/pgsql/data/postgresql.conf /var/lib/pgsql/data/postgresql.conf.bakcp /tmp/pgtune.conf /var/lib/pgsql/data/postgresql.confservice postgresql restart
or at least increase maximal number of connections to 600:
echo max_connections = 600 >>/var/lib/pgsql/data/postgresql.conf
- SpaceWalk安装(一) postgresql 安装
- Spacewalk的安装
- Spacewalk 安装更新删除软件包
- Spacewalk的配置与安装系统
- PostGreSQL入门教程(一)- 安装及简介
- PostgreSQL 介绍和安装(一)
- postgresql 安装和使用一
- PostgreSQL安装(windows)
- PostgreSQL安装(Windows)
- abase安装(postgresql)
- PostgreSQL每日一贴-从源码安装(9.4)
- postgresql数据库的安装一(源码编译)
- RedHat搭建Web运用之PostgreSQL数据库安装(一)
- PostgreSQL笔记(一)安装、运行、远程访问
- 安装Postgresql
- postgresql 安装
- Postgresql安装
- 安装Postgresql
- Baidu 手写中序遍历二叉树非递归 和 链栈 【面】
- 结构体字节对齐
- 旧工程适配iOS6和iPhone5续之第三方静态库
- 二叉查找树相关算法实现(算法导论12章)
- 用递归实现生成Gray码的算法
- SpaceWalk安装(一) postgresql 安装
- HTML_06(Dom(03))
- Gof设计模式(一)引言
- 二叉查找树 (算法导论12)
- apache 集成多个tomcat的方法
- cloudera源码下载
- Hdu 2027 - 统计元音
- poj1503
- Android逐条加载ListView,实现动画更新