Locked History Actions

Diff for "Centos8-setup"

Differences between revisions 2 and 66 (spanning 64 versions)
Revision 2 as of 2019-09-27 01:30:10
Size: 2730
Comment:
Revision 66 as of 2019-10-01 05:57:52
Size: 7214
Comment:
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
= Centos8インストール初期設定 = = Centos8インストールヒント =
Line 16: Line 16:
1. EPEL repository の追加 1. CentOS 8 には [[https://wiki.centos.org/ja/Manuals/ReleaseNotes/CentOS8.1905|CentOS-8 (1905)]] と [[https://wiki.centos.org/Manuals/ReleaseNotes/CentOSStream |CentOS Stream]] の2種がありますが、通常の安定したサーバ向けの用途には CentOS 8 (1905) の方を使用します。
CentOS Stream は 開発者向けの rolling-release Linux distributions です。CentOS-8 (1905)のインストールには以下から dvd iso をダウンロードします。

[[http://ftp.riken.jp/Linux/centos/8/isos/x86_64/ | http://ftp.riken.jp/Linux/centos/8/isos/x86_64/]]

2. CentOS 8をインストールするサーバが USB-boot に対応している場合(最近のサーバの場合)インストール用iso イメージは DVD-R に焼かずに [[https://rufus.ie/|rufus]]を使用して USBメモリ上に Bootable USB を作成した方が、高速にインストールできます。(参考)[[https://qiita.com/fiftystorm36/items/27368f855141b311d014|USB メモリを使用して Linux (CentOS 7) をインストール]]

3.CentOS 8での主な変更点は、アップストリームの[[https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html-single/8.0_release_notes/index|リリースノート]]や、[[https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index|導入における検討事項]]をご覧ください。


= Centos8インストール後の初期設定とTips =





1. yum (dnf) レポジトリーのソースを変更(近くのミラーサーバを設定)する

{{{
/etc/yum.repos.d/
}}}
配下の3つのファイル(CentOS-AppStream.repo, CentOS-Base.repo, CentOS-Extras.repo)の最初の方の baseurlをコメントをはずして近くのミラーサーバを指定(以下、例)
{{{
CentOS-AppStream.repo
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/AppStream/$basearch/os/

CentOS-Base.repo
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/BaseOS/$basearch/os/

CentOS-Extras.repo
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/extras/$basearch/os/
}}}
と変更、yum update (dnf update)を実施(初期update)します。


2. EPEL repository の追加
Line 21: Line 56:
2. Yum レポジトリーのソースを変更(ミラーサーバを設定)
{{{
/etc/yum.repos.d/
}}}
配下のファイル、最初のentry (URL)を
{{{
http://ftp.riken.jp/Linux/...
}}}
に変更、yum update を実施(初期update)
Line 31: Line 57:
3. kernelのパケットフィルタを firewalld から iptables に変更 3. 旧来のiptablesを使いたい場合、kernelのパケットフィルタを firewalld から iptables に変更できます。
Line 41: Line 67:
4. 必要ならば SELinux を disable す 4. 必要ならば SELinux を disable しま
Line 51: Line 77:
の変更後、reboot の変更後、rebootします。
Line 54: Line 80:
5. SSHを外部に開いている場合は、パスワード認証を禁止 5. SSHを外部に開いている場合は、パスワード認証を禁止します。
Line 62: Line 88:
を行い、sshd を再起動 を行い、sshd を再起動。sshは公開鍵認証のみ接続できるようになります。
Line 64: Line 90:
6. Chronydの設定 6. (参考)httpd周りのソフト環境
{{{
RHEL5(CentOS5) httpd-2.2.3 php-5.1.6 perl-5.8 python-2.4.3 mysql-5.0.95
RHEL6(CentOS6) httpd-2.2.15 php-5.3.3 perl-5.10 python-2.6.6 mysql-5.1.73
RHEL7(CentOS7) httpd-2.4.6 php-5.4.16 perl-5.16 python-2.7.5 mariadb-5.5.64
RHEL8(CentOS8) httpd-2.4.37 php-7.2.11 Perl-5.26 python-3.6 (2.7) mariadb-10.3.11
}}}

7. Perlの変更に関して

CentOS 8 では Perl が Perl-5.26 にアップグレードされていますが、これにより従来 CentOS 5,6,7 で動作していたPerlプログラムがそのままではエラーとなり修正が必要な場合があります。詳細についてはアップストリームのドキュメント[[https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#perl_dynamic-programming-languages-web-servers-database-servers|15.1.3. Perl への主な変更点]]をご参照ください。

Perl-5.26ではセキュリティ上の理由からライブラリーのパスから現在のディテクトリーが削除さましたので、それが原因でhttpのperlプログラム実行でエラーが出る場合は
{{{
/etc/httpd/conf/httpd.conf
}}}
中に、
{{{
setenv PERL5LIB .
}}}
を追記すると、httpd上で perlプログラムが正常に動作するようになる場合があります。


8. MariaDB の変更について

CentOS 8 では MariaDB がMariaDB-10.3.11にアップグレードされています。これにより従来の CentOS 5,6,7 で動作していた MySQL, MariaDBはダンプファイルを使ってリストアが必要です。例については[[https://ribf.riken.jp/ribfcomp/MySQL-5.1%20%E3%81%8B%E3%82%89MariaDB-10.3%20%E3%81%B8%E3%81%AE%E7%A7%BB%E8%A1%8C|MySQL-5.1 からMariaDB-10.3 への移行]]をご参照ください。


9. Chronydの設定
Line 68: Line 122:
を設定。以下設定例1(外部stratum1サーバに同期): を設定します。以下設定例1(下から3台を選んで設定)(外部stratum1サーバに同期):
Line 74: Line 128:
server eric.nc.u-tokyo.ac.jp iburst
server zao.net.tohoku.ac.jp  iburst
server clock.nc.fukuoka-u.ac.jp iburst
server ntp01.sinet.ad.jp iburst
server ats1.e-timing.ne.jp iburst
server time.google.com iburst
server ntp
.jst.mfeed.ad.jp iburst
Line 78: Line 133:
以下設定例2(外部stratum1サーバに同期している内サーバに同期): 以下設定例2(外部stratum1サーバに同期している自ドメインサーバに同期):
Line 85: Line 140:
server indico2.riken.jp iburst
Line 88: Line 144:
以下のコマンドで時刻同期を確認 以下のコマンドで時刻同期を確認できます。
Line 93: Line 149:
7. ganglia-gmond のインストール 10. アップストリームのOSのリリース日、サポート終了日(CentOSもこれに準ずる)
Line 95: Line 151:
[[https://access.redhat.com/support/policy/updates/errata/|https://access.redhat.com/support/policy/updates/errata/]]
Line 96: Line 153:
# yum install ganglia-gmond        リリース日     サポート期限
RHEL3 2003年10月22日 2010年10月31日(終了)
RHEL4 2005年2月14日 2012年2月29日 (終了)
RHEL5 2007年3月14日 2017年3月31日 (終了)
RHEL6 2010年11月10日 2020年11月30日
RHEL7 2014年6月10日 2024年6月30日
RHEL8 2019年5月7日 2029年5月
Line 98: Line 161:
/etc/ganglia/gmond.conf を設定する(隣接ノードからコピー)

必要なport 8649/tcp, 8650/tcp をiptables で開ける(LAN内)

実行設定
{{{
# systemctl enable gmond
# systemctl start gmond
}}}

Centos8インストール前のヒント

1. CentOS 8 には CentOS-8 (1905)CentOS Stream の2種がありますが、通常の安定したサーバ向けの用途には CentOS 8 (1905) の方を使用します。 CentOS Stream は 開発者向けの rolling-release Linux distributions です。CentOS-8 (1905)のインストールには以下から dvd iso をダウンロードします。

http://ftp.riken.jp/Linux/centos/8/isos/x86_64/

2. CentOS 8をインストールするサーバが USB-boot に対応している場合(最近のサーバの場合)インストール用iso イメージは DVD-R に焼かずに rufusを使用して USBメモリ上に Bootable USB を作成した方が、高速にインストールできます。(参考)USB メモリを使用して Linux (CentOS 7) をインストール

3.CentOS 8での主な変更点は、アップストリームのリリースノートや、導入における検討事項をご覧ください。

Centos8インストール後の初期設定とTips

1. yum (dnf) レポジトリーのソースを変更(近くのミラーサーバを設定)する

/etc/yum.repos.d/ 

配下の3つのファイル(CentOS-AppStream.repo, CentOS-Base.repo, CentOS-Extras.repo)の最初の方の baseurlをコメントをはずして近くのミラーサーバを指定(以下、例)

CentOS-AppStream.repo
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/AppStream/$basearch/os/

CentOS-Base.repo
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/BaseOS/$basearch/os/

CentOS-Extras.repo
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/extras/$basearch/os/

と変更、yum update (dnf update)を実施(初期update)します。

2. EPEL repository の追加

# yum install epel-release

3. 旧来のiptablesを使いたい場合、kernelのパケットフィルタを firewalld から iptables に変更できます。

# systemctl stop firewalld.service
# systemctl mask firewalld.service
# yum install iptables-services
# systemctl enable iptables.service
# systemctl start iptables.service

4. 必要ならば SELinux を disable します。

/etc/selinux/config

中で

#SELINUX=enforcing
SELINUX=disabled

の変更後、rebootします。

5. SSHを外部に開いている場合は、パスワード認証を禁止します。

/etc/ssh/sshd_config

中、以下の変更

PasswordAuthentication no

を行い、sshd を再起動。sshは公開鍵認証のみ接続できるようになります。

6. (参考)httpd周りのソフト環境

RHEL5(CentOS5)  httpd-2.2.3   php-5.1.6   perl-5.8   python-2.4.3      mysql-5.0.95   
RHEL6(CentOS6)  httpd-2.2.15  php-5.3.3   perl-5.10  python-2.6.6      mysql-5.1.73     
RHEL7(CentOS7)  httpd-2.4.6   php-5.4.16  perl-5.16  python-2.7.5      mariadb-5.5.64 
RHEL8(CentOS8)  httpd-2.4.37  php-7.2.11  Perl-5.26  python-3.6 (2.7)  mariadb-10.3.11   

7. Perlの変更に関して

CentOS 8 では Perl が Perl-5.26 にアップグレードされていますが、これにより従来 CentOS 5,6,7 で動作していたPerlプログラムがそのままではエラーとなり修正が必要な場合があります。詳細についてはアップストリームのドキュメント15.1.3. Perl への主な変更点をご参照ください。

Perl-5.26ではセキュリティ上の理由からライブラリーのパスから現在のディテクトリーが削除さましたので、それが原因でhttpのperlプログラム実行でエラーが出る場合は

/etc/httpd/conf/httpd.conf

中に、

setenv PERL5LIB . 

を追記すると、httpd上で perlプログラムが正常に動作するようになる場合があります。

8. MariaDB の変更について

CentOS 8 では MariaDB がMariaDB-10.3.11にアップグレードされています。これにより従来の CentOS 5,6,7 で動作していた MySQL, MariaDBはダンプファイルを使ってリストアが必要です。例についてはMySQL-5.1 からMariaDB-10.3 への移行をご参照ください。

9. Chronydの設定

 /etc/chrony.conf

を設定します。以下は設定例1(下から3台を選んで設定)(外部stratum1サーバに同期):

server 133.243.238.163 iburst
server 133.243.238.164 iburst
server 133.243.238.243 iburst
server 133.243.238.244 iburst
server ntp01.sinet.ad.jp iburst
server ats1.e-timing.ne.jp iburst
server time.google.com iburst
server ntp.jst.mfeed.ad.jp iburst

以下は設定例2(外部stratum1サーバに同期している自ドメイン内のサーバに同期):

server ribf.riken.jp iburst
server ribf00.riken.jp iburst
server ribf01.riken.jp iburst
server ribfsmtp1.riken.jp iburst
server ribfsmtp2.riken.jp iburst
server indico2.riken.jp iburst

chronydサービスを有効化、起動,

以下のコマンドで時刻同期を確認できます。

chronyc sources

10. アップストリームのOSのリリース日、サポート終了日(CentOSもこれに準ずる)

https://access.redhat.com/support/policy/updates/errata/

       リリース日     サポート期限
RHEL3  2003年10月22日   2010年10月31日(終了)
RHEL4  2005年2月14日    2012年2月29日 (終了)
RHEL5  2007年3月14日    2017年3月31日  (終了)
RHEL6  2010年11月10日   2020年11月30日 
RHEL7  2014年6月10日    2024年6月30日 
RHEL8  2019年5月7日     2029年5月