gentoo
gentoo 安裝 Oracle client 方法 step by step / remote X window display
2014.0107 edit:
————————-
首先要先搞定 X window , 若不想裝 X window 可以用 xming 把畫面投到 PC 端來 , 如我目前的狀況是用 putty + xming 如圖設定
ssh 進遠端 server 下 export DISPLAY=172.30.0.216:0.0 把 X display 到 172.30.0.216:0.0
可以下 xeyes & 測試一下 , ( xeyes 也需要另裝)
gentoo 缺一些 X 的 lib , 要 emerge -av libXp libXtst
Oracle client 會 check 經過認可的 OS , 把這個 check 取消
vi install/oraparam.ini
[Certified Versions]
# 把下面那行註解
# Linux=gentoo,redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2
開始安裝
./runInstaller
vmware esx server – compile linux kernel / scsi controller/driver problem
直接在 vmware esx server 上重裝一台 gentoo linux 的 steps
在這個地方要勾 BusLogic , 在 make menuconfig 要選 BusLogic (簡直是廢話…)
開機後 dmesg | grep scsi 的結果是
scsi: ***** BusLogic SCSI Driver Version 2.1.16 of 18 July 2002 *****
scsi: Copyright 1995-1998 by Leonard N. Zubkoff <[email protected]>
scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter
scsi0: Firmware Version: 5.07B, I/O Address: 0x1060, IRQ Channel: 17/Level
scsi0: PCI Bus: 0, Device: 16, Address: 0xF4800000, Host Adapter SCSI ID: 7
scsi0: Parity Checking: Enabled, Extended Translation: Enabled
scsi0: Synchronous Negotiation: Ultra, Wide Negotiation: Enabled
scsi0: Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled
scsi0: Scatter/Gather Limit: 128 of 128 segments, Mailboxes: 211
scsi0: Driver Queue Depth: 211, Host Adapter Queue Depth: 192
scsi0: Tagged Queue Depth: Automatic, Untagged Queue Depth: 3
scsi0: *** BusLogic BT-958 Initialized Successfully ***
scsi0 : BusLogic BT-958
scsi 0:0:0:0: Direct-Access VMware Virtual disk 1.0 PQ: 0 ANSI: 2
sd 0:0:0:0: Attached scsi generic sg0 type 0
用 HAProxy 作 load balancer – 窮人的 SLB ( server load balance)
這是簡單版的架構, http flow:
其實, 裝起來並沒有想像中複雜, 只是準備一個測試環境比較麻煩些罷了–> vmware 又幫了我不少忙 😛
參考他的 online document:
http://haproxy.1wt.eu/download/1.3/doc/haproxy-en.txt
及架構圖
http://haproxy.1wt.eu/download/1.3/doc/architecture.txt
略翻完這兩個文件就可以來測試了 , 首先準備三台 web server : webA 到 webC , 然後還要一台 server 當 haproxy server 這台不用跑 apache , 安裝 haproxy 很簡單, 在 gentoo 就是 emerge –av haproxy , 設定檔要自己建 (放到 /etc/ )
我的 /etc/haproxy.cnf
listen webfarm 172.30.0.235:80 monitor-uri /haproxy_status stats uri /stats stats auth admin:admin mode http balance roundrobin cookie SERVERID insert indirect option httpchk HEAD /index.php HTTP/1.0 server webA 172.30.0.206:80 cookie A check server webB 172.30.0.227:80 cookie B check server webC 172.30.0.228:80 cookie C check
第一次連上後, haproxy 如他的 menual 寫的 , 會丟一個 cookie 給 client , 作為下次要連的實體 server 的依據 , 我把那台 apache 停掉, 果然就連到別去了 , 然後 phpinfo 中值得紀錄的是:
SERVER_NAME 就是 haproxy.cfg 中寫的 listen 的 IP , 然後 , SERVER_ADDR 就是實體連到的 apache 的 IP , haproxy 會不停的丟 HTTP/1.0 的 HEAD 取得 apache 是否還活著.
在 webA-C 的 aapache access log 中若 沒特別改的話, 就是紀錄 haproxy server 的 IP address
….
好了! 實驗完成了!
結論, HAProxy 在他的官網寫說他:
“ 提供一個免費/快速的 HA / LOAD BALANCE 方案 , 可是我覺得他僅能夠說 HA / BALANCE (並沒有很徹底的偵測 server loading) , 並且在 SPF 方面也並沒有很好的解決辦法.
不過呢, 至少 HAProxy 比 DNS roundrobin 還好.
各種 LOAD BALANCE 方案 評估表
SLB |
CPU用量 |
轉送效率 |
偵測連線 |
roundrobin DNS |
低 |
最佳,直接傳給client |
NO |
ipvsadm |
最低 |
高 |
YES |
mod_proxy |
高 |
低 |
YES |
haproxy |
中 |
中 |
YES |
過了一個晚上想了想 , 即使 Citrix / Alteon / Foundry 這些 SLB hardware device 也沒有做到真正的 loading detective , 所以就一個免費又高容量的 HAProxy 來說, 算是很好的 SLB 解決方案了.
ㄎㄎ 有做過 HAProxy 實驗的都會貼這一張:
解決 error while loading shared libraries 的方法
執行程式時, 若遇到
./update_item: error while loading shared libraries: libsqlrclientwrapper-0.40.so.1: cannot open shared object file: No such file or directory
像這樣的錯誤訊息 , 表示程式中所需的 so 檔(share library) 沒找到 , 要修改 /etc/ld.so.conf 加上這個目錄 , 改完要下 ldconfig –v 讓路徑生效
可以用 ldd 看該程式所使用到的 shared library 有那些, 及 lib 路徑
—–
以下是 gentoo 的標準解法 , 其他版本的 linux 則不太相同!!
cat /etc/ld.so.conf 這個檔是由 env-update 產生的 , 所以再繼續看一下 /etc/env.d 下 , 究竟有啥
# ld.so.conf autogenerated by env-update; make all changes to # contents of /etc/env.d directory /usr/local/lib /usr/i686-pc-linux-gnu/lib /usr/lib/gcc/i686-pc-linux-gnu/4.1.2 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1 /usr/local/firstworks/lib
參考資料, 這是 compile sqlrelay 列出來的 information
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-
/bin/sh ../../libtool –mode=finish /usr/local/firstworks/lib
PATH=”$PATH:/sbin” ldconfig -n /usr/local/firstworks/lib
———————————————————————-
Libraries have been installed in:
/usr/local/firstworks/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,–rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’
在 /etc/env.d 下建立一個 90sqlrelay
內容是
LDPATH="/usr/local/firstworks/lib"
再run : env-update , 就看到 /etc/ld.so.conf 多了正確的 lib path 了
// ———————–
[12/6/13 下午4:37:54] RUTEN AA: 到 /usr/lib 找出原生的 .so 檔,應該會是 libsqlrclientwrapper-0.40.so.xxx.xxx
[12/6/13 下午4:38:13] RUTEN AA: ln -s libsqlrclientwrapper-0.40.so.xxx.xxx 到 loss 的 libsqlrclientwrapper-0.40.so.1.0.0
[12/6/13 下午4:38:17] RUTEN AA: 再 ldconfig
[12/6/13 下午4:40:53] RUTEN AA: 可以用 ldconfig -p 看是不是已經把 libsqlrclientwrapper-0.40.so.1 給 load 進來了
install oracle instant client basic on gentoo linux step by step
emerge -av dev-db/oracle-instantclient-basic dev-db/oracle-instantclient-sqlplus
—
!!! dev-db/oracle-instantclient-basic-11.1.0.7.0 has fetch restriction turned on. !!! This probably means that this ebuild's files must be downloaded !!! manually. See the comments in the ebuild for more information. * Please go to: * http://www.oracle.com/technology/tech/oci/instantclient/index.html * select your platform and download the * Basic client package with SDK, which are: * instantclient-basic-linux32-11.1.0.7.zip * instantclient-sdk-linux32-11.1.0.7.zip * Then after downloading put them in: * /usr/portage/distfiles
—
在
http://www.oracle.com/technology/tech/oci/instantclient/index.html
抓
factory ~ # cd /usr/portage/distfiles factory distfiles # ls -l *zip -rw-rw-r-- 1 apache portage 34556803 Aug 6 17:17 instantclient-basic-linux32-10.2.0.3-20061115.zip -rw-rw-r-- 1 apache portage 602897 Aug 6 17:17 instantclient-sdk-linux32-10.2.0.3-20061115.zip emerge -av dev-db/oracle-instantclient-basic #
—
USE="apache2 berkdb bzip2 calendar cjk cli crypt ctype curl gd gdbm hash iconv json mysql mysqli nls oci8-instant-client pcre reflection session simplexml sockets spl ssl tokenizer truetype unicode xml xmlreader xmlwriter zlib" emerge -av php
[sparc] solve gentoo blocking problem
emerge -pv
……
[ebuild U ] app-shells/bash-3.2_p33 [3.1_p17] USE=”nls -afs -bashlogger
-plugins% -vanilla” 2,564 kB
[blocks B ] <sys-apps/portage-2.1.4_rc1 (is blocking
app-shells/bash-3.2_p33)
[blocks B ] sys-apps/mktemp (is blocking sys-apps/coreutils-6.10-r2)
[blocks B ] >=sys-apps/coreutils-6.10 (is blocking sys-apps/mktemp-1.5)
emerge -1 =bash-3.2_p17*
emerge -1 portage
emerge -1 bash
emerge -C mktemp
emerge -C sys-apps/util-linux
emerge –oneshot coreutils
emerge -1 sys-apps/util-linux