Giter VIP home page Giter VIP logo

xultimate-resource's Introduction

xultimate-resource

采用Spring MVC,用于在FastDFS分布式文件系统中完成资源管理(上传、删除、下载)的ShowCase。图片类资源的缩放、剪裁、水印等功能通过已封装好AWT和im4java进行处理。

LVS(Keepalived) + HAProxy + Varnish + Tengine + FastDFS + GD
  • LVS作为第一层负载均衡,通过Keepalived实现高可用,采用"DR"模式,"最小连接"调度算法。可水平扩展。
  • HAProxy作为第二层负载均衡,不需要实现高可用,采用"一致性Hash"算法。可水平扩展。
  • Varnish作为反向代理服务器,主要用于缓存服务器,多台部署,采用"URL Hash"算法,不实现高可用。支持水平扩展,根据上层负载均衡算法衡量数据丢失。
  • Tengine作为Web服务器,可添加浏览器缓存,不实现高可用。水平扩展程度视FastDFS的存储节点而定。
  • FastDFS作为资源的存储中心,支持水平扩展、高可用。通过fastdfs-nginx-module和Tengine配合使用。
  • GD实现实时缩略图功能。通过ngx_http_image_filter_module模块和Tengine配合使用。
  • 通过Tengine的rewrite指令实现访问同一资源的不同地址(/350x350/g1/M01...a.jpg、/160x160/g1/M01...a.jpg)完成不同缩略图展现功能(参考京东图片展示)。
LVS(Keepalived) + HAProxy + Varnish + Tomcat(AIO/NIO) + FastDFS + GraphicsMagick/AWT
  • LVS作为第一层负载均衡,通过Keepalived实现高可用,采用"DR"模式,"最小连接"调度算法。可水平扩展。
  • HAProxy作为第二层负载均衡,不需要实现高可用,采用"一致性Hash"算法。可水平扩展。
  • Varnish作为反向代理服务器,主要用于缓存服务器,多台部署,采用"URL Hash"算法,不实现高可用。支持水平扩展,根据上层负载均衡衡量数据丢失。
  • Tomcat作为Java应用服务器,可添加浏览器缓存,水平扩展程度视FastDFS的存储节点而定。
  • FastDFS作为资源的存储节点,支持水平扩展、高可用。通过JAVA API调用获取图片。
  • 默认使用GraphicsMagick实现实时缩略图功能。可选择ImageMagick或AWT。GraphicsMagick/ImageMagick的调用通过im4java完成。
  • 通过Spring MVC支持访问同一资源的不同地址(/350x350/g1/M01...a.jpg、/160x160/g1/M01...a.jpg)完成不同缩略图展现功能(参考京东图片展示)。

xultimate-browse

  • 该项目提供的功能用于替代Tengine、fastdfs-nginx-module、ngx_http_image_filter_module模块,前者模块可实现资源浏览,后者模块用于实时缩略图,但是没有使用GraphicsMagick。
  • 提供资源下载和图片下载功能,采用浏览器缓存。图片下载功能支持原图和实时缩略图,图片处理功能默认使用im4java + GraphicsMagick实现,支持AWT或ImageMagick。
  • 项目Web层采用Spring MVC。
  • 浏览器缓存功能通过xultimate-web工程的BrowserCacheGenerator完成。
  • 图片处理(缩放等)功能采用xultimate-context的image模块处理。
  • 资源下载功能采用xultimate-context-support的dfs/fastdfs模块处理。

xultimate-upload

  • 提供资源上传和图片上传,以及资源删除功能。
  • 项目Web层采用Spring MVC。
  • 图片处理(缩放等)功能采用xultimate-context的image模块处理。
  • 资源上传、删除功能采用xultimate-context-support的dfs/fastdfs模块处理。

xultimate-resource's People

Contributors

daniellitoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xultimate-resource's Issues

依赖jar包没提供

正在做FastDFS的分布式存储方案,想从项目中了解些设计和想法,发现依赖的xultimate-core和xultimate-webmvc模块没有提供,Daniel方便提供或开源这两个jar吗?

启动项目报错

报了大量错误,主要是这一句:

Can not get system java compiler. Please run with JDK (NOT JVM), 
or configure the httl.properties: compiler=httl.spi.compilers.JavassistCompiler, 
and add javassist.jar. 

不知道是不是还需要配置什么?我的系统环境跟往常一样,从未遇到这个问题,网上也搜不到。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.danielli.xultimate.web.servlet.view.httl.HttlViewResolver#0' defined in class path resource [applicationContext-servlet.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to init property value. key: engine, value: httl.spi.engines.DefaultEngine, cause: Failed to init properties of bean class httl.spi.engines.DefaultEngine, cause: Failed to init property value. key: map.converter, value: httl.spi.converters.MultiMapConverter, cause: Failed to init properties of bean class httl.spi.converters.MultiMapConverter, cause: Failed to init property value. key: map.converters, value: httl.spi.converters.StringMapConverter, cause: Failed to init properties of bean class httl.spi.converters.StringMapConverter, cause: Failed to init property value. key: codecs, value: httl.spi.codecs.JsonCodec, cause: Failed to init properties of bean class httl.spi.codecs.JsonCodec, cause: Failed to init property value. key: compiler, value: httl.spi.compilers.AdaptiveCompiler, cause: Failed to init properties of bean class httl.spi.compilers.AdaptiveCompiler, cause: Can not get system java compiler. Please run with JDK (NOT JVM), or configure the httl.properties: compiler=httl.spi.compilers.JavassistCompiler, and add javassist.jar.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Failed to init property value. key: engine, value: httl.spi.engines.DefaultEngine, cause: Failed to init properties of bean class httl.spi.engines.DefaultEngine, cause: Failed to init property value. key: map.converter, value: httl.spi.converters.MultiMapConverter, cause: Failed to init properties of bean class httl.spi.converters.MultiMapConverter, cause: Failed to init property value. key: map.converters, value: httl.spi.converters.StringMapConverter, cause: Failed to init properties of bean class httl.spi.converters.StringMapConverter, cause: Failed to init property value. key: codecs, value: httl.spi.codecs.JsonCodec, cause: Failed to init properties of bean class httl.spi.codecs.JsonCodec, cause: Failed to init property value. key: compiler, value: httl.spi.compilers.AdaptiveCompiler, cause: Failed to init properties of bean class httl.spi.compilers.AdaptiveCompiler, cause: Can not get system java compiler. Please run with JDK (NOT JVM), or configure the httl.properties: compiler=httl.spi.compilers.JavassistCompiler, and add javassist.jar.
    at httl.util.BeanFactory.getInstance(BeanFactory.java:323)
    at httl.util.BeanFactory.createBean(BeanFactory.java:139)
    at httl.Engine.getEngine(Engine.java:127)
    at httl.web.WebEngine.setServletContext(WebEngine.java:149)
    at httl.web.springmvc.HttlViewResolver.afterPropertiesSet(HttlViewResolver.java:40)
    at org.danielli.xultimate.web.servlet.view.httl.HttlViewResolver.afterPropertiesSet(HttlViewResolver.java:31)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
    ... 28 more
Caused by: java.lang.IllegalStateException: Failed to init properties of bean class httl.spi.engines.DefaultEngine, cause: Failed to init property value. key: map.converter, value: httl.spi.converters.MultiMapConverter, cause: Failed to init properties of bean class httl.spi.converters.MultiMapConverter, cause: Failed to init property value. key: map.converters, value: httl.spi.converters.StringMapConverter, cause: Failed to init properties of bean class httl.spi.converters.StringMapConverter, cause: Failed to init property value. key: codecs, value: httl.spi.codecs.JsonCodec, cause: Failed to init properties of bean class httl.spi.codecs.JsonCodec, cause: Failed to init property value. key: compiler, value: httl.spi.compilers.AdaptiveCompiler, cause: Failed to init properties of bean class httl.spi.compilers.AdaptiveCompiler, cause: Can not get system java compiler. Please run with JDK (NOT JVM), or configure the httl.properties: compiler=httl.spi.compilers.JavassistCompiler, and add javassist.jar.
    at httl.util.BeanFactory.injectInstance(BeanFactory.java:255)
    at httl.util.BeanFactory.getInstance(BeanFactory.java:275)
    ... 35 more

... ...

2015-01-27 23:17:15,287 [xultimate] ERROR [localhost-startStop-1] org.springframework.web.servlet.DispatcherServlet [FrameworkServlet.java:467] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.danielli.xultimate.web.servlet.view.httl.HttlViewResolver#0' defined in class path resource [applicationContext-servlet.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to init property value. key: engine, value: httl.spi.engines.DefaultEngine, cause: Failed to init properties of bean class httl.spi.engines.DefaultEngine, cause: Failed to init property value. key: map.converter, value: httl.spi.converters.MultiMapConverter, cause: Failed to init properties of bean class httl.spi.converters.MultiMapConverter, cause: Failed to init property value. key: map.converters, value: httl.spi.converters.StringMapConverter, cause: Failed to init properties of bean class httl.spi.converters.StringMapConverter, cause: Failed to init property value. key: codecs, value: httl.spi.codecs.JsonCodec, cause: Failed to init properties of bean class httl.spi.codecs.JsonCodec, cause: Failed to init property value. key: compiler, value: httl.spi.compilers.AdaptiveCompiler, cause: Failed to init properties of bean class httl.spi.compilers.AdaptiveCompiler, cause: Can not get system java compiler. Please run with JDK (NOT JVM), or configure the httl.properties: compiler=httl.spi.compilers.JavassistCompiler, and add javassist.jar.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482) ~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) ~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626) ~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) ~[spring-context-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at javax.servlet.GenericServlet.init(GenericServlet.java:160) ~[servlet-api.jar:3.0.FR]
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) ~[catalina.jar:7.0.37]
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) ~[catalina.jar:7.0.37]
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) ~[catalina.jar:7.0.37]
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033) ~[catalina.jar:7.0.37]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317) ~[catalina.jar:7.0.37]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[catalina.jar:7.0.37]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) ~[catalina.jar:7.0.37]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) ~[catalina.jar:7.0.37]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_05]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_05]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_05]

上传文件

老师,好:
项目部署后上传文件,代码走到这一行报错:storageClientTemplate.execute(new AbstractStorageClientReturnedCallback(),错误信息为:connect to server 10.136.10.232:22122 fail
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)

意思是,我还要部署一个跟踪服务器客户端吗?跟踪服务器是哪个,我怎么部署?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.