Skip to content

Commit 2d14980

Browse files
committed
🚧 Wormhole
1 parent ec40f6d commit 2d14980

File tree

3 files changed

+392
-52
lines changed

3 files changed

+392
-52
lines changed

markdown-file/Ansible-Install-And-Settings.md

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,61 @@ PLAY RECAP *********************************************************************
190190
```
191191

192192

193-
- 执行命令:`ansible-playbook /opt/disable-firewalld-playbook.yml`
193+
194+
#### 基础环境(CentOS 7.x)
195+
196+
197+
- 创建脚本文件:`vim /opt/install-basic-playbook.yml`
198+
199+
```
200+
- hosts: all
201+
remote_user: root
202+
tasks:
203+
- name: Disable SELinux at next reboot
204+
selinux:
205+
state: disabled
206+
207+
- name: disable firewalld
208+
command: "{{ item }}"
209+
with_items:
210+
- systemctl stop firewalld
211+
- systemctl disable firewalld
212+
- setenforce 0
213+
214+
- name: install-basic
215+
command: "{{ item }}"
216+
with_items:
217+
- yum install -y zip unzip lrzsz git epel-release wget htop deltarpm
218+
219+
- name: install-vim
220+
shell: "{{ item }}"
221+
with_items:
222+
- yum install -y vim
223+
- curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc
224+
225+
- name: install-docker
226+
shell: "{{ item }}"
227+
with_items:
228+
- yum install -y yum-utils device-mapper-persistent-data lvm2
229+
- yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
230+
- yum makecache fast
231+
- yum install -y docker-ce
232+
- systemctl start docker.service
233+
- docker run hello-world
234+
235+
- name: install-docker-compose
236+
shell: "{{ item }}"
237+
with_items:
238+
- curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
239+
- chmod +x /usr/local/bin/docker-compose
240+
- docker-compose --version
241+
- systemctl restart docker.service
242+
- systemctl enable docker.service
243+
244+
```
245+
246+
247+
- 执行命令:`ansible-playbook /opt/install-basic-playbook.yml`
194248

195249
#### 修改 hosts
196250

@@ -259,6 +313,7 @@ PLAY RECAP *********************************************************************
259313
#### 部署 Hadoop 集群
260314

261315
- 创建脚本文件:`vim /opt/hadoop-playbook.yml`
316+
- 刚学 Ansible,不好动配置文件,所以就只保留环境部分的设置,其他部分自行手工~
262317

263318
```
264319
- hosts: hadoop-host
@@ -277,20 +332,6 @@ PLAY RECAP *********************************************************************
277332
path: /data/hadoop/hdfs/tmp
278333
state: directory
279334
280-
- name: copy gz file
281-
copy: src=/opt/hadoop-2.6.5.tar.gz dest=/usr/local
282-
283-
- name: tar gz file
284-
command: cd /usr/local && tar zxf hadoop-2.6.5.tar.gz
285-
286-
- name: check folder existed
287-
stat: path=/usr/local/hadoop-2.6.5
288-
register: folder_existed
289-
290-
- name: rename folder
291-
command: mv /usr/local/hadoop-2.6.5 /usr/local/hadoop
292-
when: folder_existed.stat.exists == true
293-
294335
- name: set HADOOP_HOME
295336
blockinfile:
296337
path: /etc/profile
@@ -306,7 +347,7 @@ PLAY RECAP *********************************************************************
306347
```
307348

308349

309-
- 执行命令:`ansible-playbook /opt/jdk8-playbook.yml`
350+
- 执行命令:`ansible-playbook /opt/hadoop-playbook.yml`
310351

311352

312353

@@ -317,7 +358,7 @@ PLAY RECAP *********************************************************************
317358

318359
## 资料
319360

320-
361+
- [ANSIBLE模块 - shell和command区别](https://www.jianshu.com/p/081139f73613)
321362
- <https://www.the5fire.com/ansible-guide-cn.html>
322363
- <https://www.jianshu.com/p/62388a4fcbc6>
323364
- <http://showme.codes/2017-06-12/ansible-introduce/>

markdown-file/Kafka-Install-And-Settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ num.partitions=1
427427
# 允许删除topic
428428
delete.topic.enable=false
429429
# 允许自动创建topic(默认是 true)
430-
auto.create.topics.enable=false
430+
auto.create.topics.enable=true
431431
# 磁盘IO不足的时候,可以适当调大该值 ( 当内存足够时 )
432432
#log.flush.interval.messages=10000
433433
#log.flush.interval.ms=1000

0 commit comments

Comments
 (0)