OpenShift实战(六):OpenShift日志监控EFK

dukuan 2018-04-20 原文

OpenShift实战(六):OpenShift日志监控EFK

1、镜像下载

  为了防止安装过程中由于镜像下载缓慢导致自动部署失败,所以首先提前下载好EFK镜像。

docker pull openshift/origin-logging-fluentd
docker pull openshift/origin-logging-elasticsearch
docker pull openshift/origin-logging-kibana
docker pull openshift/origin-logging-auth-proxy

2、创建持久化PV

  由于日志需要保存方便查询历史数据,故创建PV保存Elasticsearch的数据。

[root@master1 pv]# cat logging.json 
apiVersion: v1
kind: PersistentVolume
metadata:
  name: logging
spec:
  capacity:
    storage: 101Gi 
  accessModes:
  - ReadWriteOnce 
  nfs: 
    path: /export/pv/logging
    server: 192.168.10.110
  persistentVolumeReclaimPolicy: Retain

3、修改ansible hosts

  基于上节的hosts,添加的内容为黄色字体部分。

[root@master1 ~]# cat /etc/ansible/hosts
# Create an OSEv3 group that contains the masters, nodes, and etcd groups
[OSEv3:children]
masters
nodes
etcd
new_nodes
#lb
# Set variables common for all OSEv3 hosts
[OSEv3:vars]
# SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=root
ansible_become=yes
debug_level=2
openshift_deployment_type=origin
# If ansible_ssh_user is not root, ansible_become must be set to true
#ansible_become=true
openshift_repos_enable_testing=true
openshift_enable_service_catalog=false
template_service_broker_install=false
# uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]
openshift_disable_check=disk_availability,docker_storage,memory_availability,docker_image_availability,package_version
# config for metrics
openshift_release=3.6.1
openshift_metrics_install_metrics=true
openshift_metrics_image_prefix=openshift/origin-
openshift_metrics_image_version=v3.6.1
openshift_metrics_cassandra_pvc_size=21Gi

# config for logging
openshift_logging_install_logging=true
#openshift_logging_image_prefix=openshift/origin-
#openshift_logging_image_version=v3.6.1
openshift_logging_master_url=https://master1.haixiangjinfu.net:8443
openshift_logging_master_public_url=https://master1.haixiangjinfu.net:8443
#openshift_logging_storage_volume_size=101Gi
openshift_logging_kibana_hostname=kibana.haixiangjinfu.net
openshift_logging_es_allow_external=True
openshift_logging_es_hostname=elasticsearch.haixiangjinfu.net
openshift_logging_es_pvc_dynamic=true
openshift_logging_es_pvc_size=101Gi
openshift_logging_es_cluster_size=1
openshift_logging_curator_default_days=30
openshift_logging_use_journal=true
openshift_logging_journal_read_from_head=false
openshift_logging_es_cluster_size=1
openshift_logging_es_nodeselector={"region":"infra"}
openshift_logging_kibana_nodeselector={"region":"infra"}


# config by metrics
openshift_clock_enabled=true
#openshift_master_cluster_method=native
#openshift_master_cluster_hostname=openshift.haixiangjinfu.net
#openshift_master_cluster_public_hostname=openshift.haixiangjinfu.net
#openshift_node_kubelet_args={'pods-per-core': ['10'], 'max-pods': ['250'], 'image-gc-high-threshold': ['90'], 'image-gc-low-threshold': ['80']}
# host group for masters
[masters]
master1.haixiangjinfu.net
#master2.haixiangjinfu.net

# host group for lb
#[lb]
#etcd1.haixiangjinfu.net

# host group for etcd
[etcd]
etcd1.haixiangjinfu.net
etcd2.haixiangjinfu.net
etcd3.haixiangjinfu.net
# host group for nodes, includes region info
[nodes]
master1.haixiangjinfu.net
#master2.haixiangjinfu.net
node1.haixiangjinfu.net openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
node2.haixiangjinfu.net openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
node3.haixiangjinfu.net openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
node4.haixiangjinfu.net
node5.haixiangjinfu.net 
node6.haixiangjinfu.net openshift_node_labels="{'region': 'subnet8', 'zone': 'default'}"
node7.haixiangjinfu.net openshift_node_labels="{'region': 'subnet8', 'zone': 'default'}"
node8.haixiangjinfu.net openshift_node_labels="{'region': 'subnet7', 'zone': 'default'}"
node9.haixiangjinfu.net openshift_node_labels="{'region': 'subnet7', 'zone': 'default'}"
#
[new_nodes]

4、执行安装

ansible-playbook -i /etc/ansible/hosts openshift-ansible-openshift-ansible-3.6.173.0.104-1/playbooks/byo/openshift-cluster/openshift-logging.yml

5、成功界面

  

6、Web控制台验证

  fluentd主要用于数据采集,会在每个node上创建一个容器,服务会部署在logging下。

  

7、查看storage

  

 

8、查看日志

 

发表于 2018-04-20 14:41 杜先生的博客 阅读() 评论() 编辑 收藏

 

版权声明:本文为dukuan原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/dukuan/p/8877802.html

OpenShift实战(六):OpenShift日志监控EFK的更多相关文章

  1. OpenShift实战(三):OpenShift持久化存储Redis

    OpenShift实战(三):OpenShift持久化存储Redis 1、模板定义   修改OpenShift […]...

  2. OpenShift实战(五):OpenShift容器监控Metrics

    OpenShift实战(五):OpenShift容器监控Metrics 1、创建持久化metric pv卷 [ […]...

  3. Openshift 4.4 静态 IP 离线安装系列:准备离线资源

    原文链接:https://fuckcloudnative.io/posts/openshift4.4-inst […]...

  4. Openshift 4.4 静态 IP 离线安装系列:准备离线资源

    原文链接:https://fuckcloudnative.io/posts/openshift4.4-inst […]...

  5. 008.OpenShift Metric应用

    一 METRICS子系统组件 1.1 metric架构介绍 OpenShift metric子系统支持捕获和长 […]...

  6. 理解OpenShift(1):网络之 DNS(域名服务)

    理解OpenShift(1):网络之 Router 和 Route 理解OpenShift(2):网络之 DN […]...

  7. 理解OpenShift(4):用户及权限管理

    理解OpenShift(1):网络之 Router 和 Route 理解OpenShift(2):网络之 DN […]...

  8. 007.OpenShift管理应用部署

    一 REPLICATION CONTROLLERS 1.1 RC概述 RC确保pod指定数量的副本一直运行。如 […]...

随机推荐

  1. 迁移学习及领域自适应 Transfer Learning & Domain Adaptation

    文章内容主要整理自Sinno Jialin Pan and Qiang Yang的论文《A survey on […]...

  2. java_String类、StringBuilder类、Arrays类、Math类的使用

      String类 java.lang.String 类代表字符串。Java程序中所有的字符串文字(例如 “a […]...

  3. Nginx实战部署常用功能演示(超详细版),绝对给力~~~

    前言 上次分享了一些开发过程中常用的功能,但如果到真实环境中,其实还需要一些额外的配置,比如说跨域、缓存、配置 […]...

  4. HBuilder第三方插件开发(Android平台openinstall集成)

    开发插件 编写 Android 原生代码 下载 openinstall SDK 并将 jar 包拷贝到项目的 […]...

  5. 利用Wireshark截取数据包,并对数据包进行解析 – 不会熬夜的程序员

    利用Wireshark截取数据包,并对数据包进行解析 利用Wireshark截取ICMP数据包,并对数据包进行 […]...

  6. springboot中使用@Value读取配置文件

    springboot中使用@Value读取配置文件 一:配置文件 一般我们配制配置文件都是多套的。测试环境,生 […]...

  7. 洛谷P1462 通往奥格瑞玛的道路

    题目分析 题目描述 在艾泽拉斯,有n个城市。编号为1,2,3,…,n。 城市之间有m条双向的公路, […]...

  8. 2018我像一条野狗

    2018这一年随着P2P爆雷潮、国内游戏行业大规模的倒闭潮及裁员、滴滴安全事件、华为5G渡劫等等大事件发生,这 […]...

展开目录

目录导航