SeptemberHX / MFramework

MFramework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MFramework

Components

  • MClient: Programming framework, MPF4M
  • MClusterAgent: Edge Cluster Agent for gathering information of edges and accepting requests from MServer
  • MContainerMetricsCollector: Container Metrics collector. It is responsible for collecting CPU, RAM usages.
  • MEurekaServer: A modified version of eureka
  • MGateway: Accept requests from users
  • MInfoCollector: Collect the logs on each edge nodes
  • MServer: Orchestrator on the cloud

Deploy

Build

  1. export JAVA_HOME to java 8
  2. mvn package. A runnable *.jar file should exist in */target/

Deploy Kubernetes with several server nodes

  1. deploy Kubernetes
  2. label each node with node=XXX. Replace XXX with the real node id
  3. make sure that the kubectl proxy server is running on the default port
  4. create a namespace named kube-test with kubectl create namespace kube-test

Run MEurekaServer

It works like the default eureka server.

Default server deployment template yaml file

  1. modify yaml/template.yaml
  2. the envs MCLUSTER_IP and MCLUSTER_PORT should be the ip and port of your MEurekaServer
  3. the mount path of log-volume could be changed to other places. All the logs generated by each instances are saved in it

Log Collector

  1. On each server nodes, make sure log directory in yaml/template.yaml exists
  2. deploy logstash, elasticsearch. Make sure elasticsearch is configured correctly so that logstash could send data to it
  3. On each server nodes, export environment variables MCLIENT_LOGSTASH_IP and MCLIENT_LOGSTASH_PORT to the ip and port of logstash
  4. run log collector in MInfoCollector/target/

Deploy MClusterAgent

  1. modify application.yaml
    1. mclientagent.server.ip/port: ip and port of the MServer
    2. mclientagent.elasticsearch.ip/port: ip and port of the elasticsearch
  2. deploy it on the main node of your kubernetes cluster

Deploy MServer

modify application.yaml, rebuild, and run.

MGateway

Deploy on the nodes you want. env MCLUSTER_IP and MCLUSTER_PORT are needed for the ip and port of MClusterAgent.

Data preparation

  1. server descriptions: please refer to com.septemberhx.common.bean.server.MRegisterNodesBean in common. Send Post request with json data to MServer - /mserver/registerNodes
  2. service descriptions: please refer to com.septemberhx.common.bean.server.MRegisterServicesBean in common. Send Post request with json data to MServer - /mserver/registerServices

About

MFramework


Languages

Language:Java 99.6%Language:Shell 0.2%Language:Dockerfile 0.2%