Latest Entries »

1.Đầu tiên remove

rpm -e yum-rhn-plugin –nodeps.

rpm -e redhat-release-notes-6Server  –nodeps.

2.Tùy vào phiên bản  OS đang sử dụng: down gói release tương ứng.

rpm -e http://mirror.centos.org/centos/6.3/os/x86_64/Packages/centos-release-6-3.el6.centos.9.x86_64.rpm

3.yum update

 

Smokeping Test

Tham khảo cài đặt ở đây:

http://www.how2centos.com/installing-smokeping-on-centos-5-5/

Chú ý như sau:

+ symlink cho đúng ln -s /opt/smokeping/htdocs/smokeping.cgi /var/www/html/smokeping/smokeping.cgi
+ chạy xem config đúng chưa: /opt/smokeping/bin/smokeping –debug
+ Config chạy multi probe: echoping/curl:

cat /opt/smokeping/etc/config
*** General ***

owner    = Peter Random
contact  = some@address.nowhere
mailhost = my.mail.host
sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed … this is not
# good for images.
imgcache = /var/www/html/smokeping/img
imgurl   = http://10.254.53.245/smokeping/img
datadir  = /opt/smokeping/data
piddir  = /opt/smokeping/var
cgiurl   = http://10.254.53.245/smokeping/smokeping.cgi
smokemail = /opt/smokeping/etc/smokemail
tmail = /opt/smokeping/etc/tmail

# specify this to get syslog logging
syslogfacility = local0

# each probe is now run in its own process
# disable this to revert to the old behaviour
# concurrentprobes = no

*** Alerts ***
to = alertee@address.somewhere
from = smokealert@company.xy

+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times  in a row

*** Database ***

step     = 10
pings    = 20

# consfn mrhb steps total

AVERAGE  0.5   1  1008
AVERAGE  0.5  12  4320
MIN  0.5  12  4320
MAX  0.5  12  4320
AVERAGE  0.5 144   720
MAX  0.5 144   720
MIN  0.5 144   720

*** Presentation ***

template = /opt/smokeping/etc/basepage.html

+ charts

menu = Charts
title = The most interesting destinations

++ stddev
sorter = StdDev(entries=>4)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f

++ max
sorter = Max(entries=>5)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds

++ loss
sorter = Loss(entries=>5)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f

++ median
sorter = Median(entries=>5)
title = Top Median Roundtrip Time
menu = by Median
format = Median RTT %f seconds

+ overview

width = 600
height = 50
range = 10h

+ detail

width = 600
height = 200
unison_tolerance = 2

“Last 3 Hours”    3h
“Last 30 Hours”   30h
“Last 10 Days”    10d
“Last 400 Days”   400d

#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location

*** Probes ***

+ EchoPingHttp       # HTTP (80/tcp) for web servers and caches

binary = /usr/bin/echoping
pings = 5
port = 80
timeout = 1
url = /

+ Curl

binary = /usr/bin/curl
forks = 5
offset = 50%
step = 10

*** Targets ***
# default probe
probe = EchoPingHttp

menu = Top
title = Network Latency Grapher
remark = Welcome to this SmokePing website.

+ Myservers

menu = My Servers
title = My Servers

++ http
menu = http
title = fuck
host = thethao.vnexpress.net

++ sohoa
menu = sohoa
title = sohoa
host = sohoa.vnexpress.net
++ giaitri
menu = giatri
title= Get JS giaitri
host = st.f3.giaitri.vnexpress.net
url = /j/v34/jquery-ui-1.8.22.custom.js

+ services
menu = Service latency
title = Service latency (HTTP)

probe = Curl # if this should be the default probe
++ mytarget
host = st.f3.giaitri.vnexpress.net
pings = 5
timeout = 20

urlformat = http://%host%/j/v34/jquery-ui-1.8.22.custom.js

Kết quả:

Debug thold cacti

10/09/2012 09:30:07 AM – CMDPHP: Poller[0] Host[89] Description[x.x.x.x] DS[1804] Graphs[‘x.x.x.x- Traffic – eth0’] SNMP: v2: x.x.x.x, dsname: traffic_out, oid: .1.3.6.1.2.1.31.1.1.1.10.2, output: 150121536136767
10/09/2012 09:35:07 AM – CMDPHP: Poller[0] Host[89] Description[x.x.x.x] DS[1804] Graphs[‘x.x.x.x’] SNMP: v2: x.x.x.x, dsname: traffic_out, oid: .1.3.6.1.2.1.31.1.1.1.10.2, output: 150137122666528

Với thông log như vậy cho thấy từ phút 9:30 – 9:35 150137122666528 – 150121536136767 =15586529761 bytes.

Để chuyển sang bit x 8 = 124692238088 bit và thông tin này được lầy trong khoảng 5 phút =300s.Vậy trung bình 1s sẽ là = 415640793 ~400Mbit/s

Để đặt cho traffic với High Threshold 943718400 ~ 900Mbit/s sẽ alert.

Tham khảo:http://cactiusers.org/forums/topic435.html

Haproxy Bug ^.^

Vì location khác nhau nên khi cụm A lấy resource cụm B khá chậm,sửa lại weight =1 chạy tôt hơn so với weight=10.Đồng thời fullconn trong backend có bug phải set fullconn < maxconn-server1+ maxconn-server2 nếu  không thì không thể xử lý request được.

backend abc
mode http
fullconn 40000
balance roundrobin
option redispatch
cookie JSESSIONID prefix
option abortonclose
option forwardfor

server static-ddd x.x.x.x cookie B weight 1 minconn 500 maxconn 20096 check
server static-ccc  y.y.y.y  cookie B weight 1 minconn 500 maxconn 20096 check

Adding a launcher/desktop icon

Đang kiếm editor thay thế notepad++ bên linux dùng Sublime Text 2 rất good,down về chỉ là binary không add vào launhcer trên ubuntu được.Google một hồi có bác nào đó fix rồi.Taọ một file .desktop và đặt vào /usr/share/applications.

/usr/share/applications/sublime.desktop: nội dung như sau:

[Desktop Entry]
Name=SublimeText
GenericName=Text Editor
Comment=Edit text files
Exec=sublime_text
Terminal=false
Type=Application
StartupNotify=true
MimeType=text/plain;
Icon=/opt/SublimeText2/Icon/128×128/sublime_text.png
Categories=GNOME;GTK;Utility;TextEditor;

Bác nào lỡ remove gói rpm thì khi copy các file lên rpm,rpmdb chạy lện sau vẫn sẽ có lỗi:

“error: can’t create transaction lock on /”

Copy các file sau sẽ hết

for x in 10; do scp /usr/lib/rpm/macros root@$x:/usr/lib/rpm/macros done;
for x in 10; do scp /usr/bin/rpmdb root@$x:/usr/bin/rpmdb ;done
for x in 10; do scp /usr/lib/rpm/rpmrc root@$x:/usr/lib/rpm/rpmrc ;done
for x in 10; do scp /bin/rpm root@$x:/bin/rpm ;done

Tunning file-nr and file-max

Đối với các hệ thống web server khi chạy ở mức tải cào và nhiều CCU thì các thông số nay sẽ rất nhanh chạm ngưỡng,vì vậy ta nên set lại các thông số này để đảm bảo hê thống smooth :


[root@atuladn root]# echo 100000 > /proc/sys/fs/file-max

cat /proc/sys/fs/file-nr

20910    0    767192
File-nr có ba tham số quan trong nhất tham số đầu số file handles đang mở trên hệ thống dựa vào đây ta có thể tinh chỉnh file-max thích hợp nhât

./countkeyredis.py -p 6379 localhost
Traceback (most recent call last):
File “./countkeyredis.py”, line 30, in ?
redis_info = r.info()
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 380, in info
return self.execute_command(‘INFO’)
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 253, in execute_command
‘*%s\r\n%s’ % (len(cmds), ”.join(cmds)),
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 239, in _execute_command
return self.parse_response(command_name, **options)
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 261, in parse_response
return self.RESPONSE_CALLBACKS[command_name](response, **options)
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 81, in parse_info
info[key] = get_value(value)
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 66, in get_value
k, v = item.rsplit(‘=’, 1)

Source: client.py

Org:

 sub_dict = {}
        for item in value.split(‘,’):
            k, v = item.rsplit(‘=’, 1)
            try:
                sub_dict[k] = int(v)
            except ValueError:
                sub_dict[k] = v
        return sub_dict
Fix:

if ‘=’ in value:
sub_dict = {}
for item in value.split(‘,’):
k, v = item.rsplit(‘=’, 1)
try:

sub_dict[k] = int(v)
except ValueError:
sub_dict[k] = v
return sub_dict
else:
return value.split(‘,’)

Distributed file system

Công ty lại mua storage là SAN để lưu trữ mọi thứ nhưng chạy với các distributed file system có vẻ không ổn khi tất cả server đều phải mount từ SAN lên,hệ quả không tận dụng được resource trên server như disk,cpu,network đều phải respond từ SAN lên gluster dùng trong hệ thống này cực chậm mình từng thấy.

Mình sẽ thử lần lượt:
+ Gluster
+ Ceph
+ sheepdog
+ datafarm.apgrid.org
+ xtreemfs
+ http://www.fhgfs.com : strip file rất tốt tuy nhiên khi stop thử 1 storage thì client không thế thấy được 1 phân vùng mount
…..

Project Url forward/frame

Đọc tài liệu và đã nghiên cứu ra cách để name server co thể chạy url forwar/redirect giống vdns,digipower..
Demo: