When you reboot ubuntu cloud instance, sometimes it hang in boot screen with some lines such as:
random: nonblocking pool is initialized
or
random: init urandom read with 94 bits of entropy available
Reboot it, hard reboot but it was still stuck at that.
Solution: migrate instance to another compute host
Thứ Ba, 24 tháng 5, 2016
Thứ Tư, 18 tháng 5, 2016
Kernel hanging tty in CentOS 6.6
In CentOS 6.6, version kernel 2.6.32-504.el6.x86_64, sometimes I could not connect to the server.
I can run ssh but can not get tty console.
After googling, I saw a question in stackoverflow
http://stackoverflow.com/questions/26628274/kernel-hanging-the-tty-subsystem
/var/log/messages
I can run ssh
After googling, I saw a question in stackoverflow
http://stackoverflow.com/questions/26628274/kernel-hanging-the-tty-subsystem
/var/log/messages
kernel: INFO: task bash:44739 blocked for more than 120 seconds.
kernel: Not tainted 2.6.32-504.el6.x86_64 #1
kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
kernel: bash D 0000000000000006 0 44739 1 0x00000080
kernel: ffff88023acaf898 0000000000000046 0000000000000000 ffff8803b5580d00
kernel: ffff88023acaf868 ffffffff81271aa4 00004e9cd768ce30 ffff88043c279800
kernel: ffff88043c2799e0 0000000105231542 ffff88023bbe5098 ffff88023acaffd8
kernel: Call Trace:
kernel: [] ? blk_queue_bio+0x494/0x610
kernel: [] schedule_timeout+0x215/0x2e0
kernel: [] wait_for_common+0x123/0x180
kernel: [] ? default_wake_function+0x0/0x20
kernel: [] wait_for_completion+0x1d/0x20
kernel: [] flush_cpu_workqueue+0x61/0x90
kernel: [] ? wq_barrier_func+0x0/0x20
kernel: [] flush_workqueue+0x54/0x80
kernel: [] flush_scheduled_work+0x15/0x20
kernel: [] tty_ldisc_release+0x3c/0x90
kernel: [] tty_release_dev+0x40b/0x5e0
kernel: [] ? __dec_zone_page_state+0x2e/0x30
kernel: [] tty_release+0x1e/0x30
kernel: [] __fput+0xf5/0x210
kernel: [] fput+0x25/0x30
kernel: [] filp_close+0x5d/0x90
kernel: [] put_files_struct+0x7f/0xf0
kernel: [] exit_files+0x53/0x70
kernel: [] do_exit+0x18d/0x870
kernel: [] ? __sigqueue_free+0x3d/0x50
kernel: [] ? __dequeue_signal+0x102/0x200
kernel: [] do_group_exit+0x58/0xd0
kernel: [] get_signal_to_deliver+0x1f6/0x460
kernel: [] do_signal+0x75/0x800
kernel: [] ? __audit_syscall_exit+0x25e/0x290
kernel: [] do_notify_resume+0x90/0xc0
kernel: [] int_signal+0x12/0x17
or
kernel: INFO: task sshd:25489 blocked for more than 120 seconds.
kernel: Not tainted 2.6.32-504.el6.x86_64 #1
kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
kernel: sshd D 0000000000000000 0 25489 26121 0x00000080
kernel: ffff88023a8cf728 0000000000000082 0000000000000000 0000000000000000
kernel: ffff88023a8cf7f8 ffffffff8105ca34 00006b83e91acd8b ffff88023a8cf708
kernel: ffff88023a8cf880 00000001070847e8 ffff880239e48638 ffff88023a8cffd8
kernel: Call Trace:
kernel: [] ? find_busiest_group+0x244/0x9e0
kernel: [] schedule_timeout+0x215/0x2e0
kernel: [] wait_for_common+0x123/0x180
kernel: [] ? default_wake_function+0x0/0x20
kernel: [] wait_for_completion+0x1d/0x20
kernel: [] flush_work+0x77/0xc0
kernel: [] ? wq_barrier_func+0x0/0x20
kernel: [] flush_delayed_work+0x54/0x70
kernel: [] tty_flush_to_ldisc+0x15/0x20
kernel: [] n_tty_poll+0x67/0x1d0
kernel: [] tty_poll+0x8a/0xa0
kernel: [] do_select+0x3c5/0x7c0
kernel: [] ? ip_finish_output+0x148/0x310
kernel: [] ? __pollwait+0x0/0xf0
kernel: [] ? pollwake+0x0/0x60
kernel: [] ? pollwake+0x0/0x60
kernel: [] ? pollwake+0x0/0x60
kernel: [] ? pollwake+0x0/0x60
kernel: [] ? _spin_unlock_bh+0x1b/0x20
kernel: [] ? release_sock+0xe5/0x110
kernel: [] ? tcp_sendmsg+0x73c/0xa20
kernel: [] ? sock_aio_write+0x19b/0x1c0
kernel: [] ? tty_wakeup+0x3d/0x80
kernel: [] core_sys_select+0x18a/0x2c0
kernel: [] ? n_tty_read+0x3ad/0x950
kernel: [] ? autoremove_wake_function+0x0/0x40
kernel: [] sys_select+0x47/0x110
Solution: yum upgrade to install new kernel, and reboot system to using new kernel.
Chủ Nhật, 10 tháng 1, 2016
Fix SSH long delay connection in CentOS
Add 2 options in /etc/ssh/sshd_config
UseDNS noReload: systemctl reload sshd
GSSAPIAuthentication no
Thứ Tư, 23 tháng 12, 2015
Simulate fail disk in Linux
If you want to simulate fail disk when test any storage software such as CEPH, ScaleIO ...
Block any IO send to device:
echo offline > /sys/block/sda/device/state
Link:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/removing_path-to-storage-device.html
Block any IO send to device:
echo offline > /sys/block/sda/device/state
Re-enable:
echo running > /sys/block/sda/device/state
Link:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/removing_path-to-storage-device.html
Chủ Nhật, 13 tháng 12, 2015
Link hay về Flask
http://gouthamanbalaraman.com/blog/flask-app-directory-structure.html
https://realpython.com/blog/python/using-flask-login-for-user-management-with-flask/
http://blog.miguelgrinberg.com/post/using-celery-with-flask
https://realpython.com/blog/python/using-flask-login-for-user-management-with-flask/
http://blog.miguelgrinberg.com/post/using-celery-with-flask
Thứ Hai, 23 tháng 11, 2015
Shift + Delete
Tôi vừa repair lại con PC chạy Windows 7 và xóa đi những thứ mà mình đã tích được từ rất lâu. Những thứ thường dùng nhưng lại không mang lại lợi ích gì cho tôi trong công việc và cuộc sống.
Xóa đi trong cảm giác nhẹ tênh và thoải mái.
Đón chờ những thách thức và cơ hội mới.
Thứ Bảy, 21 tháng 11, 2015
Openstack, QoS and CEPH RBD
Bài này được làm theo guide sau:
http://www.sebastien-han.fr/blog/2013/12/23/openstack-ceph-rbd-and-qos/
Có mấy thông số có thể áp cho volume:
- Chuẩn bị 1 instance, tạo 1 disk default và attach vào instance.
- Tạo partion, tạo filesystem và mount vào sử dụng
- Test:
$ dd if=/dev/zero of=test.img bs=1M count=50 conv=fdatasync
Sử dụng fdatasync() để flush data xuống disk ( thay vì ghi tạm vào memorry buffer )
http://www.informit.com/articles/article.aspx?p=23618&seqNum=5
Kết quả: ~ 20MB/s
- Tạo QoS (limit write với tốc độ ~ 2MB/s)
# cinder qos-create low-write-bytes consumer="front-end" write_bytes_sec=2000000
- Tạo volume type
# cinder type-create low-write-bytes
- Gắn volume-type với qos
# cinder qos-associate <qos_specs> <volume_type_id>
- Tạo volume để test:
# cinder create --display-name vol_limit_speed --volume-type low-write-bytes 1
- Attach volume vào instance
- Test lại và kết quả. ~ 2MB/s
http://www.sebastien-han.fr/blog/2013/12/23/openstack-ceph-rbd-and-qos/
Có mấy thông số có thể áp cho volume:
- total_bytes_sec: the total allowed bandwidth for the guest per second
- read_bytes_sec: sequential read limitation (bytes/s)
- write_bytes_sec: sequential write limitation
- total_iops_sec: the total allowed IOPS for the guest per second
- read_iops_sec: random read limitation
- write_iops_sec: random write limitation
- Chuẩn bị 1 instance, tạo 1 disk default và attach vào instance.
- Tạo partion, tạo filesystem và mount vào sử dụng
- Test:
$ dd if=/dev/zero of=test.img bs=1M count=50 conv=fdatasync
Sử dụng fdatasync() để flush data xuống disk ( thay vì ghi tạm vào memorry buffer )
http://www.informit.com/articles/article.aspx?p=23618&seqNum=5
Kết quả: ~ 20MB/s
- Tạo QoS (limit write với tốc độ ~ 2MB/s)
# cinder qos-create low-write-bytes consumer="front-end" write_bytes_sec=2000000
- Tạo volume type
# cinder type-create low-write-bytes
- Gắn volume-type với qos
# cinder qos-associate <qos_specs> <volume_type_id>
- Tạo volume để test:
# cinder create --display-name vol_limit_speed --volume-type low-write-bytes 1
- Attach volume vào instance
- Test lại và kết quả. ~ 2MB/s
Đăng ký:
Bài đăng (Atom)

