当前位置: 首页 > news >正文

诸城市网站建设网站建设管理和运行维护制度

诸城市网站建设,网站建设管理和运行维护制度,做爰全过程免费的视网站,上海博览会2022IMDG或内存数据网格不是内存中关系数据库#xff0c;NOSQL数据库或关系数据库。 它是另一种软件数据存储库。 数据模型分布在单个位置或多个位置的许多服务器上。 这种分布称为数据结构。 这种分布式模型被称为“无共享”架构。 IMDG具有以下特征#xff1a; 所有服务器可以… IMDG或内存数据网格不是内存中关系数据库NOSQL数据库或关系数据库。 它是另一种软件数据存储库。 数据模型分布在单个位置或多个位置的许多服务器上。 这种分布称为数据结构。 这种分布式模型被称为“无共享”架构。 IMDG具有以下特征 所有服务器可以在每个站点中处于活动状态。 所有数据都存储在服务器的RAM中。 可以不中断地添加或删除服务器以增加可用的RAM量。 数据模型是非关系的是基于对象的。 用平台独立语言编写的分布式应用程序。 数据结构具有弹性可以无中断地自动检测和恢复单个或多个服务器。 大多数情况下我们将IMDG用于应用程序服务器的Web会话管理并用作分布式缓存或L2缓存。 Hazelcast社区的添加是我们一直以来最喜欢的IMDG工具但是从hazelcast社区版的最新情况来看它的性能让我们感到非常不满意。 作为HazelCast的快速替代方案我们决定尝试使用 Apache点燃 。 这篇文章专门针对apache点燃可用于快速启动指南。 对于安装我将使用具有以下配置的2个Redhat操作系统虚拟机 CPU2 内存4 硬盘25 GB 操作系统Redhat Santiago 从Apache ignite6的许多功能中我们将仅研究以下功能 准备操作系统 使用Spring使用DataGrid MyBatis缓存配置 Spring缓存 安装apache点燃 前提条件 Java 1.7及更高版本 打开端口47500..47509、8080用于Rest接口47400、4710047101、4810048101、3110031101在操作系统中安装JDK之后我们必须打开上述端口。 通过执行以下命令我们可以操纵iptables。 vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 47500:47509 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 47400 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 47100 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 47101 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 48100 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 48101 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 31100 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 31101 -j ACCEPT/etc/init.d/iptables restart 在几台机器上安装Apache ignite 让我们从以下链接下载ignite 1.5.0final版本。 将档案解压缩到os中的任何位置例如/ opt / apache-ignite 将环境路径IGNITE_HOME添加到apache ignite的主目录中。 将文件夹$ IGNITE_HOME / libs / optional / ignite-rest-http复制到/home/user/apache-ignite-fabric-1.5.0/libs它将通过REST接口启用apign点火。 运行命令ignite.sh examples / config / example-cache.xml以启动apache ignite。 如果一切正常您应该在控制台中看到以下日志 [12:32:01] Ignite node started OK (idceb614ca) [12:32:01] Topology snapshot [ver4, servers2, clients0, CPUs3, heap2.0GB] 并且通过网址http// hostport / ignitecmd version也可以通过http获得ignite 使用Spring使用DataGrid 首先我们必须构建Maven项目以编写一堆代码来检查apache Ignite的功能。 将以下依赖项添加到pom.xml dependencygroupIdorg.apache.ignite/groupIdartifactIdignite-core/artifactIdversion${ignite.version}/version/dependencydependencygroupIdorg.apache.ignite/groupIdartifactIdignite-spring/artifactIdversion${ignite.version}/version/dependencydependencygroupIdorg.apache.ignite/groupIdartifactIdignite-indexing/artifactIdversion${ignite.version}/version/dependency!-- myBatis --dependencygroupIdorg.mybatis.caches/groupIdartifactIdmybatis-ignite/artifactIdversion1.0.0-beta1/version/dependencydependencygroupIdorg.mybatis/groupIdartifactIdmybatis-spring/artifactIdversion1.2.4/version/dependencydependencygroupIdorg.mybatis/groupIdartifactIdmybatis/artifactIdversion3.3.1/version/dependency!-- Oracle 12--dependencygroupIdcom.oracle/groupIdartifactIdojdbc6/artifactIdversion11.2.0.3/version/dependency 请注意Oracle JDBC客户端jar应该位于本地Maven存储库中。 就我而言我使用Oracle 11.2.02客户端。 使用以下上下文在资源目录中添加spring-context.xml文件 beans xmlnshttp://www.springframework.org/schema/beansxmlns:contexthttp://www.springframework.org/schema/contextxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:mvchttp://www.springframework.org/schema/mvcxmlns:cachehttp://www.springframework.org/schema/cachexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/cachehttp://www.springframework.org/schema/cache/spring-cache-3.1.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd !-- Enable annotation-driven caching. --cache:annotation-driven/context:property-placeholder locationclasspath:jdbc.properties/!-- beans --bean idignite.cfg classorg.apache.ignite.configuration.IgniteConfigurationproperty namegridName valueTestGrid/!-- Enable client mode. --property nameclientMode valuetrue/property namecacheConfigurationlist!-- Partitioned cache example configuration (Atomic mode). --bean classorg.apache.ignite.configuration.CacheConfiguration!--property nameatomicityMode valueATOMIC/--!-- Set cache mode. --property namecacheMode valuePARTITIONED/property namebackups value1/property namestatisticsEnabled valuetrue //bean/list/property!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. --property namediscoverySpibean classorg.apache.ignite.spi.discovery.tcp.TcpDiscoverySpiproperty nameipFinder!-- Uncomment static IP finder to enable static-based discovery of initial nodes. --!--bean classorg.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder--bean classorg.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinderproperty nameaddresseslist!-- In distributed environment, replace with actual host IP address. --valueAdd your node ip address/valuevalueadd your node ip address/value/list/property/bean/property/bean/property/beanbean idsqlSessionFactory classorg.mybatis.spring.SqlSessionFactoryBeanproperty namedataSource refdataSource /property namemapperLocations valueclasspath*:com/blu/ignite/dao/*Mapper.xml//beanbean iddataSource classoracle.jdbc.pool.OracleDataSource destroy-methodcloseproperty nameURL value${jdbc.url} /property nameuser value${jdbc.username}/property namepassword value${jdbc.password}/property nameconnectionCachingEnabled valuetrue//bean /beans 让我们检查一些配置属性 属性名称“ clientMode”值“ true” –此属性将强制当前应用程序作为客户端运行。 属性名称“ cacheMode”值“已分配” –缓存模式将被分区缓存模式也可被复制。 属性名“备份”值“ 1” –总是在另一个节点中有一个冗余的缓存元素。 属性名称“ statisticsEnabled”值“ true” –此属性将激活缓存统计信息。 现在让我们写一些 public class SpringIgniteRun {public static void main(String[] args) throws Exception{System.out.println(Run Spring example!!);ApplicationContext ctx new ClassPathXmlApplicationContext(spring-core.xml);IgniteConfiguration igniteConfiguration (IgniteConfiguration) ctx.getBean(ignite.cfg);Ignite ignite Ignition.start(igniteConfiguration);// get or create cacheIgniteCache cache ignite.getOrCreateCache(myCacheName);for(int i 1; i 1000; i){cache.put(i, Integer.toString(i));}for(int i 1; i1000;i){System.out.println(Cache get: cache.get(i));}Thread.sleep(20000); // sleep for 20 seconds// statisticsSystem.out.println(Cache Hits: cache.metrics(ignite.cluster()).getCacheHits());ignite.close();} } 上面的代码是自我解释的我们只创建一个名为“ myCacheName”的缓存并添加1000 String整数值。 将值插入缓存后我们还从缓存中读取元素并检查统计信息。 通过ignitevisorcmd您还可以监视数据网格随后您可以找到网格统计信息的屏幕截图 MyBatis缓存配置 现在让我们添加MyBatis ORM l2缓存并检查其工作方式。 bean idservicesBean classcom.blu.ignite.WebServicesproperty namedao refuserServicesBean//beanbean iduserServicesBean classcom.blu.ignite.dao.UserServicesproperty nameuserMapper refuserMapper//beanbean idsqlSessionFactory classorg.mybatis.spring.SqlSessionFactoryBeanproperty namedataSource refdataSource /property namemapperLocations valueclasspath*:com/blu/ignite/dao/*Mapper.xml//beanbean iddataSource classoracle.jdbc.pool.OracleDataSource destroy-methodcloseproperty nameURL value${jdbc.url} /property nameuser value${jdbc.username}/property namepassword value${jdbc.password}/property nameconnectionCachingEnabled valuetrue//beanbean iduserMapper autowirebyName classorg.mybatis.spring.mapper.MapperFactoryBeanproperty namemapperInterface valuecom.blu.ignite.mapper.UserMapper /property namesqlSessionFactory refsqlSessionFactory //beanbean classorg.mybatis.spring.mapper.MapperScannerConfigurerproperty namebasePackage valuecom.blu.ignite.mapper //bean 我们添加了SQLsessionFactoryMyBatis映射器和Service Bean。 现在让我们添加* .Mapper.xml ?xml version1.0 encodingUTF-8 ?!DOCTYPE mapperPUBLIC -//mybatis.org//DTD Mapper 3.0//EN http://mybatis.org/dtd/mybatis-3-mapper.dtdmapper namespacecom.blu.ignite.mapper.UserMappercache typeorg.mybatis.caches.ignite.IgniteCacheAdapter /select idgetUser parameterTypeString resultTypecom.blu.ignite.dto.User useCachetrueSELECT * FROM users WHERE id #{id}/selectselect idgetUniqueJob parameterTypeString resultTypeString useCachefalseselect unique job from emp order by job desc/select/mapper emp和dept表的完整sqlDDL / DML脚本位于com / blu / ignite / scripts目录中。我创建了一个简单的Web服务以获取用户和员工的独特工作。 这是Web服务的代码如下所示 WebService(name BusinessRulesServices,serviceNameBusinessRulesServices,targetNamespace http://com.blu.rules/services) public class WebServices {private UserServices userServices;WebMethod(operationName getUserName)public String getUserName(String userId){User user userServices.getUser(userId);return user.getuName();}WebMethod(operationName getUniqueJobs)public List getUniqueJobs(){return userServices.getUniqueJobs();}WebMethod(exclude true)public void setDao(UserServices userServices){this.userServices userServices;}} 调用Web方法getUserName将查询数据库并将查询结果缓存在ignite缓存中。 Spring缓存 使用spring缓存您可以实现任何spring bean方法的返回值的缓存。 Apache ignite将通过您将通过注释Cacheable“ returnHello”提供的缓存名称来创建缓存例如如果我具有如下方法 Cacheable(returnHello)public String sayhello(String str){System.out.println(Client says: str);return hellostr;} 第一次调用该方法时将在ignite中创建一个带有参数名称的复制缓存下次调用上述方法时将从缓存中返回该值。 现在就足够了。 很快我将以apache ignite的一些新功能返回。 该项目的完整源代码可在github中找到。 翻译自: https://www.javacodegeeks.com/2016/02/quick-start-memory-data-grid-apache-ignite.html
http://www.pierceye.com/news/768700/

相关文章:

  • 免费论坛建站二 网站建设的重要性
  • wordpress站点迁移怎样做带音乐的表白网站
  • 海淀网站制作网站建设基本技术
  • 做一个平面网站的成本如何搭建一个app平台
  • 建设工程学部研究生培养网站义乌网站建设和制作
  • 简单的模板网站吉安网站建设jxthw
  • js做的网站佛山本地的网站设计公司
  • 企业网站页面网站建设朝阳
  • ui设计工具有哪些百度seo排名优化系统
  • 网站建设案例简介怎么写淘宝官方网站主页
  • 国外网站 dns南京模板做网站
  • 河北企业网站建设技术江西省外省建设入库网站
  • 网站建设的概念如何将自己做的网站放到网上去
  • 网站维护明细报价表最新的网站建设架构
  • 百度大全seo推广话术
  • 做网站赚钱流程英文网站建设注意什么
  • 腾讯 云上做网站教程开源系统 网站
  • 临沂罗庄做网站服装商城网站建设价格
  • 保定企业官网搭建对网站有效的优化软件
  • 网站后台代码在哪修改股权众筹网站建设
  • 站群源码北京公司注销
  • 营销型网站策划建设台州市住房和城乡建设厅网站
  • 达内网站开发课程wordpress自动添加标签页
  • 免费的个人网站空间我做淘宝网站卖东西怎么激活
  • 织梦dedecms女性时尚门户网站模板常州网络推广平台
  • 网站怎么在百度搜不到资源网源码
  • 怎样网站制作设计广西住房城乡建设部官网
  • 手机网站建设方案书王烨是哪个小说的主角
  • 临沂网站案例百事可乐网络营销推广方法
  • 广州网站建设信科网络冷水滩网站建设