Posts

LINUX REDHAT BOOK. Now available on this site !

Do you interest in Linux Redhat ? Let's have a book of Linux Redhat on this website. Contact me : smiertx@gmail.com if you interest with this book. >> Tersedia dalam Bahasa Indonesia. >> Available on English. Here are the content list : CHAPTER 1 INSTALLATION RED HAT ENTERPRISE LINUX 4 INTRODUCTION INSTALLATION RAID AND LVM  CHAPTER 2 POST INSTALLATION RED HAT ENTERPRISE LINUX 4 KOMPILE LAST STABLE KERNEL TUNING KERNEL PARAMETER HARDENING LINUX File /etc/login/defs File /etc/security/limits.conf File /etc/pam.d/system-auth File /etc/bashrc Service running on system startup Change run-level CUSTOMIZING LINUX DESKTOP CHAPTER 3 USER DAN GROUP ADMINISTRATION ADD GROUP ADD USER CHANGE GROUP PARAMETER CHANGE USER PARAMETER SUDO CHAPTER 4 SETTING NETWORK DI LINUX SETTING HOSTNAME SETTING GLOBAL NETWORK CONFIGURATION SETTING INTERFACE NETWORK SETTING VIRTUAL IP INTERFACE NETWORK MANAGE NETWORK SERVICE NETWORK BONDING LINUX...

Mirror disk on Solaris

show disk layout on 1st harddisk partition # format 0 p p create copy of Volume Table of Contents from 1st harddisk partition # prtvtoc /dev/rdsk/c1t0d0s2 | fmthard –s - /dev/rdsk/c1t1d0s2 create metadb as database that contain all mirror configuration. slice 7 is unused partition # metadb –a –c 3 –f c1t0d0s7 c1t1d0s7 create virtual device for each slice # metainit –f d11 1 1 c1t0d0s0 # metainit –f d12 1 1 c1t1d0s0 # metainit d10 –m d11 # metainit –f d21 1 1 c1t0d0s1 # metainit –f d22 1 1 c1t1d0s1 # metainit d20 –m d21 # metainit –f d31 1 1 c1t0d0s3 # metainit –f d32 1 1 c1t1d0s3 # metainit d30 –m d31 # metainit –f d41 1 1 c1t0d0s4 # metainit –f d42 1 1 c1t1d0s4 # metainit d40 –m d41 # metainit –f d51 1 1 c1t0d0s5 # metainit –f d52 1 1 c1t1d0s5 # metainit d50 –m d51 # metainit –f d61 1 1 c1t0d0s6 # metainit –f d62 1 1 c1t1d0s6 # metainit d60 –m d61 Tell system that root actually virtual device, not slice anymore # metaroot d10 Reboot system # shutdown -g0 -i6 -y Add virtual device from...

ALOM Solaris

From konsole to alom # #. From alom to konsole sc> console Configure alom from scratch sc> setupsc After configure, you should reset alom with sc> resetsc graceful reset server sc> poweroff sc> poweron force reset sc> poweroff -f sc> poweron immediately reset sc> reset go to OpenBoot PROM sc> break show env sc> showenvirontment change alom password login sc> password

Monitor Dual Master Mysql Replication

Here are shell script for monitoring replication, resetting replication if failed, logging if replication occured. Write a file name mysqlslave.sh on /tmp directory. #!/bin/sh user=mysql_root_username passwd=mysql_root_passwd repuser=mysql_replica_username reppasswd=mysql_replica_passwd GO=1 while [ $GO=1 ]; do rf=$(mktemp) /usr/local/mysql/bin/mysql -u$user -p$passwd -e "show slave status \G" > $rf 2>&1 repl_IO=$(cat $rf|grep "Slave_IO_Running"|cut -f2 -d':') repl_SQL=$(cat $rf|grep "Slave_SQL_Running"|cut -f2 -d':') if [ "$repl_IO" != " Yes" -o "$repl_SQL" != " Yes" ] ; then /usr/local/mysql/bin/mysql -u$user -p$passwd -e "stop slave" /usr/local/mysql/bin/mysql -u$user -p$passwd -e "reset slave" rg=$(mktemp) /usr/local/mysql/bin/mysql -hserverb -u$repuser -p$reppasswd -e "show master status \G" > $rg 2>&1 filemaster=$(cat $rg|grep "File"|cu...

Dual Master Mysql Replication ( Circular Replication )

We have 2 servers that will be configured as Circular Replication. It means both servers act as master and slave to another server. After we install mysql-server on both servers, check /etc/hosts should be same as both servers. # more /etc/hosts 127.0.0.1 localhost 192.168.0.21 servera 192.168.0.22 serverb 192.168.0.23 dbhost After that try to look at /etc/my.cnf At Server A : # more /etc/my.cnf [MYSQLD] basedir = /usr/local/mysql datadir = /data/mysql/data max_connections=10000 default-character-set=utf8 default-collation=utf8_bin # InnoDB parameters set-variable = innodb_buffer_pool_size=1500M set-variable = innodb_additional_mem_pool_size=500M set-variable = innodb_log_buffer_size=10M log-bin binlog-do-db=test binlog-ignore-db=mysql server-id=1 replicate-same-server-id = 0 auto-increment_increment = 2 auto-increment_offset = 1 master-host = serverb master-user = replica master-password = slave123 master-port = 3306 expire_logs_days = 10 max_binlog_size = 500M [...

Change datadir mysql

If we want to change our datadir mysql, you should follow this steps : Stopping mysql service # /etc/init.d/mysqld stop Move or copy your original datadir directory to your new destination # mv /old/ /new/ Change ownership of new directory to user and group mysql # chown -R mysql:mysql /new/ Find your ib_logfile on new directory and delete it # rm -rf ib_logfile* Change datadir parameter on my.cnf # vi /etc/my.cnf Start your mysql server # /etc/init.d/mysql.server start

Bypass proxy on Linux environment

After we define proxy on our environment, we wanna bypass proxy for specific address. Here the way, edit your /etc/bashrc # vi /etc/bashrc --------- export http_proxy=http://aa.bb.cc.dd:xxxx export no_proxy="localhost, 10.0.0.0/8, 192.168.0.0/16, aaa.com" --------- Just relogin to your shell, and it changes. It's simple as blinking your eyes :p