묻고 답해요
156만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결실습으로 배우는 선착순 이벤트 시스템
MySql Lock을 사용하지 않는 이유
강의에서 설명해주시기로는 쿠폰 개수를 가져오는 것부터 쿠폰 생성까지 lock을 걸어야 한다고 설명 주셨는데 이전 강의인 재고 관리 이슈와는 다르게 row가 아닌 table에 lock을 걸기 때문에 성능 이슈가 발생한다고 보면 될까요?
-
미해결실습으로 배우는 선착순 이벤트 시스템
발급가능 쿠폰개수가 1인당 2개이상일 때
안녕하세요! 강의 재미있고 유익하게 잘 듣고 있습니다 :)확장에 대해 생각해보니, Set을 이용해서는 중복방지 이상 개수 확장에 대해서 처리는 불가능 할 거 같아서요. 혹시, 2개 이상 N개 제한에 대한 확장 방법은 어떤게 있을까요??감사합니다!
-
미해결실습으로 배우는 선착순 이벤트 시스템
왜 쿠폰수가 너무 많을까요?
분명 현재 없는 상태이고결과가 자꾸 이상하게 나와서 sout 처리를 잠시 해보았습니다 package com.example.api.service; import com.example.api.domain.Coupon; import com.example.api.repository.CouponCountRepository; import com.example.api.repository.CouponRepository; import org.springframework.stereotype.Service; @Service public class ApplyService { private final CouponRepository couponRepository; private final CouponCountRepository couponCountRepository; public ApplyService(CouponRepository couponRepository, CouponCountRepository couponCountRepository) { this.couponRepository = couponRepository; this.couponCountRepository = couponCountRepository; } public void applyV1(Long userId) { Long count = couponRepository.count(); if(count > 100) { return; } couponRepository.save(new Coupon(userId)); } public void applyV2(Long userId) { Long count = couponCountRepository.increment(); System.out.println(count); if(count > 100) { return; } couponRepository.save(new Coupon(userId)); } } @SpringBootTest class ApplyServiceTest { @Autowired private ApplyService applyService; @Autowired private CouponRepository couponRepository; @Test public void applyOnce() { applyService.applyV1(1L); long count = couponRepository.count(); Assertions.assertEquals(1L, count); } @Test public void 여러명응모V1() throws InterruptedException { int threadCount = 1000; ExecutorService executorService = Executors.newFixedThreadPool(32); CountDownLatch latch = new CountDownLatch(threadCount); for(int i=0; i<threadCount; i++){ long userId = i; executorService.submit(() -> { try { applyService.applyV1(userId); } catch(Exception e) { System.out.println(e); }finally { latch.countDown(); } }); } latch.await(); long count = couponRepository.count(); assertThat(count).isEqualTo(100); } @Test public void 여러명응모V2() throws InterruptedException { int threadCount = 1000; ExecutorService executorService = Executors.newFixedThreadPool(32); CountDownLatch latch = new CountDownLatch(threadCount); for(int i=0; i<threadCount; i++){ long userId = i; executorService.submit(() -> { try { applyService.applyV2(userId); } catch(Exception e) { System.out.println(e); }finally { latch.countDown(); } }); } latch.await(); long count = couponRepository.count(); org.assertj.core.api.Assertions.assertThat(count).isEqualTo(100); } } 그런데 여러명응모V2 test를 실행시에 count를 출력시다음과 같은 수가 나옵니다. 20003200112001220013200152001620017200182002020022 ??? 한번 할때마다 1000씩 쿠폰의 수가 증가중인데요;;;조회했을때는 empty라 나오는데 이렇게 되는 연유를 잘 모르갰습니다. 테스트 코드라서 rollback이 되야할거 같은데 그렇지 않는것도 잘 모르겟네요;; ㅠㅠ
-
미해결15일간의 빅데이터 파일럿 프로젝트
오라클 Virtualbox 설치 후 서버 실행시 오류입니다.
VM Name: Server01Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).Result Code:E_FAIL (0X80004005)Component:ConsoleWrapInterface:IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8} 이런 오류가 뜨는데 어떻게 해결하면 좋을까요?? 구글링 해보니 host-only-ethernet을 새로만들고 다시 해보라고 하던데 그 방법도 되지 않습니다.Virtualbox 버전은 7.0.8 최신버전입니다.
-
미해결쿠버네티스 101 - 클라우드/서버 개발 첫걸음
개발 환경에 소개해주신 것들은 직접 설치 하라는 의미인건가요?
개발 환경 강의에서 VS 에서 Google Cloud Code 이외 설치 영상은 없는데처음에 소개해줄 때 알아서 설치하라는 말씀이신가요? Google Cloud Code 익스텐션 설치 후 where.exe minicube 입력 시정보: 제공된 패턴에 해당되는 파일을 찾지 못했습니다.라고 떠서요.
-
미해결15일간의 빅데이터 파일럿 프로젝트
카프카 Consumer 작동 에러 (p.134)
안녕하세요 수강 중 아래 실습 진행이 어려워 질문 드립니다.수집 파일럿 실행 5단계에서 카프카 Consumer 작동 실습시 Resetting offset 문구가 뜨며 데이터 확인이 안됩니다.시뮬레이터 재실행 및 스마트카 상태 정보 다시 옮겨 보았지만 안되었습니다.car-batch-log 를 확인했을때 위와 같이 뜨는데 상관없는지 궁금합니다.[오류문구][root@server02 ~]# kafka-console-consumer --bootstrap-server server02.hadoop.com :9092 --topic SmartCar-Topic --partition 023/01/09 18:47:52 INFO utils.Log4jControllerRegistration$: Registered kafka:type =kafka.Log4jController MBean23/01/09 18:47:52 INFO consumer.ConsumerConfig: ConsumerConfig values:auto.commit.interval.ms = 5000auto.offset.reset = latestbootstrap.servers = [server02.hadoop.com:9092]check.crcs = trueclient.dns.lookup = defaultclient.id =connections.max.idle.ms = 540000default.api.timeout.ms = 60000enable.auto.commit = falseexclude.internal.topics = truefetch.max.bytes = 52428800fetch.max.wait.ms = 500fetch.min.bytes = 1group.id = console-consumer-96835heartbeat.interval.ms = 3000interceptor.classes = []internal.leave.group.on.close = trueisolation.level = read_uncommittedkey.deserializer = class org.apache.kafka.common.serialization.ByteArray Deserializermax.partition.fetch.bytes = 1048576max.poll.interval.ms = 300000max.poll.records = 500metadata.max.age.ms = 300000metric.reporters = []metrics.num.samples = 2metrics.recording.level = INFOmetrics.sample.window.ms = 30000partition.assignment.strategy = [class org.apache.kafka.clients.consumer .RangeAssignor]receive.buffer.bytes = 65536reconnect.backoff.max.ms = 1000reconnect.backoff.ms = 50request.timeout.ms = 30000retry.backoff.ms = 100sasl.client.callback.handler.class = nullsasl.jaas.config = nullsasl.kerberos.kinit.cmd = /usr/bin/kinitsasl.kerberos.min.time.before.relogin = 60000sasl.kerberos.service.name = nullsasl.kerberos.ticket.renew.jitter = 0.05sasl.kerberos.ticket.renew.window.factor = 0.8sasl.login.callback.handler.class = nullsasl.login.class = nullsasl.login.refresh.buffer.seconds = 300sasl.login.refresh.min.period.seconds = 60sasl.login.refresh.window.factor = 0.8sasl.login.refresh.window.jitter = 0.05sasl.mechanism = GSSAPIsecurity.protocol = PLAINTEXTsend.buffer.bytes = 131072session.timeout.ms = 10000ssl.cipher.suites = nullssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]ssl.endpoint.identification.algorithm = nullssl.key.password = nullssl.keymanager.algorithm = SunX509ssl.keystore.location = nullssl.keystore.password = nullssl.keystore.type = JKSssl.protocol = TLSssl.provider = nullssl.secure.random.implementation = nullssl.trustmanager.algorithm = PKIXssl.truststore.location = nullssl.truststore.password = nullssl.truststore.type = JKSvalue.deserializer = class org.apache.kafka.common.serialization.ByteArr ayDeserializer23/01/09 18:47:53 INFO utils.AppInfoParser: Kafka version: 2.2.1-cdh6.3.223/01/09 18:47:53 INFO utils.AppInfoParser: Kafka commitId: unknown23/01/09 18:47:53 INFO consumer.KafkaConsumer: [Consumer clientId=consumer-1, gr oupId=console-consumer-96835] Subscribed to partition(s): SmartCar-Topic-023/01/09 18:47:53 INFO clients.Metadata: Cluster ID: AWKsMltnSBSo2f2sVF2P-g23/01/09 18:47:53 INFO internals.Fetcher: [Consumer clientId=consumer-1, groupId =console-consumer-96835] Resetting offset for partition SmartCar-Topic-0 to offs et 14.감사합니다.
-
해결됨15일간의 빅데이터 파일럿 프로젝트
가상머신 로그인 콘솔 창 문제
안녕하세요, 15일간의 빅데이터 파일럿 프로젝트 강의 수강생입니다.유익한 강의 감사합니다. 설명을 잘해주셔서 큰 어려움 없이 듣고 있습니다.다만, VM 환경 구성 중 로그인 관련 문제가 생겨서 질문드립니다. Server01과 Server02에서 모두 로그인을 요청하고 있으며, 다음 단계로 진행할 수 없습니다.윈도우11 PC에서 Virtual Box 버전은 VirtualBox 6.1.40 입니다. 강의와 동일한 5 버전이 지원되지 않아서 가장 가까운 6.1.40 버전과 최신 7 버전으로 설치했습니다.C, D 드라이브 용량은 200GB 이상 여유공간이 있으며, SSD입니다. 아래는 과거 게시판 질문 답변과 구글링을 바탕으로 시도한 방법입니다.Virtual Box 삭제 및 설치 - 6, 7 버전 모두 시도 / Server01, Server02 파일 재다운로드-> Host-Only Ethernet Adapter를 찾지 못하는 경우가 있었으나, Virtual Box의 Host-Only Ethernet Adapter 재설정 후 접속해도 로그인창이 나왔습니다.Host-Only Ethernet Adapter 에러Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND). Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND). 결과 코드: E_FAIL (0x80004005) 구성 요소: ConsoleWrap 인터페이스: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}-> 해당 에러는 새로운 Host-Only Ethernet Adapter를 추가하여 해결되었습니다.->Server02, 01 순서로 실행하고, 각각 하나씩 실행도 했습니다. 윈도우 제어판 Host-Only Ethernet Adapter 설정-> 윈도우 제어판 네트워크 설정에서 Host-Only Ethernet Adapter 사용 안함으로 설정하고, 재설치하였으나 로그인창 문제가 해결되지 않았습니다.현재 Virtual Box 네트워크 환경 설정입니다. 관련이 있는지는 모르겠지만, VBoxNetDHCP 프로세스 종료 후에도 진행하였으나 동일한 현상이 발생했습니다. 해당 문제를 해결할 방법 또는 추가로 시도할 방법이 있을까요?답변 기다리겠습니다. 감사합니다.
-
미해결15일간의 빅데이터 파일럿 프로젝트
zeppelin 오류
안녕하세요! 좋은 강의 잘 보고 있습니다~ 제플린 파트에서 다음과 같은 오류를 만나게되었는데 혹시 제가 놓친 부분이 있을까요?? 오류 메세지만으로는 알기가 좀 어렵네요 ㅠ 작성 내용은 예제 소스에서 biz_date 부분만 바꾸었습니다.
-
미해결대세는 쿠버네티스 (Helm편)
redis helm chart 6.2.5 bitnami 관련
안녕하세요.. 늦었지만, 새해 복많이 받으세요 제가 정확한 질문을 하고 있는지 의문이 들지만, 좀 이유를 알고 싶어서요.. bitnami에서 작성한 redis(6.2.5-debian-10-r34)를 보고 있는데 생성된 pod의 시간이 좀 달라서, 고쳐보려고 timezone과 관련한 부분을 vvolumemount를 하려고 하는데 pod를 yaml을 작성하는데가 없어보여서, 추가를 어떻게 해야할 지 모르겠네요 #registry: docker.io #repository: bitnami/redis #tag: 6.2.5-debian-10-r34 ## Specify a imagePullPolicymaster: initContainers: - name: redis volumeMounts: - name: tz-config mountPath: /etc/localtime extraVolumes: - name: tz-config hostPath: path: /usr/share/zoneinfo/Asia/Seoul extraVolumeMounts: - name: tz-config mountPath: /etc/localtime이렇게 추가를 하면 master pod가 사라져서 어떻게 해야할지 모르겠네요..
-
미해결15일간의 빅데이터 파일럿 프로젝트
mac으로 진행해도 큰 문제 없을까요?
Mac으로 환경 구성 하려고 하는데 앞으로 수업 내용들이 전부 Window 기준으로 되어있다고 하셔서, mac 사용시 혹시 크게 불편한 부분이 있나요?
-
해결됨15일간의 빅데이터 파일럿 프로젝트
카프카 아키텍처 (3/3) 질문
멀티 브로커(Broker1, Broker2)와 Multi Node를 가지는 아키텍처에 대해서 설명해주셨는데요. 중간에 각 Broker에 있는 Topic들을 하나도 묶을 수 있다는 내용이 있는데 정확히 어떤 의미인가요? Broker들끼리 서로 데이터를 공유한다는 말인가요? Consumer 1과 Consumer2가 같은 저장소를 바라본다는 말씀이 Node 1에 접근하더라도 Node 2에 있는 데이터에 접근 할 수 있다는 의미인가요?
-
해결됨15일간의 빅데이터 파일럿 프로젝트
virtualbox error
vitualbox 최신 버전으로 설치하고 강의에 나와있는 부분을 따라서 실행하다가 클러스터 설치 중 다음과 같은 에러가 발생합니다. vitualbox 다른 버전으로 설치하면 아예 실행도 안됩니다. (강의자료 19페이지 수행 중 에러 발생)
-
해결됨15일간의 빅데이터 파일럿 프로젝트
java 버전 선택 관련 질문
1. java 버전으로 1.8을 설치한다고 하셨는데 1.8로 설치하는 이유를 알고 싶습니다. 2. 환경 변수에 이미 JAVA_HOME이 있으면 어떻게 해야하나요? 3. 이클립스 installer를 다운받고 실행했더니 다음과 같이 뜨는데 어떤 것을 설치해야하나요 4. vitualbox download 하는 부분에서 no longer supported라고 명시되어있음에도 다운받아서 사용하는 이유를 알고 싶습니다. 5. 파일질라를 사용하는 대신에 scp 나 rsync 명령어를 사용하여 진행할 수 있을까요
-
해결됨15일간의 빅데이터 파일럿 프로젝트
접근제어 보안 구조관련 질문
아파치센트리의 경우 중앙에 서버를 두고 주변 노드들에게 접근 권한을 주는 것으로 이해를 했는데 커베로스는 클라이언트마다 서버를 따로따로 두는 것인가요? 커베로스도 KDC를 하나 두고 각 클라이언트들이 인증을 요청해서 티켓을 받는 방식인가요? 아, 아파치 센트리에서는 노드들에게 센트리 에이전트를 설치하는 대신 커베로스에서는 인증 요청하는 방식으로 진행되는 것인가요?
-
미해결15일간의 빅데이터 파일럿 프로젝트
yum install 에러 질문입니다.
yum install -y gcc* 공지에 있는대로 한 후에는 다음과 같은 에러가 납니다.. 답변 부탁드립니다. [root@server02 ~]# yum install -y gcc* Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile http://vault.centos.org/6.10/os/x86_64/repodata/repomd.xml: [Errno 14] Peer cert cannot be verified or peer cert invalid Trying other mirror. It was impossible to connect to the Red Hat servers. This could mean a connectivity issue in your environment, such as the requirement to configure a proxy, or a transparent proxy that tampers with TLS security, or an incorrect system clock. Please collect information about the specific failure that occurs in your environment, using the instructions in: https://access.redhat.com/solutions/1527033 and open a ticket with Red Hat Support. http://vault.centos.org/6.10/extras/x86_64/repodata/repomd.xml: [Errno 14] Peer cert cannot be verified or peer cert invalid Trying other mirror. http://vault.centos.org/6.10/updates/x86_64/repodata/repomd.xml: [Errno 14] Peer cert cannot be verified or peer cert invalid Trying other mirror. Resolving Dependencies --> Running transaction check ---> Package gcc.x86_64 0:4.4.7-23.el6 will be installed --> Processing Dependency: cpp = 4.4.7-23.el6 for package: gcc-4.4.7-23.el6.x86_64 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-23.el6.x86_64 ---> Package gcc-c++.x86_64 0:4.4.7-23.el6 will be installed --> Processing Dependency: libstdc++-devel = 4.4.7-23.el6 for package: gcc-c++-4.4.7-23.el6.x86_64 --> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++-4.4.7-23.el6.x86_64 ---> Package gcc-gfortran.x86_64 0:4.4.7-23.el6 will be installed ---> Package gcc-gnat.x86_64 0:4.4.7-23.el6 will be installed --> Processing Dependency: libgnat-devel = 4.4.7-23.el6 for package: gcc-gnat-4.4.7-23.el6.x86_64 --> Processing Dependency: libgnat = 4.4.7-23.el6 for package: gcc-gnat-4.4.7-23.el6.x86_64 ---> Package gcc-java.x86_64 0:4.4.7-23.el6 will be installed http://vault.centos.org/6.10/os/x86_64/repodata/5f7694d9c6c4a41dee56f51a965c3426ae2f685d6a9fb99d2e5a255c7bec0864-filelists.sqlite.bz2: [Errno 14] Peer cert cannot be verified or peer cert invalid Trying other mirror. Error: failure: repodata/5f7694d9c6c4a41dee56f51a965c3426ae2f685d6a9fb99d2e5a255c7bec0864-filelists.sqlite.bz2 from base: [Errno 256] No more mirrors to try.
-
미해결15일간의 빅데이터 파일럿 프로젝트
zookeeper오류...
2021-07-11 17:25:26,567 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1118] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) 2021-07-11 17:25:26,568 [myid:] - WARN [main-SendThread(localhost:2181):ClientCnxn$SendThread@1245] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1224) putty에서 zookeeper-client를 실행시키면 자꾸 반복되서 나오는데 무슨 오류일까요... 구글링을 통해 해결하려는데 쉽지 않아서 여쭤봅니다 ㅠㅠ...
-
미해결
redis와 nodejs 관련해서 강의가 있을까요?
nodeJS 와 Redis 대규모 서비스를 통한 예제가 있을까요? 관련 강의가 있으면 좋을 것 같은데 아니면 간단한 강의라도 있으면 좋겠습니다.
-
미해결도커 쓸 땐 필수! 도커 컴포즈
[Q : 섹션3. flask + redis 서비스 실행하기 실습편] Internal Server Error
브라우저에서 접속을 시도하면 internal server error 라고 뜨면서 정상작동하지 않습니다. 위 로그 기록 참고하셔서 조치 방법을 알려주시면 고맙겠습니다.