To repair the corrupted xfs---------------------------1. To check the xfs filesystem xfs_repair -nv /dev/drbd0 --> no modify or just print the bad block
2. To repair the xfs filesystem xfs_repair -v /dev/drbd0 -> repair the filesystem. may take long time if big bad block
/home/data/edb/sysctl -p
database server configuratin and installation step--------------------------------------------------Server 1--------
1.uninstall edb (skip if no edb installed) a../uninstaller.bin -console b.rm -Rf InstallShield/ c.rm -Rf opt
2.mount installer-apt (skip if server connected to internet) a.mkdir /mnt/apt-mirror
Install Enterprise DB yg baru------------------------------ apt-get install libssl-dev apt-get install libxslt1.1 apt-get install libncurses5-dev
ln -s /usr/lib/libcrypto.so /usr/lib/libcrypto.so.4ln -s /usr/lib/libssl.so /usr/lib/libssl.so.4
b.mount 10.15.110.9:/home/data/apt-mirror /mnt/apt-mirror3.copy apt-source a.mv /etc/apt/sources.list /etc/apt/sources.list_ori b.scp
vmbrfdb1@10.15.110.5:/etc/apt/sources.list /etc/apt/.4.Update source a.apt-get update5.install drbd a.apt-get install drbd0.7-module-source drbd0.7-utils6.install latest kernal from Linux vmscddb1 2.6.15-23-server #1 SMP Tue May 23 15:10:35 UTC2006 i686 GNU/Linux to Linux vmscddb1 2.6.15-25-server #1 SMP Wed Jun 14 11:52:05 UTC2006 i686 GNU/Linux a.apt-get dist-upgrade7.reboot a.reboot
8.remount the apt-source (skip if server conected to internet) a.mount 10.15.110.9:/home/data/apt-mirror /mnt/usb/apt-mirror
9.create module package assistant a.apt-get install module-assistant
10. use the module-assistant to configure and install source of drbd a.m-a a.update b.prepare c.select a.drbd0.7-module RAID 1 over tcp/ip for Linux module d.build e.install11. load the drbd module kernel a.modprobe drbd b.modprobe softdog
12. update file /etc/modules add drbd softdog
12. copy drbd.conf mv /etc/drbd.conf /etc/drbd.conf_ori a.scp
vmbrfdb1@10.15.110.5:/etc/drbd.conf /etc/drbd.conf13. update drbd.conf a.change server1 and server2 b.change ipaddress for server1 and server2 on vmkmrdb1 { device /dev/drbd0; disk /dev/md0; address 10.145.123.5:7788; meta-disk internal;
on vmkmrdb2 { device /dev/drbd0; disk /dev/md0; address 10.145.123.6:7788; meta-disk internal;14. Check disk and device correct (important) disk /dev/md015. update /etc/hosts eg: 10.126.13.5 vmscddb1 10.126.13.6 vmscddb2
16.unmount /home/data a.umount /home/data b.remark mount to /home/data at /etc/fstab
17. restart drbd service a./etc/init.d/drbd stop b./etc/init.d/drbd start Note:wait for about 10 minute to start18. Final step to do syncronization a. at Master server -> drbdsetup /dev/drbd0 primary --do-what-I-say b. at Slave server -> drbdsetup /dev/drbd0 secondary19. Check progress of the raid-1 a.cat /proc/drbd Eg result : version: 0.7.15 (api:77/proto:74) SVN Revision: 2020 build by
root@vmscddb2, 2006-07-05 15:29:17 0: cs:SyncTarget st:Secondary/Primary ld:Inconsistent ns:0 nr:576584 dw:576584 dr:0 al:0 bm:59039 lo:86 pe:9202 ua:86 ap:0 [>...................] sync'ed: 0.2% (471477/472040)M finish: 6:42:19 speed: 19,664 (11,296) K/sec
20.Make filesysem for drbd0 a.mkfs.xfs -f /dev/drbd021.mount /home/data to /dev/drbd0 a. mount /dev/drbd0 /home/data
Server 2--------Follow step server1 till 14
configure postgres------------------pscp *.gz
pakya@10.42.8.245:/home/pakya/installer/.
pscp
vmbrfdb1@10.15.110.5:/home/vmbrfdb1/edb-linux-x86_81312.tar.gz/home/data/installer/.mv /home/data/edb/data/postgresql.conf/home/data/edb/data/postgresql.conf_oriscp
pakya@10.15.110.5:/home/pakya/postgresql.conf /home/pakya/. mv /home/pakya/postgresql.conf /home/data/edb/data/.chown enterprisedb:edb /home/data/edb/data/postgresql.confchmod 600 /home/data/edb/data/postgresql.conf
mv /etc/init.d/edb_8.1.3.12 /etc/init.d/edb_8.1.3.12_oriscp
vmbrfdb1@10.15.110.5:/etc/init.d/edb_8.1.3.12 /etc/init.d/.chmod 755 -R /home/data/edb/dbserver/share
mv /home/data/edb/data/pg_hba.conf /home/data/edb/data/pg_hba.conf_oriscp
pakya@10.15.110.5:/home/pakya/pg_hba.conf /home/pakya/. mv /home/pakya/pg_hba.conf /home/data/edb/data/.chmod 600 /home/data/edb/data/pg_hba.confchown enterprisedb:edb /home/data/edb/data/pg_hba.conf
scp
pakya@10.15.110.5:/home/pakya/resource.tar /etc/ha.d/resource.d/.scp
pakya@10.15.110.5:/etc/ha.d/ha.cf /etc/ha.d/.scp
pakya@10.15.110.5:/etc/ha.d/haresources /etc/ha.d/.scp
pakya@10.15.110.5:/etc/ha.d/authkeys /etc/ha.d/.
mkdir /var/run/heartbeat
ln -s libreadline.so.5 libreadline.so.4ln -s libncurses.so.5 libtermcap.so.2
Enterprisedb Installation-------------------------
f you are running Ubuntu/Debian, you can find the needed DEB compatabilitypackages (ldso, libc5, & termcap-compat) at
http://packages.ubuntu.com/breezy/oldlibs. After downloading them, you'lllikely need to run the following script:
* sudo dpkg -i ldso*.deb * sudo dpkg -i libc5*.deb * sudo dpkg -i termcap*.deb * sudo ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3
For all other Linux releases, if the 'pre-Install.sh' script indicates youhave a missing library you should install the library from yourdistribution's CD and/or repository.
deb
http://my.archive.ubuntu.com/ubuntu/ breezy main restricted universemultiverse
apt-get install termcap-compatapt-get install build-essentialln -s libtermcap.so /usr/lib/libtermcap.so.2
1. wget
http://www.enterprisedb.com/downloads/ga/edb-linux-x86_81312.tar.gz2. apt-get install bc3. apt-cache search ldso4. apt-cache search libc55. ln -s /lib/libreadline.so.5 /lib/libreadline.so.46. ln -s /usr/lib/libtermcap.so /usr/lib/libtermcap.so.27. vim /etc/ha.d/haresources add db::startAt server 21. ln -s /lib/libreadline.so.5 /lib/libreadline.so.42. ln -s /usr/lib/libtermcap.so /usr/lib/libtermcap.so.23. useradd -m -s /bin/sh enterprisedb4. passwd enterprisedb5. cp /etc/init.d/edb_81312 server 26. copy /etc/ha.d/resource.d/db to server 27. vim /etc/ha.d/haresources add db::start
rsync -avz --delete --drop-cache --progress rsync://10.18.2.72:/database_imp/* /mnt/usbdrive/dlcdb_backup/import/.
rsync -avz --delete --drop-cache --progress rsync://10.18.2.72:/database_rman/* /mnt/usbdrive/dlcdb_backup/rman/.
Ms Malin: ok, nk convert kt pdf pegi dkt Project --> Compile --> click pdf ---> ok
--Komtar hdd db1 kong.----------------------1. Install os with 3 partition at sda (dont touch sdb) sda1 Boot Primary Linux ext3 246.76 sda2 Primary Linux XFS 4745.99 Pri/Log swap 495112.512. mount for apt-get mount 10.15.110.9:/mnt/usb/apt-mirror /mnt/apt-mirror3. Install kernal patch, ssh, heartbeat, drbd4. change swap to /dev/sdb2 vim /etc/fstab change /dev/sda3 none swap sw 0 0 to /dev/sdb3 none swap sw 0 0
5. reboot to make sure swap move to /dev/sdb36. verify swap is on right place swapon -s
7. change partition on sda3 cfdisk /dev/sda change swap to Linux raid autodetect with full hdd usage
8. cat /etc/mdstat
Personalities : [raid1]md0 : active raid1 sdb3[1] 483500160 blocks [1/2] [_U]
9. Attach new partiton to md0 mdadm --add /dev/md0 /dev/sda2
9. check the status watch -n 1 cat /etc/mdstat Personalities : [raid1] md0 : active raid1 sda3[2] sdb3[1] 483500160 blocks [2/1] [_U] [=>...................] recovery = 6.5% (31769344/483500160) finish=213.8min speed=35210K/sec
10. Prepare the drbd
11. When drbd bad luck -> remove the kernel header -> dpkg -r kernel-header 2.... -> reinstall kernel header -> dpkg -i kernal-header 2...12. Reprepare the drbd. -> should work
13. set all drbd setting
14. Copy related file a.db b.db2 c.db.org d.edb_8.1.3.12 e.firehol.conf f.proc_exist g.zabbix_agent.tar
15. Add /etc/sysctl.conf
# pakya tambahkernel.shmall = 1073741824kernel.shmmax = 1073741824kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 1048576net.core.rmem_max =1048576net.core.wmem_default = 262144net.core.wmem_max = 262144vm.overcommit_memory = 2
16. Reload the kernal. sysctl -p
route del -net 58.0.0.0/8
http://ubuntuforums.org/showthread.php?p=4744223#post47442231.
root@ubuntu-desktop:~# apt-get install apache2 //Install Apache22.
root@ubuntu-desktop:~# apt-get install php5-common php5 php5-dev libapache2-mod-php5 php5-cli //Install required PHP5 modules and libraries3.
root@ubuntu-desktop:~# apt-get install build-essential php-pear //Install the build-essential and php-pear packages3a
root@ubuntu-desktop:~# apt-get install php5-pgsql3b
root@ubuntu-desktop:~# apt-get install php5-gd4.
root@ubuntu-desktop:~# apt-get install libaio1 //IMPORTANT! Install libaio1 library. This is what I was having serious issues with originally.5. Download Oci and sdk from
http://www.oracle.com/technology/tech/oci/instantclient/index.html //Download the new Instantclient and SDK zip files from Oracle. a.Basiclite.zip b.Sdk.zip Note: Apt-get install unzip to unzip the 2 file 5.a.
root@ubuntu-desktop:~# mkdir /opt/oracle //create a directory to house the zip files once they are uncompressed 5.b.
root@ubuntu-desktop:~# mv /home/pakya/*.zip /opt/oracle //move the .zip files in the your "pakya" directory to the /opt/oracle directory 5.c.
root@ubuntu-desktop:~# cd /opt/oracle //Change to the /opt/oracle directory 5.d.
root@ubuntu-desktop:/opt/oracle# unzip \*.zip //Unzip the files 5.e.
root@ubuntu-desktop:/opt/oracle# mv instantclient_11_1 instantclient //rename instantclient directory 6.f.
root@ubuntu-desktop:/opt/oracle# cd instantclient //Change directory to instantclient, list the files 7.g.
root@ubuntu-desktop:/opt/oracle# ln –s libclntsh.so.11.1 libclntsh.so //Create symbolic links 8.h.
root@ubuntu-desktop:/opt/oracle# ln –s libocci.so.11.1 libocci.so //Create symbolic links9.
root@ubuntu-desktop:/opt/oracle# mkdir /opt/oracle/src //Create a source directory under /opt/oracle . This is where we will house the oci8 libraries. 9.a.
root@ubuntu-desktop:/opt/oracle# cd /opt/oracle/src //Change the directory to /opt/oracle/src and download the oci8 tar using pecl10.
root@ubuntu-desktop:/opt/oracle/src# pecl download oci8 //Download oci8 10.a
root@ubuntu-desktop:/opt/oracle/src# tar xvf oci8-1.2.4.tgz //Untar the oci8 libraries 10.b
root@ubuntu-desktop:/opt/oracle/src# cd oci8-1.2.4 //Change to the newly created oci8-1.2.4 directory and issue the following commands11.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# phpize12.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# export ORACLE_HOME=/opt/oracle/instantclient //Set the ORACLE_HOME eviroment variable 12.a.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# echo $ORACLE_HOME //View oracle environment13.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# ./configure --with-oci8=share,instantclient,/opt/oracle/instantclient //Configure oci8 to install with the necessary parameters
13.a.root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# make //run make to compile 13.b.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# make install //install oci814.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# echo extension=oci8.so >> /etc/php5/apache2/php.ini //insert the extension=oci8.so into the apache and cli .ini files15.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# echo extension=oci8.so >> /etc/php5/cli/php.ini //insert the extension=oci8.so into the apache and cli .ini files16.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# /etc/init.d/apache2 restart //restart apache
TEST the setting-----------------1.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# vi /var/www/phptest.php //create a phpinfo.php file in /var/www
NOte : Use your browser to test
http://10.x.x.x/phpinfo.php find oci8 module
2.
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# vi /var/www/oratest.php //Create a empty script to test your Oracle Connection
//oracle connection variables$ora_user = 'myvoice'; //username$ora_pass = 'myvoice'; //user password//$ora_host = '200.1.34.1'; //host name or server ip address$ora_db = 'acms'; //database name$ora_host='(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 200.1.34.1) (PORT = 1521) ) (CONNECT_DATA =(SID = ACMS)) )';
// place variable into oci_connect function, then place funtion in variable//$ora_conn = oci_connect($ora_user,$ora_pass,'//'.$ora_host.'/'.$ora_db);$ora_conn = oci_connect($ora_user,$ora_pass,$ora_host);// error handlingif (!ora_conn){ // if variable $ora_conn fails to connect// do the following if it fails$ora_conn_erno = oci_error(); // insert oci_error() function into variableecho ($ora_conn_erno['message']."\n"); // print the $ora_conn_erno variable/oci_error() function selecting only the message (human readable)oci_close($ora_conn); // close the connection just in case php doesn't close it} else {// if it doesn't fail it will proceed with the rest of the scriptecho "Connection Succesful\n"; //echo message if connection does not erroroci_close($ora_conn); // close the connection}
?>
NOte : Use your browser to test
http://10.x.x.x/oratest.php Got Connection Succesful result
Test result===========
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4# php /var/www/oratest.phpConnection Succesful
root@ubuntu-desktop:/opt/oracle/src/oci8-1.2.4#
heartbeat=========apt-get install watchdogmodprobe softdogvim /etc/modules add softdogvim /etc/init.d/heartbeat start{ mkdir -p /var/run/heartbeat/
vim /etc/hosts to identify both server name
1. authkeys chmod 6002. ha.cf3. haresource item in haresource DMZ101KLJ173 10.1.101.176 172.16.1.3 drbddisk::db Filesystem::/dev/drbd0::/home/data::xfs::noatime,nodiratime db::start
ntp date========manuall set date ntpdate 10.1.101.172 note: make sure ntpd is not runnig kill -9 ntpd
vim /etc/default/ntp add NTPSERVERS="10.1.101.172 ntp.ubuntu.com"
crontab -e add 15 * * * * /etc/network/if-up.d/ntpdate #to sync time with DMZ101KLJ172(Web2)
updaterc.d -f ntp-server remove
kalau server just install ntp-server shjkalau nak client just install ntpdate shjjangan install kedua2nya kerana ntpdate tak jalan kerana guna port yg sama iaituy 123firewall kena bukak port 123
sudo without password=====================visudoadd pakya ALL=(ALL) NOPASSWD:ALL at the lower
ODBC driver===========libncurses5-devunixodbc-devodbc-postgresql
Bust password prompt====================vim /etc/ssh/sshd_config add UseDNS no /etc/init.d/ssh restart
ZABBIX Installation===================
1.set prerequisite library and installation
apt-get install build-essential mysql-server libmysqlclient15-dev php5 php5-gd php5-mysql snmp libsnmp9-dev snmpd libcurl3-dev
2.create zabbix os user adduser zabbix --create user adduser zabbix admin --asign zabbix to admin group
3.Download zabbix 1.4 installation
su - zabbix wget
http://optusnet.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.4.5.tar.gz tar zxvpf zabbix-1.4.5.tar.gz
4. Create a zabbix database and populate database using root
mysql -e"create database zabbix;" mysql -e"grant all privileges on zabbix.* to
zabbix@localhost identified by 'enter-password-here';"
mysql -D zabbix -u zabbix -p zabbix < /home/zabbix/zabbix-1.4.5/create/schema/mysql.sql mysql -D zabbix -u zabbix -p zabbix < /home/zabbix/zabbix-1.4.5/create/data/data.sql mysql -D zabbix -u zabbix -p zabbix < /home/zabbix/zabbix-1.4.5/create/data/images_mysql.sql
5. Configure and make ./configure --prefix=/usr --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent make sudo make install
6. Declare port at the services sudo vim /etc/services Add at the end: zabbix_agent 10050/tcp # Zabbix ports zabbix_trap 10051/tcp
7. Set zabbix environment sudo mkdir /etc/zabbix sudo chown -R zabbix.zabbix /etc/zabbix/ cp misc/conf/zabbix_* /etc/zabbix/ vim /etc/zabbix/zabbix_agentd.conf Make sure that the Server parameter points to the server address, for the agent that runs on the server it is like this: Server=127.0.0.1 vim /etc/zabbix/zabbix_server.conf change database informatin # Database user DBUser=zabbix # Database password # Comment this line if no password used DBPassword=ku2muke?
8. Copy init.d script sudo cp /home/zabbix/zabbix-1.4.5/misc/init.d/debian/zabbix-server /etc/init.d sudo cp /home/zabbix/zabbix-1.4.5/misc/init.d/debian/zabbix-agent /etc/init.d
sudo vim /etc/init.d/zabbix-server Look for the following line: DAEMON=/home/zabbix/bin/${NAME} and replace it with: DAEMON=/usr/sbin/${NAME}
sudo vim /etc/init.d/zabbix-agent Look for the following line: DAEMON=/home/zabbix/bin/${NAME} and replace it with: DAEMON=/usr/sbin/${NAME}
sudo chmod 755 /etc/init.d/zabbix-server sudo update-rc.d zabbix-server defaults sudo chmod 755 /etc/init.d/zabbix-agent sudo update-rc.d zabbix-agent defaults
9. Start the server and agent sudo /etc/init.d/zabbix-server start sudo /etc/init.d/zabbix-agent start ps -aux grep zabbix
10. Configure web service mkdir /home/zabbix/public_html cp -R frontends/php/* /home/zabbix/public_html/ sudo vim /etc/apache2/sites-enabled/000-default
Alias /zabbix /home/zabbix/public_html/
AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Order allow,deny Allow from all Order deny,allow Deny from all 11. PHP configureation sudo vim /etc/php5/apache2/php.ini max_execution_time = 300 ; Maximum execution time of each script, in seconds date.timezone =Asia/Kuala_Lumpur
sudo /etc/init.d/apache2 restart
http://www.zabbix.com/wiki/doku.php?id=howto:ubuntuinstallZabbix agent installation==========================
1.create zabbix os user adduser zabbix --create user adduser zabbix admin --asign zabbix to admin group
2.Download zabbix 1.4 installation
su - zabbix wget
http://optusnet.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.4.5.tar.gz tar zxvpf zabbix-1.4.5.tar.gz
3.Compile and configure ./configure --enable-agent make sudo make install
4. Declare port at the services sudo vim /etc/services Add at the end: zabbix_agent 10050/tcp # Zabbix ports zabbix_trap 10051/tcp
5. Configure environment sudo mkdir /etc/zabbix sudo cp /home/zabbix/zabbix-1.4.5/misc/conf/zabbix_agentd.conf /etc/zabbix/. sudo vim /etc/zabbix/zabbix_agentd.conf edit server and hostname only
6. Copy init.d script sudo cp /home/zabbix/zabbix-1.4.5/misc/init.d/debian/zabbix-agent /etc/init.d
sudo vim /etc/init.d/zabbix-agent Look for the following line: DAEMON=/home/zabbix/bin/${NAME} and replace it with: DAEMON=/usr/local/sbin/${NAME}
sudo chmod 755 /etc/init.d/zabbix-agent sudo update-rc.d zabbix-agent defaults
7. Start zabbix agent sudo /etc/init.d/zabbix-agent start
8. updaterc.d zabbix-agent default
rsync installation==================1. vim /etc/rsyncd.conf add read only = yes pid file = /var/run/rsyncd.pid
[db_backup2008] path = /home/data/db_backup uid = root read only = yes
2. vim /etc/default/rsync change to this value RSYNC_ENABLE=true