Redis

大型分布式存储方案MinIO介绍,看完你就懂了!

。_饼干妹妹 提交于 2021-01-28 05:12:31
1、MinIO是什么? 官方解释:MinIO 是一个基于Apache License v2.0开源协议的对象存储服务。它兼容亚马逊S3云存储服务接口,非常适合于存储大容量非结构化的数据,例如图片、视频、日志文件、备份数据和容器/虚拟机镜像等,而一个对象文件可以是任意大小,从几kb到最大5T不等。 MinIO是一个非常轻量的服务,可以很简单的和其他应用的结合,类似 NodeJS, Redis 或者 MySQL。 2、MinIO有哪些优势? 2.1 开发文档全面 MinIO作为一款基于Golang 编程语言开发的一款高性能的分布式式存储方案的开源项目,有十分完善的官方文档。。 官网文档地址:https://docs.min.io/cn/ 2.2 高性能 MinIO号称是目前速度最快的对象存储服务器。在标准硬件上,对象存储的读/写速度最高可以高达183 GB/s和171 GB/s。对象存储可以作为主存储层,用来处理Spark、Presto、TensorFlow、H2O.ai等各种复杂工作负载以及成为Hadoop HDFS的替代品。 MinIO用作云原生应用程序的主要存储,和传统对象存储相比,云原生应用程序需要更高的吞吐量和更低的延迟。而这些都是MinIO能够达成的性能指标。 2.3 支持全面 目前MinIO支持市面主流的开发语言并且可以通过SDK快速集成快速集成使用。 2.4 AWS

RedisSystemException: java.lang.ClassCastException: [B cannot be cast to java.lang.Long

不问归期 提交于 2021-01-28 03:05:40
问题 I meet this exception when using jedis with spring-data-redis in multi threading environment: org.springframework.data.redis.RedisSystemException: Unknown redis exception; nested exception is java.lang.ClassCastException: [B cannot be cast to java.lang.Long at org.springframework.data.redis.FallbackExceptionTranslationStrategy.getFallback(FallbackExceptionTranslationStrategy.java:48) at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate

RedisSystemException: java.lang.ClassCastException: [B cannot be cast to java.lang.Long

孤人 提交于 2021-01-28 00:33:28
问题 I meet this exception when using jedis with spring-data-redis in multi threading environment: org.springframework.data.redis.RedisSystemException: Unknown redis exception; nested exception is java.lang.ClassCastException: [B cannot be cast to java.lang.Long at org.springframework.data.redis.FallbackExceptionTranslationStrategy.getFallback(FallbackExceptionTranslationStrategy.java:48) at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate

Is there any way to work with sessions without locking on ASP.Net MVC site?

爱⌒轻易说出口 提交于 2021-01-27 23:05:41
问题 Is there any way to work with sessions without locking on ASP.Net MVC site ? Session lock mechanism leads many problems; When your site slow down little bit, users are start to hit "F5" on the keyboard. When they do this, requests are starting to wait each other. All those requests are hanging on IIS at " RequestAcquireState " state for session module. If a user made a simultaneous requests this will happen. Because session module in IIS and default session provider (Or generally custom ones)

人人都能看懂的 6 种限流实现方案!(纯干货)

淺唱寂寞╮ 提交于 2021-01-27 21:14:13
为了上班方便,去年我把自己在北郊的房子租出去了,搬到了南郊,这样离我上班的地方就近了,它为我节约了很多的时间成本,我可以用它来做很多有意义的事,最起码不会因为堵车而闹心了,幸福感直线上升。 但即使这样,生活也有其他的烦恼。南郊的居住密度比较大,因此停车就成了头痛的事,我租的是路两边的非固定车位,每次只要下班回来,一定是没有车位停了,因此我只能和别人的车并排停着,但这样带来的问题是,我每天早上都要被挪车的电话给叫醒,心情自然就不用说了。 但后来几天,我就慢慢变聪明了,我头天晚上停车的时候,会找第二天限行的车并排停着,这样我第二天就不用挪车了,这真是限行给我带来的“巨大红利”啊。 而 车辆限行就是一种生活中很常见的限流策略 ,他除了给我带来了以上的好处之外,还给我们美好的生活环境带来了一丝改善,并且快速增长的私家车已经给我们的交通带来了巨大的“负担 ” ,如果再不限行,可能所有的车都要被堵在路上,这就是限流给我们的生活带来的巨大好处。 从生活回到程序中,假设一个系统只能为 10W 人提供服务,突然有一天因为某个热点事件,造成了系统短时间内的访问量迅速增加到了 50W,那么导致的直接结果是系统崩溃,任何人都不能用系统了, 显然只有少人数能用远比所有人都不能用更符合我们的预期,因此这个时候我们要使用「限流 」 了 。 限流分类 限流的实现方案有很多种,磊哥这里稍微理了一下, 限流的分类

Airflow CROSSSLOT Keys in request don't hash to the same slot error using AWS ElastiCache

穿精又带淫゛_ 提交于 2021-01-27 19:56:07
问题 I am running apache-airflow 1.8.1 on AWS ECS and I have an AWS ElastiCache cluster (redis 3.2.4) running 2 shards / 2 nodes with multi-AZ enabled (clustered redis engine). I've verified that airflow can access the host/port of the cluster without any problem. Here's the logs: Thu Jul 20 01:39:21 UTC 2017 - Checking for redis (endpoint: redis://xxxxxx.xxxxxx.clustercfg.usw2.cache.amazonaws.com:6379) connectivity Thu Jul 20 01:39:21 UTC 2017 - Connected to redis (endpoint: redis://xxxxxx.xxxxxx

Redis store (or any database?) lock mechanism (NodeJS)

南笙酒味 提交于 2021-01-27 19:18:25
问题 I have the following problem: I'm using Redis with NodeJS together via mranney's driver and my NodeJS webserver is retrieving some data from Redis, doing some operations on it and saving it back to the Redis. But this operation (call it X) may take a while so multiple users can fire it at the same time on the same resources. So if a user A fires X and user B fires X at the same time I want user A to finish the job and then user B to get the (processed) data and do X. In the meantime user B

cannot connect to redis container from app container

血红的双手。 提交于 2021-01-27 11:25:03
问题 I follow the django channels tutorial to build a simple chat app. https://channels.readthedocs.io/en/latest/tutorial/part_1.html , it can work on my local machine with redis without docker. then now i want to put it into docker containers by docker compose file, but seems app cannot connect to redis container, i already try and google for two days, but seems all methods cannot work. so want to ask for help here folder structure my_project - mysite(django app) - ... somefolder and files -

cannot connect to redis container from app container

老子叫甜甜 提交于 2021-01-27 11:23:47
问题 I follow the django channels tutorial to build a simple chat app. https://channels.readthedocs.io/en/latest/tutorial/part_1.html , it can work on my local machine with redis without docker. then now i want to put it into docker containers by docker compose file, but seems app cannot connect to redis container, i already try and google for two days, but seems all methods cannot work. so want to ask for help here folder structure my_project - mysite(django app) - ... somefolder and files -

springboot项目redis分布式锁实现(基于luttuce)

左心房为你撑大大i 提交于 2021-01-27 11:17:51
问题背景 对于大部分的后端服务,服务很多都是多实例部署的,而在我们的工程中,比如说代码中定义的定时任务需要从数据库中捞数据,那么多机部署上的每个实例都会执行,那么就会存在数据重复上报,那么就不可避免得出现脏数据,影响数据的准确性。 问题分析 解决这个问题最直接的思路就是,当多机部署中无论哪个实例捞到了某条数据,那么其他的实例就不能再次捞取。针对这个思路,我们大致可以有以下两个解决方案: 1. 在数据库层解决。给访问的数据表中,增一个字段flag,标识是否已经上报过,每个实例上报一条,就更新一下这个状态,后面的实例再读到这一条时,发现上报过了,就不处理了。这就要改一下现在的读取方式,需要从数据库中逐条读取,避免脏数据。 2. 引入分布式锁,最简单的,就用redis实现,每个实例开始定时任务前,先尝试在redis中获取锁,如果获取得到,这个实例的定时任务就执行,否则就跳过。 对于第一个解决方案的实现本文不予说明,这种实现方式虽然可行,但是对于频繁更新数据库的操作我个人是非常不推荐的,性能方面可能会受到影响。本文主要想介绍一下方案2的实现。 方案实现 对于多机部署的问题,自然而然就可以想到分布式锁来保证任务执行的准确性。在Springboot项目中,最直接就是通过redis实现,我们知道,从Springboot 2.X开始,底层的redis客户端从Jedis换成了luttuce