User Tools

Site Tools


自作クラスタ計算機:nisの基本設定

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
自作クラスタ計算機:nisの基本設定 [2020/02/25 21:44]
koudai 作成
自作クラスタ計算機:nisの基本設定 [2020/03/02 00:01]
koudai [計算ノード]
Line 1: Line 1:
 ====== 概要 ====== ====== 概要 ======
  
-  * プライベートLAN内でコンピュータの設定を共有するシステムをNetwork Information Service (NIS) と呼 +  * プライベートLAN内でコンピュータの設定を共有するシステムをNetwork Information Service (NIS) と呼びます 
-  * 複数人でクラスタ計算機を使用するとき、計算ノードごとに各自のアカウントを作成するのは非常に手間であるので、このシステムを使う+  * 複数人でクラスタ計算機を使用するとき、それぞれの計算ノードに各自のアカウントを一つずつ作成するのは非常に手間であるので、このシステムを使う 
 +  * 共有する設定を管理するサーバをNISサーバと呼び、今回は管理ノードをその役割に当てます
  
  
Line 12: Line 13:
 sudo apt install nis sudo apt install nis
 </code> </code>
 +    * 途中でNISドメイン名というものを聞かれので kanri.nis などとする。
 +    * NISドメイン名は設定を共有するコンピュータのグループの名前のことであり、FQDNにおけるドメイン名とはまったく別物である
 +    * NISドメイン名は /etc/defaultdomain に保存されるので、変更したくなったらこのファイルを編集すればよい
 +  - /etc/defalut/nis に管理ノードをNISサーバとすることを指定する<code>
 +$ sudo vi /etc/defalut/nis
 +</code><file - nis>
 +NISSERVER=master
 +</file>
 +  - /etc/yp.conf にNISサーバのIPアドレスまたはホスト名を指定する<code>
 +$ sudo vi /etc/yp.conf
 +</code><file - yp.conf>
 +ypserver 192.168.0.1
 +</file>
 +  - /etc/ypserv.securenets の最終行をプライベートLANのネットマスクとIPアドレスに変更する<code>
 +$ sudo vi /etc/ypserv.securenets
 +</code><file - ypserv.securenets>
 +(略)
 +# This line gives access to everybody. PLEASE ADJUST!
 +#02.0.0.0 0.0.0.0
 +255.255.255.0 192.168.0.0
 +</file>
 +    * これによりプライベートネットワークからのみNISサーバへの接続を許可します
 +  - NISデータベースを更新する<code>
 +$ sudo /usr/lib/yp/ypinit -m
 +
 +At this point, we have to construct a list of the hosts which will run NIS
 +servers.  dlp.srv.world is in the list of NIS server hosts.  Please continue to add
 +the names for the other hosts, one per line.  When you are done with the
 +list, type a <control D>.
 +        next host to add:  kanri
 +        next host to add:  # Ctrl + D キー
 +The current list of NIS servers looks like this:
 +
 +kanri
 +
 +Is this correct?  [y/n: y]  y
 +We need a few minutes to build the databases...
 +(以下略)
 +</code>
 +  - NISを再起動します<code>
 +$ sudo systemctl restart nis
 +</code>
 +
  
  
 ===== 計算ノード ===== ===== 計算ノード =====
 +
 +  - NISのパッケージをインストールする<code>
 +sudo apt install nis
 +</code>
 +    * NISドメイン名はNISサーバのときに設定したものと同じにする
 +  - /etc/yp.conf にNISドメイン名とNISサーバのIPアドレスを指定する<code>
 +$ sudo vi /etc/yp.conf
 +</code><file - yp.conf>
 +domain kanri.nis server 192.168.0.1
 +</file>
 +  - /etc/nsswitch.conf にNISサーバと共有する情報を指定する<code>
 +$ sudo vi /etc/nsswitch.conf
 +</code><file - nsswitch.conf>
 +(略)
 +passwd:         nis compat systemd
 +group:          nis compat systemd
 +shadow:         nis compat
 +gshadow:        files
 +
 +hosts:          nis files mdns4_minimal [NOTFOUND=return] dns myhostname
 +(略)
 +</file>
 +    * ユーザ情報に加えてNISサーバで行われる名前解決も共有するようにしています
 +    * これにより、各計算ノードで /etc/hosts を編集する必要がなくなります
 +    * グループの管理は管理ノードのみで行いたいため、gshadow(グループのパスワードが暗号化されて入っているファイル)は共有しません
 +  - NISを再起動します<code>
 +$ sudo systemctl restart nis
 +</code>
 +
 +
 +
 +====== 使い方 ======
 +
 +  - ユーザーを追加するには、管理ノードで次のようにします(以下はユーザーsugimotoを追加する場合)<code>
 +$ sudo adduser sugimoto
 +$ sudo make -C /var/yp
 +</code>
 +    * NISサーバの共有する情報を変更したときは、その都度 make -C /var/yp を実行する必要があります
 +  - 新しいユーザで計算ノードにログインできるか確認します<code>
 +$ ssh sugimoto@keisan11
 +</code>
 +  
 +
 +
 +====== 参考 ======
 +
 +  * http://meme.biology.tohoku.ac.jp/klabo-wiki/index.php?%B7%D7%BB%BB%B5%A1%2FNIS
 +  * http://masahir0y.blogspot.com/2012/12/nis.html
  
自作クラスタ計算機/nisの基本設定.txt · Last modified: 2024/01/20 17:32 by koudai