1. 需要mesa ,mesa-storage,postgresql安裝包,添加MESA_TRAGET環境變量,爲mesa的安裝路徑,在本文檔中爲
export $MESA_TARGET=/opt/mesa
2. 創建三個目錄,/opt/mesa/ /opt/mesa/storage /opt/postgres
3. 將三個壓縮包分別放入三個文件夾下,然後解壓,使用命令
tar xvf選擇最適合的解壓文件
4. 創建用戶postgres,密碼postgres
adduser postgres
passwd postgres,然後輸入密碼postgres,會報錯,提示密碼太簡單可以不理會
將postgresql的安裝路徑賦權給postgres
chown –R postgres /opt/postgres
5. 在postgres解壓出來的文件中找到INSTALL文件,然後用vim或者用打開,可以看到postgresql的安裝步驟
在安裝過程中可能會報錯,一個提示在$PATH中沒有‘C’,一個提示沒有read-line,還有一個提示沒有zlib,根據實際情況下載缺失的包,在本文檔中則使用yum安裝三個文件包
yum –y install gcc
yum –y install readline-devel
yum –y install zlib-devel
6. 根據INSTALL裏面的設置,配置postgresql
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres/usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D/usr/local/pgsql/data
touch/usr/local/pgsql/data/logfile
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l/usr/local/pgsql/logfile start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
7. 在/etc/profile中添加三個環境變量
export LD_LIBRARY_PAHT=/usr/local/pgsql/lib
export PGLIB=/usr/local/pgsql/lib
export PGDATA=/usr/local/pgsql/data
8. 安裝openldap
yum –y install openldap
yum –y install openldap-clients
yum –y install openldap-servers
9. 在/opt/mesa中解壓mesa的壓縮文件
cd /opt/mesa
unzip mesa………zip
10. 在/etc/profile中添加環境變量TOMCAT_PATH
11. 創建用戶mesa,將/opt/mesa賦權給mesa
chown –R mesa /opt/mesa
12. 設置postgresql爲開機啓動,在root用戶下
cd/opt/postgres/contrib/start-scripts
cp linux /etc/rc.d/init.d/postgres
chmod 755 /etc/init.d/postgres
chkconfig –add postgres
chkconfig postgres on
13. 查看/opt/mesa/db中的Makefile,CreateDB,DropDB文件,修改CreateDB的最後一行爲:
/usr/local/pgsql/bin/created --encoding=UTF-8$1
其中修改了createdb命令的正確路徑,路徑爲pgsql下的bin中的creatdb路徑,並且修改encoding後面的字符集爲postgresql所用的字符集
可以使用命令psql ,如果提示不識別psql命令,在/etc/profile的PATH字段中添加
:/usr/local/pgsql/bin路徑即可
psql postgres
以postgres用戶進入數據庫中,\l來查看剛剛建立的數據庫
如果使用命令psql報權限錯誤位u=rw(0700)時要注意查看/usr/local/pgsql/data的權限是否爲700,不爲700的話不能啓動,修改命令爲
chmod 700 /usr/local/pgsql/data
14. 然後在mesa賬戶下使用命令:make database
這段命令運行的時Makefile中database:下的那段命令
然後可以看到建庫的過程,沒有報錯的話就是成功建庫了
15. 最後在/opt/mesa/mesa_tests/common/actors/all文件夾下
perl 1/eval_1.pl運行該腳本文件,然後會生成一個文件
mesa_environment.log,查看該日誌文件,看是否有報錯