You can get a lot of information about site title in this url. And Elasticsearch, Kibana and Filebeat installation will explain under this topic.To do this you should follow steps below.

ELASTICSEARCH INSTALLATION

Step1:
Create new storage class on your cluster, if you dont have. This installation has been tried the which has a one worker node cluster. Then we will use the statefulset resources for installation of elasticsearch.Create new storage class on your cluster, if you dont have. This installation has been tried on the kubernetes cluster which has a one worker node cluster. Then we will use the statefulset resources for installation of elasticsearch application.

alias k=kubectl
vim st-class.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
k apply -f st-class.yaml

Step2:
Create folder under the your worker node to using the host path, then create persistent volume resources. 
Light Info: We have been used the local storage for this installation. This storage class not supported the automatically creating pv resources. If you have another storage class like ceph and etc. you have not to create the persisten volume, because your storage class will support automaticall creating persisten volume resources. You just specify the pvc template in the statefulset yaml file that’s enough.

Run the below command under the worker node(just command of folder create)

mkdir /opt/es01 /opt/es02 /opt/es03
vim es-pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: espv01
  labels:
    type: local01
spec:
  storageClassName: "local-storage"
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/opt/es01"
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: espv02
  labels:
    type: local02
spec:
  storageClassName: "local-storage"
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/opt/es02"
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: espv03
  labels:
    type: local03
spec:
  storageClassName: "local-storage"
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/opt/es03"
kubectl create -f es-pv.yaml

Step2:
Create service yaml file to access the elasticsearch nodes.

vim elksvc.yaml
apiVersion: v1
kind: Service
metadata:
  name: es01
  labels:
    app: es01
spec:
  ports:
  - name: rest
    port: 9200
    protocol: TCP
  - name: internode
    port: 9300
    protocol: TCP
  selector:
    app: es01 
  type: NodePort
---
apiVersion: v1
kind: Service
metadata:
  name: es02
  labels:
    app: es02
spec:
  ports:
  - name: rest
    port: 9200
    protocol: TCP
  selector:
    app: es01 
  type: NodePort
kubectl create -f elksvc.yaml

Tags:

No responses yet

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

Latest Comments