貝貝爸爸的程序人生

          關(guān)注Seam、BPM
          posts - 23, comments - 10, trackbacks - 0, articles - 32
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
          由于最近在做的oryx-editor使用的是posgresql8.3.15,不能自動的使用yum install安裝了,因為現(xiàn)在源里面的版本是8.1,無法滿足項目要求,特安裝了postgresql8.3.15,只能源碼編譯安裝了。
          ----------------------------

          1、下載postgresql最新版:http://www.postgresql.org/ftp/source/

          wget http://wwwmaster.postgresql.org/redir/391/f/source/v8.3.15/postgresql-8.3.15.tar.gz

          2、解壓文件:
          tar zxvf postgresql-8.3.7.tar.gz
          cd postgresql-8.3.7

          3、配置:
          ./configure --prefix=/usr/local/pgsql

          4、編譯:
          make

          5、安裝:
          make install

          6、創(chuàng)建用戶組和用戶:
          groupadd postgres
          useradd -g postgres postgres

          7、創(chuàng)建數(shù)據(jù)庫庫文件存儲目錄、給postgres賦予權(quán)限:
          mkdir /usr/local/pgsql/data
          cd /usr/local/pgsql
          chown postgres.postgres data

          8、初始化數(shù)據(jù)庫目錄:
          切換用戶
             su - postgresql

          初始化數(shù)據(jù)
             /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

          啟動數(shù)據(jù)庫
             /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data

          9、配置監(jiān)聽地址和端口:
          vi /usr/local/pgsql/data/postgresql.conf
          取消以下兩行的注釋
             listen_addresses = '*'

             port = 5432

          10、允許遠(yuǎn)程連接:
          vi /usr/local/pgsql/data/pg_hba.conf
          添加
             host all all 192.168.1.0/24 trust 

             每項的具體意思在配置文件中有詳細(xì)說明
          配置iptables讓遠(yuǎn)程主機(jī)能訪問:
             vi /etc/sysconfig
             添加
                -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
             service iptables restart

          11、讓postgresql數(shù)據(jù)庫隨系統(tǒng)啟動而啟動:
          將啟動腳本拷貝到/etc/init.d/目錄下,具體執(zhí)行如下命令:
          cd /etc/rc.d/init.d
          cp (第一步解壓的安裝文件目錄)/postgresql-8.3.7/contrib/start-scripts/linux postgresql
          chmod +x postgresql
          vi postgresql
             prefix=/usr/local/pgsql
             PGDATA="/usr/local/pgsql/data"
             PGUSER=postgres
             PGLOG="/var/log/pgsql.log"

             chkconfig --add postgresql
          啟動數(shù)據(jù)庫:
             service postgresql start

          配置完畢 。


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 砚山县| 海丰县| 丹东市| 恭城| 高唐县| 桦南县| 兴和县| 如东县| 望奎县| 固阳县| 武川县| 中卫市| 元谋县| 玉山县| 潮州市| 阿巴嘎旗| 庆城县| 涡阳县| 通渭县| 鹤岗市| 绵阳市| 南木林县| 孟津县| 巴南区| 玉树县| 平乡县| 溧水县| 界首市| 泊头市| 梨树县| 萍乡市| 永修县| 白城市| 阜新市| 怀仁县| 玛纳斯县| 汉源县| 嵊泗县| 沙雅县| 建始县| 化德县|