Monday, April 9, 2012

SA class 5



samba

FTP                              # file transfer protocol

NFS                              # network file system
    mount
    nfsd / nfsiod
    based on RPC

CIFS                             # common internet file system
                                 # M$ 網路上的芳鄰
    SMB                          # server message block
    based on NetBIOS


netBIOS
    name service for registration and resolution
    session service for connection-oriented communication
    datagram (darkgerm?) disrtibution service for connection communication


SMB                              # port 137~139 445(TCP/IP)
    file and printer sharing service
    authentication


NetBIOS (API)
    interrupt file I/O to NetBIOS
    broadcast my name
    NETBEUI                      # with 'token ring'
    WINS
        NetBIOS Name server as a master
        don't need to broadcast frequently


SMB                              # server message block
    SMB -> CIFS -> SMB
    Win7
        SMB 2.1
        SMB 2.2


SAMBA

    a student use a packet to do network analysis of the DEC Pathworks server
software
    sharing files or printers like M$ does
    authenticate user identity like M$ does
    resolve NetBIOS like M$ dose

    install
        /usr/ports/net/samba35
        samba3.6 support SMB2    # for win7

    confuguration files
        /usr/local/etc/smb.conf.default => /usr/local/etc/smb.conf
        /usr/local/etc/lmhosts   # for WINS

    major execution files
        smbd /usr/local/sbin/snbd
            management of sharing directories, files, printers
        nmbd /usr/local/ssbin/nmbd
            resolve NetBIOS name and manage workgroup
        pdbedit /usr/local/bin/pdedit
            manage the samba user database
        smbpasswd /usr/local/bin/smbpasswd
        tdb

        pdbedit -a username      # add user
        pdbedit -x username      # delete user
        pdbedit -r -c username

    smb.conf
        sections
            [....]
            para1 = value1
        global section for global settings
        meta service


starting samba
    /usr/local/etc/rc.d/samba {start|stop}
    /etc/rc.conf
        samba_enable="YES"
        nmbd_enable="YES"


=======================================

ZFS
zetabyte filesystem
    storage pools
        contructed of files, partitions, or entire disks

    data integrity

    capacity
        128-bit file system

    copy on write
        modified data is in a new block

    snapshots, clones, rollbacks
        fast creation
        space efficiency
        clones are writeable snapshots

    dynamic striping

    compression
        lzjb or gzip

    variable block size
        data compression         # CPU is fast than hard diskI/O

    adaptive edianness
        big / little - endian

    encryption
        zfs pool ver30

    platforms
        solaris 10/11
        OpenSolaris
        FreeBSD 8.2-R (v15); 8.2-S, 9.0-, 10.0-C (v28)
        Mac X OS
        Linux

    self healing                 # using checcksum


using ZFS
    /etc/rc.conf
        zfs_enable="YES"
    /etc/rc.d/zfs start


zpool
    zpool create tank
        mirror
        raidz
    zpool add/attach/detach/online/offline
    zpool list/status
    zpool export/import
    zpool upgrade -v/-a
    zpool get/set


zfs
    zfs create
    zfs destroy
    zfs snapshots
        tank/fs0@today
        tank/fs0/./zfs/snapshots/today
    zfs clone
    zfs rollbacks
    zfs list
    zfs mount / unmount
    zfs upgrade -v/-a
    zfs send / receive
    zfs allow / unallow
    zfs hold / holds / release
    zfs diff
    zfs jail / unjail


Ten Ways To Improve ZFS Performance
    1: Add Enough RAM
    2: Add More RAM
    3: Boost Deduplication Performance With Even More RAM
    4: Use SSDs to Improve Read Performance
    5: Use SSDs to Improve Write Performance
    6: Use Mirroring
    7: Add More Disks
    8: Leave Enough Free Space
    9: Hire An Expert
    10: Be An Evil Tuner - But Know What You Do


============================

FTP
    file transfer protocol
    C/S architecture
    separated control/data connections
    Modes
        active  mode    client => server
        passive mode    client <= server

    RFC (reauest for comments)
        RFC 2640                 # UTF-8 support file name
        RFC 2324                 # Hyper text coffee pot control protocol

    security
        FTP transfer data via clear text
        so we need encryption

        two solutions
            FTP over SSH         # sftp
                commands   [O]
                data       [O]
            FTP over TLS         # better performance
                commands   [O]
                data       [X]


pure FTPd
    a FTP server
    support chroot
    anonymous
    virsual users and authentication
    FTP over TLS
    UTF-8
    /usr/ports/ftp/pure-ftpd


pure FTPd tools
    pure-ftpwho
    pure-pw


more tools                       # under /usr/ports/ftp
    pureadmin
    lftp
    wget
    mget
    filezilla

==============================

basic service and settings
    Ex. http, ftp, etc ...


service
    instarll
        ports
        package
        tarballs

    configuration
        configfile
        rc.conf

    startup
        rc.conf used for booting processes

    maintanance


configuration file
    under /usr/local/etc
    program.conf
    programrc
    copy sample files and edit it


RC script
    scripts for start / stop services


dependency!!!!


rc.conf     # after booting
    asdf_enable="YES"


usage
    start, stop, restart
    status
    reload


No comments:

Post a Comment