1992.11.02

SUBJECT: NIS¿¡ ´ëÇÑ À̸ðÀú¸ð

DESCRIPTION:
* NIS´Â OS install½Ã settingÇÏ´Â °ÍÀÌ good!
* master´Â OS install½Ã master·Î ÁöÁ¤ installÇÑ ÈÄ
  # cd /var/yp
  # /usr/etc/yp/ypinit -m ÇÏ¿© ¹°¾îº¸´Â Áú¹®¿¡ ´ëÇØ ¸ðµÎ YesÇÔ.
    ¾Æ·¡ ypinit -mÀ» ÂüÁ¶
* ypinit
  - NIS database¸¦ buildÇÏ°í installÇÔ.
    Áï NIS server»ó¿¡ NIS database¸¦ setupÇÔ.
  1) master server:
     # cd /var/yp (cdÇÏ´Â ÀÌÀ¯: ÀÌ directory¿¡ "domainname" directory¸¦
                                ¸¸µé¾î ±× ¹Ø¿¡ YP ȯ°æÀ» ¸¸µé °ÍÀÓ)
     # /usr/etc/yp/ypinit -m
       - critical error ¾Æ´Ñ °æ¿ì¿¡µµ quit ?  Yes
       - ±âÁ¸ °Í destory ? Yes
       - slave server¸¦ ÀÔ·ÂÇÔ.  ÀÔ·ÂÇÏ°í ´õ ¾øÀ¸¸é 
  2) slave server:
     # cd /var/yp
     # /usr/etc/yp/ypinit -s master_server_name
     (slave´Â masteró·³ ¹°¾îº¸´Â °ÍÀÌ ¾øÀ½. ¹Ù·Î YPȯ°æÀ» createÇÔ.
      master server»óÀÇ /var/yp/"domainname" ¹Ø¿¡ ÀÖ´Â dbÈ­ÀϵéÀ»
      ÀÚ±â localÀÇ /var/yp/"domainname"¹Ø¿¡ ±×´ë·Î copyÇÔ.)

* master server¸¸Àº /etc/passwd¿¡ user account Á¤º¸ ¸ðµÎ °¡Áö°í ÀÖÀ½.
  slave serverÀÇ /etc/passwd¿¡´Â ÀÏ¹Ý clientó·³ ÃÖ¼ÒÇÑÀÇ °ÍÀÌ ÀÖÀ½.
                                    
* make
  master server»ó¿¡¼­¸¸ ¼öÇà °¡´É.
  master serverÀÇ /var/yp/MakefileÀ» ÂüÁ¶ÇÏ¿© ¼öÇàÇϴµ¥ ÀÌ´Â master server¸¸ ÀÖÀ½.
  # cd /var/yp
  # make ( YP¿¡¼­ °ü¸®ÇÏ´Â ¸ðµç dbÁ¤º¸¸¦ ¾çÀÚ ºñ±³ÇÏ¿© ÃÖ½ÅÀÇ °ÍÀ¸·Î update½ÃÅ´)

* yppasswd
  - master¿¡¼­ slave·Î passwdÁ¤º¸¸¦ transferÇÔ
    ¦£ ÀÏ¹Ý »ç¿ëÀÚ´Â  yppasswd
    ¦¦ root´Â         /bin/passwd

* ypxfrd
  - transfer daemon
  - master¿¡¼­ runningµÇ¸ç masterÀÇ dbÁ¤º¸¸¦ slave¿¡ Àü´ÞÇؼ­ update ½ÃÅ´

* ypserv
  - master³ª slave°¡ information db¸¦ serviceÇÔ

* client
  - suninstall½Ã client¿¡ ´ëÇؼ­´Â µÎ°¡Áö¸¸ ÇÏ¸é µÈ´Ù.
  - ¡à client
    Domain Name : cs.postech
  - client booting½Ã
    Starting NIS service
    ypbind ......
  - error:
    "NIS server not responding for domain 'cs.postech'
     Still trying ....."
    networkÀÌ Á×¾î master³ª slaveÁß ¾î´À °Í Çϳª »ì¾Æ ÀÖÁö ¾Ê¾Æ
    service¸¦ ¹ÞÁö ¸øÇÏ´Â °æ¿ì booting½Ã ¹ß»ýÇÏ´Â error message.
    
* ypbind
  - master, slave, clientµé ¸ðµÎ¿¡ runningµÊ.
  - master³ª slave¿¡¼­ db information °¡Á®¿À´Â daemon
  - master³ª slave´Â ÀڱⰡ infor °¡Áö°í À־ 
    network¿¡¼­ °¡Á®¿Àµµ·Ï ¼³°è --> ±¸Çö ¿ëÀÌ

* ÇöÀç NIS°¡ runningÁßÀÎÁö º¸·Á¸é
  # ps ax | grep ypbind  --> ÀÖÀ¸¸é runningÁßÀÓ.

* slave server°¡ 2°³ ÀÌ»óÀÎ °æ¿ì ¾î´À slave server°¡ updateÇÏ·Á°í
  °è¼Ó tryÇÏ¿© hangupµÊ
  --> ÀÌ °æ¿ì  ÇÑ ÈÄ ypinit¸¦ ´Ù½Ã ¼öÇàÇÏ¿© slave¸¦ ´Ù½Ã ÁöÁ¤ÇØ¾ß ÇÔ.

* slave´Â make ¸ø µ¹¸°´Ù. Áï db update´Â ¸øÇÏ°í ´ÜÁö Á¦°øÇÏ´Â ±â´É¸¸ °¡Áü.

* master³ª slave serverÁß ¾î´À °ÍÀÌµç ¸ÕÀú serviceÇØ ÁÙ ¼ö ÀÖ´Â °ÍÀÌ
  service Á¦°øÇØ ÁÜ. yp clientÀÇ ¿ä±¸¸¦ ¸ÕÀú catchÇÑ °ÍÀÌ service¸¦ ÇÔ.
  ±×·¯¹Ç·Î master server°¡ down µÇ´õ¶óµµ slave°¡ ÀÖÀ¸¸é service °¡´ÉÇÑ °Í.

* domain nameÀÌ nonameÀ̸é YP°¡ ¾ÈµÊ
  /etc/defaultdomain¿¡ domainnameÀÌ ÀÖ¾î¾ß ÇÑ´Ù.

* /etc/passwd ¿¡
  "+::0:0:::" ÀÖÀ¸¸é searchÇÏ´Ù +¸¦ ¸¸³ª¸é NIS server¿¡ °¡¼­ ãÀ½.

* NIS client¿¡¼­ NIS db fileµéÀ» º¼ ¶§
      # ypcat hosts
      # ypcat passwd
      # ypcat -m hosts (hosts mapÀ» serviceÇØ ÁÖ´Â master server°¡ ¾î´À°ÍÀÎÁö)

* °ü·Ã daemon
  - ypserv : server process
  - ypbind : binding process
  - ypxfrd : map transfer daemon
  - rpc.ypupdated : map entryµéÀ» changeÇϱâ À§ÇÑ server
  - rpc.yppasswdd:  NIS passwd fileÀ» modifyÇϱâ À§ÇÑ server
  - in.named : option »çÇ×

* Utilityµé
  - ypcat : map¿¡¼­ data¸¦ listÇϱâ À§ÇØ
  - ypwhich : NIS server nameÀ» list
  - ypmatch : map°ª°ú match½ÃÅ°±â À§Çؼ­
  - ypinit : NIS database¸¦ buildÇÔ
  - yppoll: server·ÎºÎÅÍ mapÀÇ order number¸¦ ¾ò±â À§ÇØ
  - yppush : master¿¡¼­ slave·Î data¸¦ Àü´Þ
  - ypset : ƯÁ¤ server¿¡ binding set
  - ypxfr : master¿¡¼­ slave¿¡ data transfer
  - makedbm : NIS mapÀ» À§ÇÑ dbm fileÀ» create

* NIS service´Â ypserv, ypbind daemon¿¡ ÀÇÇØ ¼öÇàµÊ
  rpc.ypupdated daemon¿¡ ÀÇÇØ db°¡ updateµÊ.
  NIS service´Â NIS map¿¡ Æ÷ÇÔµÈ info¸¦ »ç¿ëÇÔ.
  NIS°¡ runningµÇ´Â Network¿¡¼­ domain´ç Àû¾îµµ ÇϳªÀÇ NIS server°¡ ÀÖ¾î¾ß ÇÔ.
  °°Àº domainÀº °°Àº mapÀ» °øÀ¯
  NIS clientµéÀº binding process¸¦ ÅëÇØ NIS server·ÎºÎÅÍ info¸¦ ¾òÀ½.

* NIS service procedure
  - client»ó¿¡¼­ ¼öÇàµÇ´Â process´Â ypbind¿¡ server name¿äûÇÔ
  - ypbindÀÇ ±â´ÉÀº ypserv process°¡ client request¿¡ ´ëÇØ listeningÇÏ°í ÀÖ´Â
    serverÀÇ address¸¦ ±â¾ïÇÏ´Â °ÍÀÌ´Ù.
  - ypbind´Â client process¿¡°Ô talkÇÒ server¸¦ ¾Ë·ÁÁÜ
  - yp client´Â server¿¡ Á÷Á¢ request¸¦ º¸³¿
  - NIS server»óÀÇ ypserv daemonÀº mapÀ» Âü°íÇÏ¿© request¸¦ handlingÇÔ.
  - ¿ä±¸µÈ info¸¦ client¿¡ send
  - client¿Í server°£ÀÇ bindingÀº network load¿¡ µû¶ó º¯ÇÒ ¼ö ÀÖ´Ù.
    ¶§¿¡ µû¶ó ´Ù¸¥ server¿Í bindingÇÒ ¼öµµ ÀÖ´Ù´Â ÀǹÌ

* ¾î´À server°¡ ÇöÀç client¿¡ service¸¦ Á¦°øÇÏ´ÂÁö ¾Ë·Á¸é
  # ypwhich "client_name" ( client_nameÀÌ ¾øÀ¸¸é key inÇÑ ½Ã½ºÅÛÀ» default·Î ÇÔ)

* slave server»ó¿¡¼­ makeÇÏÁö ¸» °Í
  /var/yp ¹Ø¿¡ Makefile ÀÖÀ½.
  make µ¹¸®¸é default NIS mapÀ» createÇϱâ À§ÇØ makedbm¿¡ ÁÜ
  # makedbm -u group.byaddrÇϸé
  makedbmÀÌ /etcÀÇ È­ÀϵéÀ» Àо NIS map setÀ» createÇÔ.
  mapÀº °¢ db file ´ÜÀ§·Î º¸°üÇÏ°í ÀÖÀ½. 

* network¿¡ system attach½ÃÅ°´Â °æ¿ì
  - master serverÀÇ hosts fileÀ» editÇÏ°í
  - master server¿¡¼­ make¸¦ ¼öÇàÇÏ¸é µÊ.
    ÀÚµ¿ÀûÀ¸·Î hosts.byname°ú hosts.byaddr mapÀ» updateÇÔ
    ÀÌ mapµéÀº ´Ù¸¥ serverµé·Î ÀüÆÄµÇ°í ¸ðµç client°¡ À̸¦ »ç¿ëÇÒ ¼ö ÀÖ°Ô µÊ.

* OS installÇÑ »óÅ¿¡¼­ NIS settingÇÏ´Â ¹æ¹ý
  1) master server
     - /etc/defaultdomain¿¡ domainnameÀ» µî·ÏÇÔ
     - /var/yp¿¡ °¡¼­
       # /usr/etc/yp/ypinit -m 
       (¸¸¾à error ¹ß»ýÇϸé, /usr/lib/NIS.MakefileÀ» copyÇÏ¿© ´Ù½Ã ¼öÇà)
     - # ypserv
     - /etc/rc.localÀÇ ypxfrd¸¦ ¿­¾îÁÜ.
     - # sh -x /etc/rc.local or reboot
  2) slave server
     - /etc/defaultdomain¿¡ domainnameÀ» µî·ÏÇÔ
     - # ypbind
     - # /usr/etc/yp/ypinit -s "master_server" 
       (ypinit ¼öÇà Àü¿¡ master serverÀÇ  ypxfrd°¡ ¼öÇàµÇ°í ÀÖ´ÂÁö È®ÀÎ)
  3) client
     - /etc/defaultdomain¿¡ domainnameÀ» µî·ÏÇÔ
     - # sh -x /etc/rc.local  or # ypbind
    
  
Revision History
Created        on Nov. 02 ,1992