2015-05-13 19 views
7

Tôi đã tải và cài đặt tĩnh liên kết docker 1.6.1 từ site này, và chạy nó trên RHEL 7.1:Làm cách nào để bật đồng bộ hóa udev trong docker?

[[email protected] bin]# ./docker -d 
WARN[0000] Udev sync is not supported. This will lead to unexpected behavior, data loss and errors 
INFO[0000] +job init_networkdriver() 
INFO[0000] +job serveapi(unix:///var/run/docker.sock) 
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 
INFO[0000] -job init_networkdriver() = OK (0) 
INFO[0000] Loading containers: start. 

INFO[0000] Loading containers: done. 
INFO[0000] docker daemon: 1.6.1 97cd073; execdriver: native-0.2; graphdriver: devicemapper 
INFO[0000] +job acceptconnections() 
INFO[0000] -job acceptconnections() = OK (0) 
INFO[0000] Daemon has completed initialization 

tôi có thể nhìn thấy ở đó là một lời cảnh báo: "Udev sync is not supported. This will lead to unexpected behavior, data loss and errors", và sau khi kiểm tra mã docker nguồn, tôi tìm các bản ghi cảnh báo là từ deviceset.go:

func (devices *DeviceSet) initDevmapper(doInit bool) error { 
    ...... 

    // https://github.com/docker/docker/issues/4036 
    if supported := devicemapper.UdevSetSyncSupport(true); !supported { 
     log.Warnf("Udev sync is not supported. This will lead to unexpected behavior, data loss and errors") 
    } 
    log.Debugf("devicemapper: udev sync support: %v", devicemapper.UdevSyncSupported()) 

    ...... 
} 

các devicemapper.UdevSetSyncSupport là như thế này:

// UdevSyncSupported returns whether device-mapper is able to sync with udev 
// 
// This is essential otherwise race conditions can arise where both udev and 
// device-mapper attempt to create and destroy devices. 
func UdevSyncSupported() bool { 
    return DmUdevGetSyncSupport() != 0 
} 

// UdevSetSyncSupport allows setting whether the udev sync should be enabled. 
// The return bool indicates the state of whether the sync is enabled. 
func UdevSetSyncSupport(enable bool) bool { 
    if enable { 
     DmUdevSetSyncSupport(1) 
    } else { 
     DmUdevSetSyncSupport(0) 
    } 
    return UdevSyncSupported() 
} 

Tôi có thể thấy lý do cho phép không thể đồng bộ hóa udev. Làm cách nào để bật đồng bộ hóa udev thành công?

Cập nhật: Sau khi kiểm tra mã tháo của dm_udev_set_sync_support:

(gdb) disassemble dm_udev_set_sync_support 
Dump of assembler code for function dm_udev_set_sync_support: 
=> 0x0000000000a3e4e0 <+0>:  repz retq 
End of assembler dump. 

Nó là một hàm rỗng và không có gì, không đề cập đến thiết lập hỗ trợ đồng bộ hóa. Điều này có nghĩa là nhị phân docker được xây dựng tĩnh này không sử dụng?

Trả lời

0

Tôi không thể tái tạo sự cố của bạn; Tôi nhận được những điều sau đây:

(gdb) disassemble dm_udev_set_sync_support 
Dump of assembler code for function [email protected]: 
    0x0000000000403420 <+0>:  jmpq *0xda8c92(%rip)  # 0x11ac0b8 <[email protected]> 
    0x0000000000403426 <+6>:  pushq $0x14 
    0x000000000040342b <+11>: jmpq 0x4032d0 

Tự làm ơn: Bỏ qua các bản dựng docker.io và tải Docker trực tiếp từ RHEL. Nó có sẵn trong kênh Extras. Mặc dù thông thường sẽ mất vài tuần sau các bản phát hành ngược dòng (ví dụ: 1.6 thay vì 1.7), nó cũng được kiểm tra và đảm bảo thực sự hoạt động.

0

Sửa đổi câu trả lời ban đầu của tôi sau khi một số thông tin phản hồi hữu ích:

Bạn đã sử dụng một năng động nhị phân: "Vấn đề tất nhiên là điều đó với một nhị phân liên kết tĩnh, udev đồng bộ là không thể, và như vậy có thể gây ra tham nhũng Điều này rất khó cho RedHat (người duy trì trình điều khiển devicemapper) để xác định bởi vì họ sử dụng một nhị phân được liên kết động (mà họ cung cấp trong mã nhị phân được liên kết động) (họ cung cấp trong bản repos của họ)

Ngay sau khi bản phát hành 1.7.0 bắt đầu cung cấp rpms và debs với các tệp nhị phân được liên kết động từ tập lệnh cài đặt chính @ get.docker.com (và bản ghi dịch vụ apt repos để khớp) Với những tập tin nhị phân udev đồng bộ được hỗ trợ và devicemapper nên làm việc tốt.

Trình cắm đã may mắn thay đổi kho lưu trữ của nó để cung cấp các tệp nhị phân động kể từ khi OP được tạo.

tham chiếu: https://github.com/docker/docker/issues/13179

Các vấn đề liên quan