•  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
r10 vs r11
... ...
22 22
''해당 설치 가이드는 '''Minimal'''버전을 기준으로 설치 진행함.''
23 23
24 24
=== Rufus 다운로드 ===
25
'''부팅용 USB 만드는 Tool'''
26
[[https://rufus.ie/ko/|Rufus 다운로드]]
25
'''부팅용 USB 만드는 Tool'''
26
[[https://rufus.ie/ko/|Rufus 다운로드]]
27
[[파일:CentOS_7_설치가이드_1-2.png|width=65%]]
27 28
28
29 30
=== 이미지 제작 ===
30
준비된 USB 에 다운로드 받은 ISO 를 선택하고 시작 버튼 클릭
31
준비된 USB 에 다운로드 받은 ISO 를 선택하고 시작 버튼 클릭
32
[[파일:CentOS_7_설치가이드_1-3.png|width=65%]]
31 33
32
33 35
== OS 설치 ==
36
[[파일:CentOS_7_설치가이드_2-1.png|width=65%]]
37
Install CentOS 7 선택
36 38
39
[[파일:CentOS_7_설치가이드_2-2.png|width=65%]]
40
Continue 선택
41
42
[[파일:CentOS_7_설치가이드_2-3.png|width=65%]]
43
DATE & TIME 선택
44
45
[[파일:CentOS_7_설치가이드_2-4.png|width=65%]]
46
Asia / Seoul 선택 후 Done 선택
47
''간혹 시간이 안맞을 수도 있으니 체크''
48
49
[[파일:CentOS_7_설치가이드_2-5.png|width=65%]]
50
INSTALLATION DESTINATION
51
52
[[파일:CentOS_7_설치가이드_2-6.png|width=65%]]
53
OS 설치할 파티션 선택 후 I will configure partitioning. 선택 후 Done 클릭
54
55
[[파일:CentOS_7_설치가이드_2-7.png|width=65%]]
56
Standard Partition 으로 선택 후 Click here to ... 해당 부분 클릭
57
58
[[파일:CentOS_7_설치가이드_2-8.png|width=65%]]
59
설치 환경에 맞추어 파티셔닝 후 Done 클릭
60
61
[[파일:CentOS_7_설치가이드_2-9.png|width=65%]]
62
최종 파티셔닝 결과 확인 후 Accept Changes 선택
63
64
[[파일:CentOS_7_설치가이드_2-10.png|width=65%]]
65
kdump 선택
66
67
[[파일:CentOS_7_설치가이드_2-11.png|width=65%]]
68
Enable kdump 선택 해제 후 Done 선택
69
70
[[파일:CentOS_7_설치가이드_2-12.png|width=65%]]
71
Begin Installation 선택하여 설치 진행
72
73
[[파일:CentOS_7_설치가이드_2-13.png|width=65%]]
74
ROOT PASSWORD 클릭
75
76
[[파일:CentOS_7_설치가이드_2-14.png|width=65%]]
77
상황에 맞게 설정 후 Done 클릭
78
77 79
== 환경 구성 ==
78 80
=== resolv.conf 수정 ===
79
{{{[root@localhost ~]# vi /etc/resolv.conf
81
{{{[root@localhost ~]# vi /etc/resolv.conf
80 82
...
81 83
nameserver 8.8.8.8
82 84
...
83
}}}
84
resolv.conf 설정 원격 재 접속 시 dns 질의가 발생 접속이 느려질 수 있습니다.
85
해당 경우 resolv.conf에서 nameserver 삭제 후 재 접속 하면 해결 가능합니다.
85
}}} resolv.conf 설정 이후 원격 재 접속 시 dns 질의가 발생하여 접속이 느려질 수도 있음
86
해당 경우 resolv.conf에서 nameserver 삭제 후 재 접속 하 해결 가능
86 87
87 88
=== repo 변경 ===
88
CentOS 7의 공식 repository는 EOS/EOL 되어 서비스가 불가능한 상황임으로,
89
따라서 사내 등 공인망 환경에서는 repo를 사용 가능한 다른 곳으로 설정해야합니다.
89
CentOS 7의 공식 repository는 EOS/EOL 되어 서비스가 불가능한 상황임으로,
90
따라서 사내 등 공인망 환경에서는 repo를 사용 가능한 다른 곳으로 설정
90 91
91 92
* YUM 리포지토리 설정 파일 열기
92 93
{{{[root@localhost ~]# vi /etc/yum.repos.d/CentOS-Base.repo
93 94
}}}
94
*리포지토리 설정 값 수정하기(아래 내용을 복사){{{
95
[base]
96
name=CentOS-$releasever - Base
97
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
98
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
99
gpgcheck=1
100
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
95
*리포지토리 설정 값 수정하기(아래 내용을 복사)
96
{{{[base]
97
name=CentOS-$releasever - Base
98
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
99
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
100
gpgcheck=1
101
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
101 102
102
[updates]
103
name=CentOS-$releasever - Updates
104
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
105
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
106
gpgcheck=1
107
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
103
[updates]
104
name=CentOS-$releasever - Updates
105
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
106
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
107
gpgcheck=1
108
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
108 109
109
[extras]
110
name=CentOS-$releasever - Extras
111
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
112
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
113
gpgcheck=1
114
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
110
[extras]
111
name=CentOS-$releasever - Extras
112
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
113
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
114
gpgcheck=1
115
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
115 116
116
[centosplus]
117
name=CentOS-$releasever - Plus
118
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
119
baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/
120
gpgcheck=1
121
enabled=0
122
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
123
}}}
125
*변경사항 적용{{{ [root@localhost ~]# yum install epel-release
117
[centosplus]
118
name=CentOS-$releasever - Plus
119
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
120
baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/
121
gpgcheck=1
122
enabled=0
123
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
125 124
}}}
126
=== hostname 설정 ===
127
{{{ [root@localhost ~]# hostnamectl set-hostname testServer --static
125
*변경사항 적용
126
{{{[root@localhost ~]# yum install epel-release
128 127
}}}
129
--static 옵션을 사용하면 대소문자를 구분하여 적용됩니다.
128
=== hostname 설정 ===
129
{{{[root@localhost ~]# hostnamectl set-hostname testServer --static
130
}}} --static 옵션을 사용하면 대소문자를 구분하여 적용
130 131
=== 부팅 시 런레벨 설정 ===
131
{{{ [root@localhost ~]# systemctl set-default multi-user.target
132
[root@localhost ~]# systemctl get-default
133
multi-user.target
132
{{{[root@localhost ~]# systemctl set-default multi-user.target
133
[root@localhost ~]# systemctl get-default
134
multi-user.target
134 135
}}}
135 136
=== selinux 해제 ===
136
{{{[root@localhost ~]# vi /etc/sysconfig/selinux
137
{{{[root@localhost ~]# vi /etc/sysconfig/selinux
137 138
...
138 139
SELINUX=disabled
139 140
...
140 141
}}}
141 142
=== 방화벽 해제 ===
142
{{{[root@localhost ~]# systemctl disabled --now firewalld
143
{{{[root@localhost ~]# systemctl disabled --now firewalld
143 144
}}}
144 145
145 146
=== 불필요한 데몬 종료 ===
146
{{{[root@localhost ~]# systemctl disable --now NetworkManager
147
{{{[root@localhost ~]# systemctl disable --now NetworkManager
147 148
[root@localhost ~]# systemctl disable --now abrt-ccpp
148 149
[root@localhost ~]# systemctl disable --now abrtd
149 150
[root@localhost ~]# systemctl disable --now atd
... ...
151 152
[root@localhost ~]# systemctl disable --now kdump
152 153
[root@localhost ~]# systemctl disable --now netconsole
153 154
[root@localhost ~]# systemctl disable --now messagebus
154
}}}
155
데몬 종료 후 su 실행이 느려지면 {{{ systemctl restart systemd-logind }}}실행하면 됩니다.
155
}}} 데몬 종료 후 su 실행이 느려지면 {{{ systemctl restart systemd-logind }}}실행
156 156
=== swap 파티션 해제 ===
157
{{{[root@localhost ~]# swapoff -a
157
{{{[root@localhost ~]# swapoff -a
158 158
[root@localhost ~]# sed -i.bak -r 's/(.+ swap .+)/#\1/' /etc/fstab
159 159
}}}
160 160
=== 시간 동기화 설정 ===
161
{{{[root@localhost ~]# yum install -y chrony
161
{{{[root@localhost ~]# yum install -y chrony
162 162
[root@localhost ~]# systemctl enable --now chronyd
163 163
[root@localhost ~]# systemctl status chronyd
164 164
[root@localhost ~]# chronyc sources
165
166
}}}
165
}}}[[파일:CentOS_7_설치가이드_3-1.png|width=65%]]
167 166
=== ssh 보안 설정 ===
168
{{{[root@localhost ~]# vi /etc/ssh/sshd_config
169
...
167
{{{[root@localhost ~]# vi /etc/ssh/sshd_config
168
}}}{{{...
170 169
Port 2233
171 170
...
172 171
PermitRootLogin no
... ...
178 177
}}}
179 178
180 179
=== 일반 사용자 생성 ===
181
{{{[root@localhost ~]# useradd -d /home/sysadmin -s /bin/bash sysadmin
180
{{{[root@localhost ~]# useradd -d /home/sysadmin -s /bin/bash sysadmin
182 181
[root@localhost ~]# passwd sysadmin
183 182
184 183
New password: 패스워드 입력
... ...
200 199
[root@localhost ~]# chmod 4750 /usr/bin/su
201 200
}}}
202 201
=== 필수 패키지 설치 ===
203
{{{[root@localhost ~]# yum install yum-utils net-tools wget
202
{{{[root@localhost ~]# yum install yum-utils net-tools wget
204 203
}}}
205 204
=== 파티션 설정 ===
205
{{{[root@localhost ~]# fdisk -l
206
}}}[[파일:CentOS_7_설치가이드_3-2.png|width=65%]]
207
{{{[root@localhost ~]# parted /dev/vdb
208
}}}[[파일:CentOS_7_설치가이드_3-3.png|width=65%]]
209
{{{[root@localhost ~]# mklabel gpt
210
}}}[[파일:CentOS_7_설치가이드_3-4.png|width=65%]]
211
{{{[root@localhost ~]# mkpart
212
}}}[[파일:CentOS_7_설치가이드_3-5.png|width=65%]]
213
{{{quit
214
[root@localhost ~]# mkfs.xfs -f /dev/vdb1
215
}}}[[파일:CentOS_7_설치가이드_3-6.png|width=65%]]
216
{{{[root@localhost ~]# mkdir /data
217
[root@localhost ~]# mount /dev/vdb1 /data
218
[root@localhost ~]# df -h
219
}}}[[파일:CentOS_7_설치가이드_3-7.png|width=65%]]
220
{{{[root@localhost ~]# echo '/dev/vdb1 /data xfs default 0 0' |sudo tee -a /etc/fstab
221
}}}[[파일:CentOS_7_설치가이드_3-8.png|width=65%]]
223 222
224
=== 본딩 ===
223
상기 모든 내용 반영 확인 되면 reboot 명령어 실행
224
225
=== 본딩 설정 ===
226
(예시이므로 상황에 맞춰서 인터페이스 명 변경 필요)
227
예시: ens3 과 ens8을 bond0의 192.168.100.10으로 묶는 경우
228
[[파일:CentOS_7_설치가이드_3-9.png|width=65%]]
229
230
{{{[root@localhost ~]# vi /etc/sysconfig/network-scrpits/ifcfg-bond0
231
}}}{{{DEVICE=bond0
232
TYPE=bond
233
BONDING_OPTS="mode=1 miimon=100 fail_over_mac=1"
234
ONBOOT=yes
235
BOOTPROTO\static
236
IPADDR=172.16.67.151
237
NETMASK=255.255.255.0
238
GATEWAY=172.16.1.1
239
}}} fail_over_mac 설정
240
0으로 설정 시 인터페이스 절체 상황에서 active 인터페이스의 mac으로 유지함
241
1로 설정 시 인터페이스 절체 상황에서 절체된 인터페이스의 mac으로 변경함
242
가상 환경에서는 1로 설정하여야 본딩 환경 구성 및 절체 테스트가 정상적으로 가능함
243
{{{[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens3
244
}}}[[파일:CentOS_7_설치가이드_3-10.png|width=65%]]
245
{{{[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens8
246
}}}[[파일:CentOS_7_설치가이드_3-11.png|width=45%]]
247
{{{[root@localhost ~]# systemctl restart network
248
}}}'''해당 커맨드 실행 시 전체 네트워크가 재 설정 되므로 라이브 혹은 작업시에 주의해서 사용할 것'''
249
{{{[root@localhost ~]# cat /proc/net/bonding/bond0
250
}}}[[파일:CentOS_7_설치가이드_3-12.png|width=65%]]