サーバ新規追加時の手順

サーバ新規追加時の手順

日本語を選択 (LANG=ja_JP.UTF-8にするためで、英語にすると、LANG=en_US.UTF-8となり、sortなどのプログラムの挙動が変わってしまうので日本語に揃える)

ソフトウェアの選択→GNOME Desktop

パーティションの設定→手動にして、/を大きくとるように設定

KDUMP無効

ネットワーク→ONにして設定の全般で自動的に接続するにチェック→ホスト名をm384などとつける

ネットワークのIPアドレスを下記のように固定で設定する。

方式:手動
アドレス(追加)
アドレス:(例)192.168.251.120
ネットマスク:24
ゲートウェイ:192.168.251.1
DNSサーバ:192.168.251.201
ドメインを検索:s

rootパスワード:suikou

最初のユーザとして、とりあえずyoshitakeなどと作っておき、管理者権限を付与する。

サーバのipアドレスとホスト名の対応表にサーバの名前を追加しておくこと。

サーバの名前でアクセスできるようにするために、内部dns登録のページに従って登録する。

アカウント:セットアップ時に登録した管理者ユーザ(例:yoshitake)でログインする。

sudo su
uid=600
id=suikou
pass=suikou
groupadd -g $uid $id
sudo useradd -u $uid -g $id -d /home/$id -s /bin/bash $id
echo -e "$pass\n$pass"|passwd $id
gpasswd -a $id wheel
sed -i 's/^%wheel\tALL=(ALL)\tALL/%wheel\tALL=(ALL)\tNOPASSWD: ALL/' /etc/sudoers
#echo "search s" >> /etc/resolv.conf -> OSインストール時に設定 もしくは nmtuiで
#scp m24.s:/etc/hosts /etc/hosts
#sudo yum -y install nfs-utils #まだNFSをインストールしていない場合

mkdir /suikou
mkdir /suikou/tool /suikou/tool-all /suikou/db /suikou/download /suikou/files

echo '
m12.s:/home          /home            nfs exec,dev,suid,rw,bg,hard,intr
m12.s:/home/tool     /suikou/tool     nfs exec,dev,suid,rw,bg,hard,intr
m12.s:/home/tool-all /suikou/tool-all nfs exec,dev,suid,rw,bg,hard,intr

m24.s:/suikou/root     /root            nfs exec,dev,suid,rw,bg,hard,intr
m24.s:/suikou/db       /suikou/db       nfs exec,dev,suid,rw,bg,hard,intr
m24.s:/suikou/download /suikou/download nfs exec,dev,suid,rw,bg,hard,intr
' >> /etc/fstab
mount -a
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service
#rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-agent-3.2.4-2.el7.x86_64.rpm
rpm -ivh /suikou/download/zabbix-agent-3.2.4-2.el7.x86_64.rpm
sed -i 's/Server=127.0.0.1/Server=192.168.251.202/; s/ServerActive=127.0.0.1/ServerActive=192.168.251.202/' /etc/zabbix/zabbix_agentd.conf

#sudo yum install sysstat #もしもiostatがインストールされていない場合

echo "
Timeout=30

UserParameter=hdd.rmbyte[*],iostat -mdx 1 2 | grep \$1 | awk '{print \$\$6}'|tail -n 1
UserParameter=hdd.wmbyte[*],iostat -mdx 1 2 | grep \$1 | awk '{print \$\$7}'|tail -n 1
UserParameter=toppro,top -b -n 1 | sed -e \"1,6d\" | head -6|awk '{print \$2\" \"\$9\" \"\$10\" \"\$12}'
" >> /etc/zabbix/zabbix_agentd.conf

systemctl start zabbix-agent
systemctl enable zabbix-agent
ssh suikouvm.s
zabbix_get -s (インストール中のサーバのIPアドレス) -k agent.version

http://suikouvm.s/zabbix にアクセスし、(Adminでログイン(pw: suikou))

設定→ホスト→ホストの作成 をクリックし、

新規サーバの

  • ホスト名
  • グループ(Linux serversを選択し、左矢印をクリック)
  • エージェントのインターフェイス IPアドレス

を設定する。まだ「追加」はクリックせずに、「テンプレート」タブを開き、「新規テンプレートをリンク」のところで、

  1. 選択をクリックし、「Template OS Linux」を選択する。
  2. 真ん中の追加をクリック
  3. 一番下の追加をクリック

それから、監視データ→スクリーン→スクリーンの変更ページを開いて、適宜グラフ、シンプルグラフを追加する。

#yum -y groupinstall "GNOME Desktop" #minimumでインストールした場合
yum -y groupinstall "Development Tools" #--setopt=group_package_types=mandatory,default,optional をつける必要があるかも
yum -y install libX11-devel libXt-devel libXext-devel
yum -y install epel-release
yum install -y libunwind libicu libgdiplus
yum install -y squashfs-tools #for singularity
yum -y install ntfs-3g
yum -y localinstall /suikou/download/exfat-utils-1.2.7-1.el6.x86_64.rpm
yum -y localinstall /suikou/download/fuse-exfat-1.2.7-1.el6.x86_64.rpm
#sudo yum -y install nfs-utils #まだNFSをインストールしていない場合

mkdir /data
echo '/data 192.168.0.0/16(rw,insecure,no_subtree_check,async,no_root_squash)' >> /etc/exports
exportfs -ra

sudo systemctl restart rpcbind
sudo systemctl restart nfs-server

sudo systemctl enable rpcbind nfs-server

nano /root/auto.suikou.files

他のサーバの記述を参考に、新規サーバを追加

yum -y install xrdp
systemctl start xrdp 
systemctl enable xrdp
yum -y groupinstall xfce

sed -i 's/max_bpp=32/max_bpp=24/' /etc/xrdp/xrdp.ini
yum -y install httpd
yum -y localinstall /suikou/download/rstudio-server-rhel-1.1.383-x86_64.rpm

echo "rsession-which-r=/suikou/tool/R-3.4.2/bin/R" >> /etc/rstudio/rserver.conf
echo "ProxyPass /rstudio/ http://localhost:8787/
ProxyPassReverse /rstudio/ http://localhost:8787/
RedirectMatch permanent ^/rstudio$ /rstudio/" >> /etc/httpd/conf/httpd.conf

systemctl start httpd
systemctl enable httpd
systemctl enable rstudio-server.service
sed -i 's%[[]Service]$%[Service]\nEnvironment="LD_LIBRARY_PATH=/suikou/tool-all/lib64:/suikou/tool-all/lib"\nEnvironment="PATH=/suikou/tool/miniconda2/bin:/suikou/tool-all/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin"\nEnvironment="LDFLAGS=-L/suikou/tool-all/lib"\nEnvironment="CFLAGS=-I/suikou/tool-all/include"\nEnvironment="CXXFLAGS=-I/suikou/tool-all/include"\nEnvironment="CPPFLAGS=-I/suikou/tool-all/include"\nEnvironment="PKG_CONFIG_PATH=/suikou/tool-all/lib/pkgconfig"%' /etc/systemd/system/rstudio-server.service
systemctl start rstudio-server.service
#sudo yum -y install autofs #まだautofsをインストールしていない場合

sed -i 's/^+auto.master$/#+auto.master/' /etc/auto.master
echo "/suikou/files   /etc/auto.suikou.files   --timeout=0" >> /etc/auto.master
scp m24.s:/root/auto.suikou.files /etc/auto.suikou.files

sudo systemctl start autofs
sudo systemctl enable autofs
cd /root
./run-setup-user-linux.sh
ssh m24.s
source /suikou/tool/bashrc.sh
nano /etc/hosts #新しいサーバのアドレスと名前を書く必要あり
qconf -as (新しいサーバの名前)
qconf -ah (新しいサーバの名前)
exit
cd /suikou/tool/ge6.2u6
hostip=`ip addr|grep 192.168.251|sed 's/.*inet //; s/\/.*//'`
hostnm=`hostname`
echo "192.168.251.101 m24
$hostip $hostnm" >> /etc/hosts
./install_execd
質問はすべてEnterで良い
source /suikou/tool/ge6.2u6/default/common/settings.sh
qconf -rattr exechost complex_values mem_req=`free -g|grep "^Mem:"|awk '{print $2}'`G `hostname`
echo '* soft nofile 65536
* hard nofile 65536' >> /etc/security/limits.conf

suikouvmにログインして、下記の設定を行う。ただし共有フォルダの接続をリセットしてしまうため、共有フォルダ利用者がいないか、zabbix等で確認すること。

ssh -l root suikouvm.s #password: suikou
scp m24.s:/root/auto.suikou.files /etc/auto.suikou.files
systemctl restart autofs
ls /home/user1/files/
#samba共有へ追加(例としてm64gを追加する場合)
ln -s /suikou/files/m64g /samba/share
exit

解析ノード全体で/dataフォルダを共有するため、下記のコマンドを実行する。共有フォルダの接続をリセットしてしまうため、ほかのユーザがサーバを使用していないか確認すること。(下記のコマンドはrootユーザではなく、suikouユーザなど管理者権限のある管理者ユーザを使用すること。sshの公開鍵を登録していれば、どの解析サーバで下記コマンドを実行しても良いが、不明な場合はm768.sから実行するのが良い。)

for i in `qhost|tail -n+4|cut -f 1 -d " "`; do echo $i; ssh $i sudo /root/run-setup-add-nfs.sh; done

suikougwの、/suikou/files以下のNFSの設定変更もやっておく。

ssh suikougw #suikougwはrootでのsshログインを不可にしてあるので、一般ユーザでログインすること
su - #パスワードはsuikou
scp m24.s:/root/auto.suikou.files /etc/auto.suikou.files
systemctl restart autofs

メンバー追加時の手順ページのサーバ名を追加して、実行する。

sudo su
scp m24.s:/root/run-setup-package.sh .
bash run-setup-package.sh
#sudo yum -y install autofs #まだautofsをインストールしていない場合

sed -i 's/^+auto.master$/#+auto.master/' /etc/auto.master
echo "/suikou/files   /etc/auto.suikou.files   --timeout=0" >> /etc/auto.master

nano /root/auto.suikou.files #新規サーバを共有する場合は編集する

cp /root/auto.suikou.files /etc/auto.suikou.files

sudo systemctl start autofs
sudo systemctl enable autofs

cd /root
./run-setup-user-linux.sh #ユーザ追加と各ユーザの共有フォルダのシンボリックリンクを作成する

su - suikou
ssh m768
source /suikou/tool/ge6.2u6/default/common/settings.sh
for i in `qhost|tail -n+4|cut -f 1 -d " "`; do echo $i; ssh $i sudo cp /root/auto.suikou.files /etc/auto.suikou.files; ssh $i sudo systemctl restart autofs; done

ssh -l root suikouvm.s #password: suikou
cp /root/auto.suikou.files /etc/auto.suikou.files
systemctl restart autofs
ls /home/user1/files/
#samba共有へ追加(例としてm64gを追加する場合)
ln -s /suikou/files/m64g /samba/share
exit
ssh m24.s
source /suikou/tool/bashrc.sh
nano /etc/hosts #新しいサーバのアドレスと名前を書く必要あり
qconf -as (新しいサーバの名前)
qconf -ah (新しいサーバの名前)
exit

scp m24.s:/etc/hosts /etc/hosts
cd /suikou/tool/ge6.2u6
./install_execd
質問はすべてEnterで良い

source /suikou/tool/ge6.2u6/default/common/settings.sh
qconf -rattr exechost complex_values mem_req=`free -g|grep "^Mem:"|awk '{print $2}'`G `hostname`
  • サーバ新規追加時の手順.1580274299.txt.gz
  • 最終更新: 2020/01/29 05:04
  • by 133.11.222.89