valerieJJ / JJCloud

micro-service system based on spring-cloud and zookeeper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intro

This is a project that is currently under development.

It extends my previous backend project "JJSpring" to micro-services using springcloud and zookeeper.

The spring-boot modules are registered on different zk nodes(on virtual machine).

  1. Functions
  • Welcome page: movie display + Login registration entrance (jump to login page)
  • after login -> mainpage, menu bar includes: movie search + popular movies(number of ratings) + high rating movie list(zset) + user home page
  • Movie search: (drop-down list) select search method (name, actor, language, year), input search information, then jump to page to show the result list
  • Click movie picture => enter movie detail page, operation: score the movie, add to my favourite folder
  • User home page: user information modification, logout, my favorites, user browsing history (redis-list)
  1. Techniques
  • springcloud, zookeeper, feign+hystrix
  • redis, mongodb, mysql,elasticsearch
  • thymleaf
  • maven, git, docker
  1. Services
  • api-common
  • movie-service: zk1(mongodb,elasticsearch), CompletableFuture
  • user-module: zk2(mysql)
  • web-consumer:zk3(redis), Feign, Hystrix, Intercepter, AOP(user identity & authentication)
  • order-module is currently under development

image-20220426111822894

image

image

image

image

shell commands for zookeeper cluster

case $1 in
"start"){
   for i in master hadoop0 hadoop2
   do
       if [ "$i" == "master" ];then
           echo "starting master..."
           ssh $i "/Users/jj/zookeepers/zk1/bin/zkServer.sh start"
       else
           echo "starting hadoop $i zookeeper..."
           ssh $i "docker start zk-container"
       fi
   	echo "started!"
   done
};;
"status"){
   for i in master hadoop0 hadoop2
   do
       echo "status of $i :"
       if [ "$i" == "master" ];then
           ssh $i "/Users/jj/zookeepers/zk1/bin/zkServer.sh status"
       elif [ "$i" == "hadoop0" ];then
           ssh $i "~/Documents/zk2/bin/zkServer.sh status"
       elif [ "$i" == "hadoop2" ];then
           ssh $i "~/Documents/zk3/bin/zkServer.sh status"
       fi
   done
};;
"stop"){
   for i in master hadoop0 hadoop2
   do
       echo "stopping $i :"
       if [ "$i" == "master" ];then
           ssh $i "/Users/jj/zookeepers/zk1/bin/zkServer.sh stop"
       else
           ssh $i "docker stop zk-container"
       fi
   done
};;
esac

mongoDB

Useful Tool: MongoDB - Robo

start server:

jj@master ~ % mongod --dbpath /usr/local/Cellar/data/db

redis

start server:

jj@master ~ % redis-server image

elasticsearch

jj@master ~ % elasticsearch(It has already been added to my system environment variables) Here it is applied to improve the speed of searching movies in various ways.

It will return the movie ID retrieved based on the content, based on which you can further check the MongoDB table to get more information.

zookeeper utils

image

System showcases

Here are some system showcases: Note: To save storage space, I didn't download all the poster images for each movie. Instead, I used the same images as general movie posters.

![image-20220316094252015](/Users/jj/Library/Application Support/typora-user-images/image-20220316094252015.png)

image

![piccc](/Users/jj/Pictures/piccc.png)

image

image

image

About

micro-service system based on spring-cloud and zookeeper


Languages

Language:Java 40.7%Language:HTML 34.2%Language:CSS 25.0%Language:Dockerfile 0.0%