Using the hadoop Native library

Hadoop has native implementations of certain components for performance reasons and for non-availability of Java implementations. These components are available in a single, dynamically-linked native library called the native hadoop library. On the *nix platforms the library is named libhadoop.so.
If the native library is not used, you will get warning shown as follows:
WARN util.NativeCodeLoader: Unable to load native-hadoop library ... 
We can compile hadoop from src to utilize the native library. The following steps can help you do so:

  1. Download hadoop src and untar the source code.
  2. Go to the src code directory and run the following compile command:
  3. mvn package -Pdist,native -DskipTests -Dtar
    If the compilation is successful, we can find the native library files under directory ./hadoop-dist/target/hadoop-2.2.0/lib/native
  4. Copy the compiled native library files to your working hadoop native library folder.
  5. cp hadoop-dist/target/hadoop-2.2.0/lib/native/* $HADOOP_HOME/lib/native
  6. Add the following two lines into your $HADOOP_HOME/etc/hadoop/hadoop-env.sh file
  7. export HADOOP_COMMON_LIB_NATIVE_DIR="$HADOOP_HOME/lib/native"
    export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=$HADOOP_HOME/lib/native" 
  8. No need to restart hadoop daemons and your native libraries will be used and the warning will be gone.

Twitter4j 3.0.3 example.

Twitter4j is a java library for Twitter API. Its latest release v3.0.3 is compatible with the twitter API, which requires support of OAuth. We notice that the old version twitter API v1.0 has retired. So, if you are still using API v1.0, you will encounter authentication errors.

Here is some starter code to get started with twitter4j 3.0.3:

import twitter4j.*;
import twitter4j.conf.ConfigurationBuilder;
import java.util.List;
public class GetTweets {
    public static void main(String[] args) {
        ConfigurationBuilder cb = new ConfigurationBuilder();
        cb.setOAuthConsumerKey("----");
        cb.setOAuthConsumerSecret("-----");
        cb.setOAuthAccessToken("------");
        cb.setOAuthAccessTokenSecret("------"); 
        TwitterFactory tf = new TwitterFactory(cb.build());
        Twitter twitter = tf.getInstance();
        System.out.println("connected");
        List ss = null;
        try {
            ss = twitter.getUserTimeline();
            System.out.println("Get user timeline:" );
            for(Status s : ss) {
                System.out.println(s.getUser().getName() + ":" + s.getText());
            }
        } catch (TwitterException e) {
            System.out.println("Get timeline: " + e + " Status Code: " + e.getStatusCode());
        }
        // search tweets.
        try {
            Query q = new Query("google");
            QueryResult r = twitter.search(q);
            for(Status s : r.getTweets()) {
                System.out.println("@" + s.getUser().getScreenName() + ":" + s.getText());
            }
        } catch (Exception e) {
            System.err.println("Error search tweets:" + e);
        }
    }
}
You should replace the '----' with your own authentication credentials. Compile the code with command:

javac -classpath /path/to/twitter4j-core-3.0.3.jar GetTweets.java
Run with command:
java -cp /path/to/twitter4j-core-3.0.3.jar:. GetTweets

解决Windows 7下软件乱码问题

如果所安装的中文软件不是采用Unicode编码,将导致的运行时产生乱码。解决方法其实很简单,按照以下顺序操作:

开始(Start)

控制面板(Control Panel)

地区和语言(Region and Languages)

在弹出的对话框里选择管理(Administrative),如下图所示:


选择设置系统场所(Change Sysem locale ... )

然后选择中文。(Chinese-RPC)如下图所示:


设置完成后系统需要重启。

重启之后就一切正常了。


Linux常用命令总结

Linux命令总结 (updated Jan. 9th 2013). 

  1. Install a printer from the web: localhost:631
  2. To play encrypted DVD using under linux, you need the libreadcss library. 
  3. nl ,给文件编上行号;
  4. tac,将文件以逆序行号输出;
  5. 删除以-开头的文件:rm -- -foo 或 rm ./-foo
  6. 内容替换命令:tr (翻译和替换命令),例如将文件中的大写字母替换称小写字母使用的命令是:cat foo | tr A-Z a-z
  7. nice 用来调整进程的优先级,默认情况下进程的优先级是10,优先级范围是[-20--19].
  8. banner命令,将输入的字符以大标题的形式显示出来。
  9. finger命令显示用户的信息。
  10. 给本系统或其他系统的用户发送邮件,例如:$ mail xxx@gmail.com 或:$ mail xxx,(其中xxx是本地一个用户。)
  11. write命令,给某个用户发送及时消息,用户必须在线,例如:$ write gsm, $ write xxx@gmail.com
  12. wall命令向系统中的所有用户发送广播消息,例如:$ wall "hello, good day"
  13. talk命令,向某个用户发送聊天邀请。例如: $ talk lili
  14. pg命令用来翻页阅读文件,例如 $ pg file_name
  15. cat -vte将不可见字符显示为特殊字符;-v 将非打印字符显示为可见字符,-t将tab键解释为^I,-e在行的末尾添加一个$.
  16. lsof 查看打开的文件,包括各种文件,例如pipe,socket,各种库文件等,如果想查看一个进程打开的文件的话这个命令就很有用了,例如查看2098号进程打开的文件,使用的命令为lsof -pn 2098
  17. lwp-download, lwp-mirror and lwp-rget commands can be used to retrieve website using (http) requests.
  18. sudo command can let common system users work as root on some privileged commands such as services, network management and so on.
  19. cut 命令可以将一个复杂的字符串根据指定的分隔符分割成几个部分,然后分别对这几个部分进行处理;
  20. join 将两个文件的内容合成一个;
  21. rev 将一个字符串进行反转,得到一个反向的字符串,这种操作对于取出带有全路径的文件名非常有用的。
  22. mtr ping和traceroute的组合体,用于检测网络的性能。
  23. atop,top的增强版,显示更多的信息,包括内存,cpu的summary等。
  24. scp rcp远程拷贝命令,例如scp hostname:/home/add/sohu ./
  25. nmap扫描机器的端口;

  26. 删除0字节文件 find -type f -size 0 -exec rm -rf {} \;
  27. 查看进程按内存从大到小排列 ps -e -o "%C : %p : %z : %a"|sort -k5 -nr
  28. 按cpu利用率从大到小排列 ps -e -o "%C : %p : %z : %a"|sort -nr
  29. 打印说cache里的URL : grep -r -a jpg /data/cache/* | strings | grep "http:" | awk -F'http:' '{print "http:"$2;}'
  30. 查看http的并发请求数及其TCP连接状态: netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
  31. sed -i '/Root/s/no/yes/' /etc/ssh/sshd_config sed在这个文里Root的一行,匹配Root一行,将no替换成yes.
  32. 如何杀掉mysql进程: ps aux|grep mysql|grep -v grep|awk '{print $2}'|xargs kill -9 (从中了解到awk的用途) killall -TERM mysqld kill -9 `cat /usr/local/apache2/logs/httpd.pid` 试试查杀进程PID
  33. 显示运行3级别开启的服务: ls /etc/rc3.d/S* |cut -c 15- (从中了解到cut的用途,截取数据)
  34. 如何在编写SHELL显示多个信息,用EOF cat << EOF +---------+ | === Welcome to Tunoff services === | +-------+ EOF
  35. for 的巧用(如给mysql建软链接) cd /usr/local/mysql/bin for i in * do ln /usr/local/mysql/bin/$i /usr/bin/$i done
  36. 取IP地址: ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|cut -c 6- 或者 ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
  37. 内存的大小: free -m |grep "Mem" | awk '{print $2}'
  38. netstat -an -t | grep ":80" | grep ESTABLISHED | awk '{printf "%s %s\n",$5,$6}' | sort
  39. 查看Apache的并发请求数及其TCP连接状态:
  40. netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
  41. 因为同事要统计一下服务器下面所有的jpg的文件的大小,写了个shell给他来统计.原来用xargs实现,但他一次处理一部分,搞的有多个总和....,下面的命令就能解决啦. find / -name *.jpg -exec wc -c {} \;|awk '{print $1}'|awk '{a+=$1}END{print a}' CPU的数量(多核算多个CPU,cat /proc/cpuinfo |grep -c processor)越多,系统负载越低,每秒能处理的请求数也越多。
  42. CPU负载 # cat /proc/loadavg 检查前三个输出值是否超过了系统逻辑CPU的4倍。
  43. CPU负载 #mpstat 1 1 检查%idle是否过低(比如小于5%)
  44. 内存空间 # free 检查free值是否过低 也可以用 # cat /proc/meminfo
  45. swap空间 # free 检查swap used值是否过高 如果swap used值过高,进一步检查swap动作是否频繁: # vmstat 1 5 观察si和so值是否较大
  46. 磁盘空间 # df -h 检查是否有分区使用率(Use%)过高(比如超过90%) 如发现某个分区空间接近用尽,可以进入该分区的挂载点,用以下命令找出占用空间最多的文件或目录: # du -cks * | sort -rn | head -n 10
  47. 磁盘I/O负载: # iostat -x 1 2 检查I/O使用率(%util)是否超过100% 23 网络负载 # sar -n DEV 检查网络流量(rxbyt/s, txbyt/s)是否过高
  48. 网络错误 # netstat -i 检查是否有网络错误(drop fifo colls carrier) 也可以用命令:# cat /proc/net/dev
  49. 网络连接数目 # netstat -an | grep -E “^(tcp)” | cut -c 68- | sort | uniq -c | sort -n
  50. 进程总数 # ps aux | wc -l 检查进程个数是否正常 (比如超过250)
  51. 可运行进程数目 # vmwtat 1 5 列给出的是可运行进程的数目,检查其是否超过系统逻辑CPU的4倍
  52. 进程 # top -id 1 观察是否有异常进程出现
  53. 网络状态 检查DNS, 网关等是否可以正常连通
  54. 用户 # who | wc -l 检查登录用户是否过多 (比如超过50个) 也可以用命令:# uptime
  55. 系统日志 # cat /var/log/rflogview/*errors
  56. 检查是否有异常错误记录 也可以搜寻一些异常关键字,例如: # grep -i error /var/log/messages # grep -i fail /var/log/messages
  57. 核心日志 # dmesg 检查是否有异常错误记录
  58. 系统时间 # date 检查系统时间是否正确
  59. 打开文件数目 # lsof | wc -l 检查打开文件总数是否过多
  60. 日志 # logwatch –print 配置/etc/log.d/logwatch.conf,将 Mailto 设置为自己的email 地址,启动mail服务 (sendmail或者postfix),这样就可以每天收到日志报告了。缺省logwatch只报告昨天的日志,可以用# logwatch –print –range all 获得所有的日志分析结果。可以用# logwatch –print –detail high 获得更具体的日志分析结果(而不仅仅是出错日志)。
  61. 杀掉80端口相关的进程 lsof -i :80|grep -v "PID"|awk '{print "kill -9",$2}'|sh
  62. 清除僵死进程。ps -eal | awk '{ if ($2 == "Z") {print $4}}' | kill -9
  63. tcpdump 抓包 ,用来防止80端口被人攻击时可以分析数据 # tcpdump -c 10000 -i eth0 -n dst port 80 > /root/pkts
  64. 然后检查IP的重复数 并从小到大排序 注意 "-t\ +0" 中间是两个空格: # less pkts | awk {'printf $3"\n"'} | cut -d. -f 1-4 | sort | uniq -c | awk {'printf $1" "$2"\n"'} | sort -n -t\ +0
  65. 查看有多少个活动的php-cgi进程: # netstat -anp | grep php-cgi | grep ^tcp | wc -l chkconfig --list | awk '{if ($5=="3:on") print $1}'
  66. kudzu查看网卡型号 kudzu --probe --class=network
  67. 设定默认的编辑器:$EDITOR 环境变量。
  68. 清空或创建一个文件 > file.txt
  69. 用ssh创建端口转发通道 ssh -N -L2001:remotehost:80 user@somemachine 这个命令在本机打开了2001端口,对本机2001端口的请求通过somemachine作为跳板,转到remotehost的 80端口上。实现效果跟术语反向代理是相似的,实际上就是端口转发,注意上面的描述涉及了3台主机,但当然somemachine可 以变成localhost。这个命令比较抽象,但有时候是很有用的,比如因为众所周知的原因国内的IP的80端口无法使用,又或者公司的防火墙只给外网开了ssh端口,需要访 问内部服务器一个web应用,以及需要访问某些限定了来源IP的服务,就可以用上这个方法了。举一个具体例子,运行:ssh -f -N -L 0.0.0.0:443:twitter.com:443 shell.cjb.netssh -f -N -L 0.0.0.0:80:twitter.com:80 shell.cjb.net 然后在/etc/hosts里面添加127.0.0.1 twitter.com.
  70. 重置终端 reset
  71. 在午夜的时候执行某命令 echo cmd | at midnight
  72. 远程传送麦克风语音 dd if=/dev/dsp | ssh username@host dd of=/dev/dsp
  73. 映射一个内存目录 mount -t tmpfs -o size=1024m tmpfs /mnt/ram
  74. 用diff对比远程文件跟本地文件 ssh user@host cat /path/to/remotefile | diff /path/to/localfile -
  75. 查看系统中占用端口的进程 netstat -tulnp 
  76.   Netstat是很常用的用来查看Linux网络系统的工具之一,这个参数可以背下来:
  77.   -t: 显示TCP链接信息
  78.   -u: 显示UDP链接信息
  79.   -l: 显示监听状态的端口
  80.   -n: 直接显示ip,不做名称转换
  81.   -p: 显示相应的进程PID以及名称(要root权限)
  82.   如果要查看关于sockets更详细占用信息等,可以使用lsof工具。

  83. Linux command line editing:
  84. Ctrl-k kill from cursor to the end of line.
  85. Ctrl-u kill from cursor to the beginning of line.
  86. Ctrl-y paste content to cursor position.
  87. Ctrl-t exchange character.
  88. Alt-t exchange words.
  89. Alt-u Uppercase word.
  90. Alt-l Lowercase word.
  91. Alt-? List possible completions.
  92. Alt-* Insert all possible completions.

  93. sar 查看系统状态的综合命令。
  94. iostat 查看 CPU 负载,硬盘状况
  95. mpstat 查看多处理器状态。
  96. iptraf 实时网络状态监控。
  97. Stop/Halt a user named didi. : skill -STOP -u didi
  98. resume a halted user: skill -CONT -u didi
  99. kill and logout user called didi. skill -KILL -u didi
  100. kill and logout all users. skill -KILL -v /dev/pts/*
  101. kill a program by it's name. kill PROG_NAME
  102. disable enforcement of selinux. setenforce 0 sudo echo 0 > /selinux/enforce
  103. lpstat query status of printing jobs
  104. lpq show the queue status;
  105. Use hwclock --systohc --localtime to change the time from UTC to local time;
  106. In xinetd.conf, bind rather than server is used to sign the address of the service;
  107. The /etc/nsswitch.conf defines the source order for security configuration. 
  108. Encryption: When A uses encryption to send data specifically to B, it encrypts the data using B's public key, so that B can decrypt the message after receiving it from A.
  109. cupsdisable will disable print service and cups enables the disabled service
  110. vmstat Monitor virtual memory
  111. pmap Display/examine memory map and libraries (so). Usage: pmap pid
  112. sar -B Show statistics on page swapping.
  113. time -v date Show system page size, page faults, etc of a process during execution. Note you must fully qualify the command as "/usr/bin/time" to avoid using the bash shell command "time".
  114. cat /proc/sys/vm/freepages Display virtual memory "free pages". One may increase/decrease this limit: echo 300 400 500 > /proc/sys/vm/freepages
  115. cat /proc/meminfo Show memory size and usage.
  116. To create a background process that will not hang after user exist, we can use command nohup. 
  117. To put a process into background, use three steps 1) ctrl-z 2)bg 3) disown -h 
  118. Print each item in a CSV file: for line in `cat dpgdp.csv`; do  for i in `echo $line | tr ',' ' '`; do echo $i; done; echo '============='; done;


EIGRP Lab Experiments

EIGRP Lab Experiments

This lab includes the following topics:
Ø  IGRP packet/message types;
Ø  EIGRP terminologies;
Ø  EIGRP Data Structures;
Ø  EIGRP summarization, load balancing, authentication;
Ø  EIGRP parameter tunning;
Ø  EIGRP trouble shooting and miscellaneous topics;
The configuration of this lab is show as in the following diagram.
Router R1 is the Head quarter R2 and R3 are connected to R1 using Frame-Relay. R4 is redundant link between R1 and R3 with ppp connection. R1 is connected with LAN 10.1.1-3.0/24 and R2 and R3 are connected to LAN 192.168.1.0/24.

Configuration Steps:

Step 1:

Configure the routers as the diagram shows, also note that in order to simulate a LAN environment on R1, I used loopback interface. So you need to configure the loopback interface from 0 to 2. Also, don't forget to issue the "no shutdown command". In this lab, the Frame-Relay configuration is the one I want to note here. In order to ease the effort of configuration, I used Point-To-Point sub-interfaces on routers R1, R2 and R3.

Step 2:

Configure the EIGRP routing protocol on all the routers which you want to participate in the EIGRP process. Example, for Router R1, you need to issue the following command on the router.
router eigrp 1
network 10.0.0.0
network 190.16.0.0
network 220.1.100.0
no auto-summary
After that, EIGRP should work. This can be verified with the following commands.
Check the Routing table.
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
16.0.0.0/30 is subnetted, 1 subnets
C       16.1.3.0 is directly connected, Serial0/0.103
220.1.100.0/30 is subnetted, 1 subnets
C       220.1.100.0 is directly connected, Serial0/0.102
190.16.0.0/16 is variably subnetted, 3 subnets, 3 masks
C       190.16.8.2/32 is directly connected, Serial0/1
C       190.16.8.0/30 is directly connected, Serial0/1
D       190.16.0.0/16 [90/3196416] via 220.1.100.2, 00:01:12, Serial0/0.102
172.16.0.0/16 is variably subnetted, 3 subnets, 3 masks
D EX    172.16.1.1/32 [170/2684416] via 220.1.100.2, 00:01:12, Serial0/0.102
D       172.16.0.0/16 [90/2681856] via 190.16.8.2, 00:01:28, Serial0/1
D       172.16.1.0/30 [90/2684416] via 220.1.100.2, 00:01:12, Serial0/0.102
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C    10.1.3.0/24 is directly connected, Loopback2
C    10.1.2.0/24 is directly connected, Loopback1
C    10.1.1.0/24 is directly connected, Loopback0
D    10.1.0.0/22 is a summary, 00:01:41, Null0
D    192.168.1.0/24 [90/2172416] via 220.1.100.2, 00:01:13, Serial0/0.102

Check EIGRP neighbors

R1# show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H   Address       Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                      (sec)    (ms)   Cnt Num
1   220.1.100.2   Se0/0.102         13 00:04:12   32   200  0  7
0   190.16.8.2    Se0/1             10 00:04:27  413  2478  0  10

Check EIGRP topology data structure.
R1#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(10.1.3.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 10.1.3.0/24, 1 successors, FD is 128256
via Connected, Loopback2
P 10.1.2.0/24, 1 successors, FD is 128256
via Connected, Loopback1
P 10.1.1.0/24, 1 successors, FD is 128256
via Connected, Loopback0
P 10.1.0.0/22, 1 successors, FD is 128256
via Summary (128256/0), Null0
P 16.1.3.0/30, 0 successors, FD is Inaccessible
via 220.1.100.2 (2684416/2172416), Serial0/0.102
via 190.16.8.2 (3193856/2681856), Serial0/1
P 192.168.1.0/24, 1 successors, FD is 2172416
via 220.1.100.2 (2172416/28160), Serial0/0.102
P 190.16.8.2/32, 1 successors, FD is 2169856
via Rconnected (2169856/0)
P 190.16.8.0/30, 1 successors, FD is 2169856
via Connected, Serial0/1
P 190.16.8.1/32, 0 successors, FD is Inaccessible

--- OMITTED FOR CONCISE ---

Step 3:

We will investigate the process of how EIGRP neibhbors are formed. This can be done using the debug command. Also note that if you can't see the debug messages you need to enable console monitoring and logging under the configuration mode. In this step we also want to see EIGRP hello, update, query, reply and ack messages with the help of the debug command.
We first go to router R1 and issue the "debug eigrp neighbor" command, then go to router R4 and shutdown interface Serial0/0. When hold-down timer expires on R1, we can see the neighbor going down.
R1#debug eigrp neighbors
*Mar  1 00:18:38.895: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 190.16.8.2 (Serial0/1) is down: holding time expired
*Mar  1 00:18:38.911: EIGRP: Neighbor 190.16.8.2 went down on Serial0/1
*Mar  1 00:30:15.163: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 190.16.8.2 (Serial0/1) is down: holding time expired

After that, we bring up the Serial 0/0 interface on R4 and will notice the process of how the neighbors are formed.
*Mar  1 00:30:26.623: IP-EIGRP: Callback: redist frm connected AS 0 190.16.8.2/32
*Mar  1 00:30:26.623:           into: eigrp AS 1  event: 2
*Mar  1 00:30:26.691: IP-EIGRP: Callback: redist frm connected AS 0 190.16.8.2/32
*Mar  1 00:30:26.695:           into: eigrp AS 1  event: 1
*Mar  1 00:30:26.695: IP-EIGRP(Default-IP-Routing-Table:0): Callback: redist connected (config change) Serial0/1
*Mar  1 00:30:28.723: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 190.16.8.2 (Serial0/1) is up: new adjacency
Next we will investigate EIGRP messages.
R1#debug eigrp packets hello
EIGRP Packets debugging is on
    (HELLO)
R1#
*Mar  1 00:40:31.991: EIGRP: Sending HELLO on Serial0/1
*Mar  1 00:40:31.991:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
*Mar  1 00:40:31.995: EIGRP: Sending HELLO on Loopback2
*Mar  1 00:40:31.995:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
*Mar  1 00:40:31.995: EIGRP: Received HELLO on Loopback2 nbr 10.1.3.1
*Mar  1 00:40:31.995:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0
*Mar  1 00:40:32.239: EIGRP: Received HELLO on Serial0/0.102 nbr 220.1.100.2
*Mar  1 00:40:32.239:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Mar  1 00:40:34.015: EIGRP: Received HELLO on Serial0/1 nbr 190.16.8.2


In order to see QUERY, REPLY and ACK messages, we need to simulate a real world link outage. Here, we again shut down the Serial 0/0 interface of R4 and then bring it back up.
*Mar 1 00:46:12.867: EIGRP: Received QUERY on Serial0/0.102 nbr 220.1.100.2
*Mar  1 00:46:12.867:   AS 1, Flags 0x0, Seq 153/101 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Mar  1 00:46:12.871: EIGRP: Enqueueing ACK on Serial0/0.102 nbr 220.1.100.2
*Mar  1 00:46:12.871:   Ack seq 153 iidbQ un/rely 0/0 peerQ un/rely 1/0
*Mar  1 00:46:12.875: EIGRP: Sending ACK on Serial0/0.102 nbr 220.1.100.2
*Mar  1 00:46:12.879:   AS 1, Flags 0x0, Seq 0/153 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 1/0
*Mar  1 00:46:12.883: EIGRP: Enqueueing QUERY on Serial0/1 iidbQ un/rely 0/1 serno 86-86
*Mar  1 00:46:12.883: EIGRP: Enqueueing QUERY on Serial0/0.102 iidbQ un/rely 0/1 serno 86-86
*Mar  1 00:46:12.887: EIGRP: Enqueueing QUERY on Serial0/1 nbr 190.16.8.2 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 86-86
*Mar  1 00:46:12.891: EIGRP: Enqueueing QUERY on Serial0/0.102 nbr 220.1.100.2 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 86-86
*Mar  1 00:46:12.899: EIGRP: Sending QUERY on Serial0/1 nbr 190.16.8.2
*Mar  1 00:46:12.899:   AS 1, Flags 0x0, Seq 103/101 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 86-86
*Mar  1 00:46:13.155: EIGRP: Sending QUERY on Serial0/1 nbr 190.16.8.2, retry 1, RTO 369
*Mar  1 00:46:25.055: EIGRP: Sending QUERY on Serial0/1 nbr 190.16.8.2, retry 8, RTO 5000
*Mar  1 00:46:25.059:   AS 1, Flags 0x0, Seq 103/101 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 86-86
*Mar  1 00:46:26.643: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 190.16.8.2 (Serial0/1) is down: holding time expired
*Mar  1 00:46:26.663: EIGRP: Enqueueing REPLY on Serial0/0.102 nbr 220.1.100.2 iidbQ un/rely 0/1 peerQ un/rely 0/0 serno 87-87
*Mar  1 00:46:26.671: EIGRP: Sending REPLY on Serial0/0.102 nbr 220.1.100.2
*Mar  1 00:46:26.675:   AS 1, Flags 0x0, Seq 105/153 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 87-87
*Mar  1 00:46:26.707: EIGRP: Received ACK on Serial0/0.102 nbr 220.1.100.2

We can show the EIGRP traffic statistics with the show ip eigrp traffic command.
R1#show ip eigrp traffic
IP-EIGRP Traffic Statistics for AS 1
  Hellos sent/received: 3265/3166
  Updates sent/received: 72/75
  Queries sent/received: 73/11
  Replies sent/received: 12/27
  Acks sent/received: 89/89
  Input queue high water mark 3, 0 drops
  SIA-Queries sent/received: 0/0
  SIA-Replies sent/received: 0/0
  Hello Process ID: 134
  PDM Process ID: 133


Step 4:

We will get familiar with FD, AD, successor, feasible successor.
R1#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(10.1.3.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
P 10.1.3.0/24, 1 successors, FD is 128256
        via Connected, Loopback2
P 10.1.2.0/24, 1 successors, FD is 128256
        via Connected, Loopback1
P 10.1.1.0/24, 1 successors, FD is 128256
        via Connected, Loopback0
P 10.1.0.0/22, 1 successors, FD is 128256
        via Summary (128256/0), Null0
P 16.1.3.0/30, 0 successors, FD is Inaccessible
        via 190.16.8.2 (3193856/2681856), Serial0/1
        via 220.1.100.2 (2684416/2172416), Serial0/0.102
P 192.168.1.0/24, 1 successors, FD is 2172416
        via 220.1.100.2 (2172416/28160), Serial0/0.102
P 190.16.8.2/32, 1 successors, FD is 2169856
        via Rconnected (2169856/0)
P 190.16.8.0/30, 1 successors, FD is 2169856
        via Connected, Serial0/1
P 190.16.8.1/32, 0 successors, FD is Inaccessible
        via 190.16.8.2 (2681856/2169856), Serial0/1

Step 5:

We will investigate summarization, authentication and load balancing.
I am going to configure R1 so that it only advertise the summarized address of networks 10.1.1-3.0/24 to router R4.
interface Serial0/1
 ip address 190.16.8.1 255.255.255.252
 encapsulation ppp
 ip summary-address eigrp 1 10.1.0.0 255.255.252.0 5
 serial restart-delay 0
end


Then under R4, let's check the result.
R4#show ip route
-- Omitted for Simplicity. --

10.0.0.0/22 is subnetted, 1 subnets
D       10.1.0.0 [90/2297856] via 190.16.8.1, 00:01:22, Serial0/0
Authentication of EIGRP neighbors utilizes key chain. So, first we need to define key chain.
key chain R1TOR4
 key 1
  key-string cisco
  accept-lifetime 10:00:00 Mar 8 2010 11:00:00 Mar 8 2010
  send-lifetime 11:00:00 Mar 8 2010 12:00:00 Mar 8 2010
 key 2
  key-string simon
  accept-lifetime 11:00:00 Mar 8 2010 12:00:00 Mar 8 2010
  send-lifetime 11:00:00 Mar 8 2010 12:00:00 Mar 8 2010
After that we need to configure the authentication under the interface of the neighbor.
ip authentication key-chain eigrp 1 R1TOR4
Also please note, we have to define the same configuration on the other side of the neighbor relationship. And in order for authentication to work, the two neighbors should have synchronized system clock. This can be done with the ntp service. For more information, please check related documents.
Next let's work on load-balancing. By default, EIGRP will load balance 4 equal cost routes. We can change this number by tunning the maximum-paths parameter. More importantly, we can configure to let EIGRP do unequal cost load-balancing with the variance command.
We can show the current path number by the following command
R3#show ip protocols
Routing Protocol is "eigrp 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 1
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 2
  Routing for Networks:

    16.0.0.0
    172.16.0.0
    192.168.1.0
Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.1.1           90      00:00:03
    172.16.1.1            90      00:00:03
  Distance: internal 90 external 170
Then, let's evaluate the unequal cost load balancing on router R3.
Variance = 1
D  10.1.0.0 [90/2300416] via 192.168.1.1, 00:00:03, FastEthernet1/0
 Variance = 2
D  10.1.0.0 [90/2300416] via 192.168.1.1, 00:00:03, FastEthernet1/0
[90/2809856] via 172.16.1.1, 00:00:03, Serial0/1

Step 6:

Finally, let's tune the timers, metrics and other miscellaneous parameters of EIGRP.
In order to change timers, we need to go to the specific interface, and issue: "ip hello-interval eigrp 1 10" or "ip hold-time eigrp 1 40".
Metrics are lated to the K value of eigrp routing protocol. It can be tuned with "metric weights 0 1 0 1 0 0"
Setting default network is always very helpful sometimes. Under EIGRP, we can use the default network command to do this. This doesn't work on my lab environment.
Also, we can use the classic "ip route 0.0.0.0 0.0.0.0 " command to do this.
First, let's set the default route under router R1 and the default route is to interface loopback 3. Then we propogate this default route to R1' neighbor R4. Then we can check the result using the "show ip route" command.
conf t
ip route 0.0.0.0 0.0.0.0 lo 3
router eigrp 1
network 0.0.0.0

R1#show ip route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
S*   0.0.0.0/0 is directly connected, Loopback3

R4#show ip route
Gateway of last resort is 190.16.8.1 to network 0.0.0.0
D*   0.0.0.0/0 [90/2297856] via 190.16.8.1, 00:10:48, Serial0/0