代码拉取完成,页面将自动刷新
资源文件
---
kind: DaemonSet
apiVERSION: apps/V1
metadata:
name: mayapache
sepc:
selector
matchLabels:
myapp: httpd
template:
metadata:
labels:
myapp: httpd
spec:
contianers:
- name: webcluser
image: 192.168.1.100:5000/myos:httpd
stdin: false
tty: false
ports:
- protocol: TCP
containerPort: 80
restartPolicy: Always
---
kind: Service
appVersion: v1
metadata:
name: apache
spec:
ports:
- protocol: TCP
port: 80
targetPort: 80
selector:
myapp: httpd
type: ClusterIP
作业2
[root@ecs-proxy ~]# mkdir es-setup
[root@ecs-proxy ~]# cd es-setup
[root@ecs-proxy es-setup]# vim ansible.cfg
[defaults]
inventory = myhost
host_key_checking = False
[root@ecs-proxy es-setup]# vim myhost
[es]
192.168.1.[41:45]
[root@ecs-proxy es-setup]# vim hosts
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.1.41 es-0001
192.168.1.42 es-0002
192.168.1.43 es-0003
192.168.1.44 es-0004
192.168.1.45 es-0005
[root@ecs-proxy es-setup]# vim elasticsearch.yml
17: cluster.name: my-es
23: node.name: {{ ansible_hostname }}
55: network.host: 0.0.0.0
68: discovery.zen.ping.unicast.hosts: ["es-0001", "es-0002"]
[root@ecs-proxy es-setup]# vim essetup.yaml
---
- name: elasticsearch 集群批量安装部署
hosts: es
tasks:
- copy:
src: hosts
dest: /etc/hosts
owner: root
group: root
mode: 0644
- name: install elasticsearch
yum:
name: java-1.8.0-openjdk,elasticsearch
state: installed
- template:
src: elasticsearch.yml
dest: /etc/elasticsearch/elasticsearch.yml
owner: root
group: root
mode: 0644
- service:
name: elasticsearch
state: restarted
enabled: yes
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。