본문 바로가기

반응형

전체 글

(441)
docker compose ELK 설치하려다가 실패한 글 1. docker & docker-compose 설치 잘 설치되었는지 확인 docker -v docker-compose -v 2. 컨테이너 설정파일 만들기 (github에서 다운 및 수정) https://github.com/deviantony/docker-elk GitHub - deviantony/docker-elk: The Elastic stack (ELK) powered by Docker and Compose. The Elastic stack (ELK) powered by Docker and Compose. - GitHub - deviantony/docker-elk: The Elastic stack (ELK) powered by Docker and Compose. github.com 2-1) dock..
[security_exception] missing authentication credentials for REST request 해결법 사용자 아이디 / 비밀번호의 인증이 필요하다. curl 명령어 뒤에 --user : 를 붙여주면 된다. Elaseticsearch service token 만들기 curl -X POST "localhost:9200/_security/service/elastic/fleet-server/credential/token/token1?pretty" --user elastic:asdfasdf
ERROR: for docker-elk-main_logstash_1 Cannot start service logstash: Ports are not available: listen tcp 0.0.0.0:5000: bind: address already in use docker ELK docker-compose up 명령어 중 에러가 나왔다. ERROR: for docker-elk-main_logstash_1 Cannot start service logstash: Ports are not available: listen tcp 0.0.0.0:5000: bind: address already in use port 5000이 이미 사용 중이라는 것 !! 사용 중인 포트를 제거하는 명령어를 입력해도 계속해서 켜진다. lsof -i:5000 kill -9 PID 이런 경우 해결법 1. 5000번 이외의 다른 포트 사용하기 해결법 2. 시스템 환경설정 -> 공유 (share) -> AirPlay 수신 모드를 꺼주면 된다. AirPlay는 주변에 있는 iPhon, Mac, i..
[Elasticsearch] dynamic : true / false / runtime / strict 알아보기 Parameters for dynamic dynamic parameter는 mappings에 설정되지 않은 새로운 fields를 동적으로 추가하지 말지를 정한다. await client.indices.create({ index: 'test', body: { mappings: { dynamic: false, properties: { id: { type: 'keyword' }, title: { type: 'text' }, body: { type: 'text' }, count: { type: 'integer' }, date: { type: 'date' }, tags: { type: 'keyword' } } } } }) ☀️ true (default) 새로운 필드를 mapping에 추가한다. false new..
[Elasticsearch] 연습 🔥 Elasticsearch 실험 🔥 1번 - split2가 왜 필요한지 궁금해서 .pipe(split(JSON.parse))를 빼봄 조건 : datasource = fs.createReadStream(datasetPath); data = test-bulk2.ndjson ( mappings와 맞는 스키마) mappings - dynamic : false allDocument = [ { _index: 'test', _type: '_doc', _id: 'BsLSK4AByTPDy5Ar5LWO', _score: 1, _source: { type: 'Buffer', data: [Array] } } ] _source.data 가 아래처럼 나옴 2번 - split2를 다시 넣어봄 .pipe(split(JSON.par..
React Native setup with TypeScript 1. reactNative 에서 using typeScript 부분 명령어 입력 https://reactnative.dev/docs/typescript 요 아래 명령어 입력 전 어떤 위치에 해당 프로젝트를 시작할지 미리 경로 들어가있기 $ npx react-native init [MyApp name] --template react-native-template-typescript -> react-native 등 필요한 것들을 모두 설치가 자동으로 된다. ** 만약 xcode가 설치되지 않은 상태라면 에러가 나온다. 자세한 해결법은 아래에 👇 https://blckchainetc.tistory.com/386 [React Native] xcrun: error: SDK "iphoneos" cannot be l..
[React Native] xcrun: error: SDK "iphoneos" cannot be located unable to lookup item 'Path' in SDK 'iphoneos' Failed to install CocoaPods dependencies for iOS project, which is required by this template. React Native 를 TypeScript를 사용하여 실행하기 위해 처음 명령어를 입력 후에 $ npx react-native init LuckIsComing --template react-native-template-typescript Failed to install CocoaPods dependencies for iOS project, which is required by this template. 에러가 나왔다. 에러 설명에 나온대로 $ cd ./[프로젝트명]/ios && pod install 해당 ios에 들어가 pod를 수기 설치하니 또 에러가 나왔다. xcrun: error: SDK "iphoneos" cannot be located unable to lookup item 'Path' in..
[React Native] "RNSScreenStackHeaderConfig" was not found in the UIManager. React Native에서 navigator 사용을 위해 아래의 라이브러리 들을 설치했다. $ npm install @react-navigation/native @react-navigation/native-stack 문제가 없다고 생각했는데 나온 에러 ! "RNSScreenStackHeaderConfig" was not found in the UIManager. 찾아보니 필수로 설치가 필요한 라이브러리들이 두개 더 있었다. $ npm install react-native-screens react-native-safe-area-context 위 두개를 더 설치하고 프로젝트 경로로 가서 $ cd ios $ pod install $ cd .. $ react-native run-ios pod install을 다..
[Elasticsearch + Node.js] index 생성 삭제 조회 bulk CRUD with TypeScript Elasticsearch + Node.js + Typescript로 elasticsearch 실습하기 @elastic/elasticsearch version : 8.1.0 typescript version : 4.6.3 1. 새 프로젝트 환경 설정 https://blckchainetc.tistory.com/381 [TypeScript + Node.js] 새 프로젝트 시작하기 (환경 설정, nodemon, rimraf) TypeScript + Node.js 튜토리얼 ✍🏼 1. 폴더 생성 새 폴더 만들고 webstorm or VSCode로 열기 cd [새폴더 명] - 새로 만든 폴더 경로로 들어가기 2. Setup Node.js package.json npm init -y // -y 옵션을.. blckcha..
[Elasticsearch] node.js로 bulk 입력/업데이트/삭제 Bulk helpers - index, insert, update, delete Elastic Bulk Operation을 할때 필요한 helpers 알아보기 Elasticsearch Bulk helpers async function index() { const datasetPath = path.join(__dirname, '..', 'fixtures', 'test-bulk.ndjson'); const datasource = fs.createReadStream(datasetPath).pipe(split(JSON.parse)); console.log('datasetPath=', datasetPath); console.log('datasource=', datasource); const result = await client.helpers.bulk({ datasource, // 필수값인 ..
[Elasticsearch + Node.js] with Typescript 연결하기 node.js와 TypeScript 기본 환경 설정 정리한 글 => https://blckchainetc.tistory.com/381 [TypeScript + Node.js] 새 프로젝트 시작하기 (환경 설정, nodemon, rimraf) TypeScript + Node.js 튜토리얼 ✍🏼 1. 폴더 생성 새 폴더 만들고 webstorm or VSCode로 열기 cd [새폴더 명] - 새로 만든 폴더 경로로 들어가기 2. Setup Node.js package.json npm init -y // -y 옵션을.. blckchainetc.tistory.com 1. elatic/elasticsearch를 설치한다. npm install @elastic/elasticsearch 2. src폴더 내 파일에 el..
[TypeScript + Node.js] 새 프로젝트 시작하기 (환경 설정, nodemon, rimraf) TypeScript + Node.js 튜토리얼 ✍🏼 1. 폴더 생성 새 폴더 만들고 webstorm or VSCode로 열기 cd [새폴더 명] - 새로 만든 폴더 경로로 들어가기 2. Setup Node.js package.json npm init -y // -y 옵션을 주면 모든 defaults값을 yes로 하는 것 -> package.json 파일이 자동생성된다. 3. Add TypeScript as a dev dependency npm install typescript --save-dev -> dependency 추가를 하니 package-lock.json 파일이 자동생성된다. typescript 설치 후에, tsc 명령어를 통해 타입스크립트 컴파일러 command line에 접근할 수 있다. 4..
[elastic search] REST API 실습 (GET, POST, PUT, DELETE, UPDATE) 실습 시작 전 elsaticsearch 와 kibana 를 모두 on 해놓기 1. classes라는 index(=db) 가 있는지 확인해보기 curl -XGET http://localhost:9200/classes // 정리된 상태로 결과물을 보려면 pretty 붙이기 curl -XGET http://localhost:9200/classes\?pretty { "error" : { "root_cause" : [ { "type" : "index_not_found_exception", "reason" : "no such index [classes]", "resource.type" : "index_or_alias", "resource.id" : "classes", "index_uuid" : "_na_", "in..
[elasticsearch] "Content-Type header [application/x-www-form-urlencoded] is not supported","status":406 elasticSearch에서 PUT 또는 POST를 하는 경우 나온 에러 "Content-Type header [application/x-www-form-urlencoded] is not supported","status":406 elasticsearch 6.0 이후부터는 content-type을 꼭 넣어야 한다고! 아래와 같은 명령어를 curl -XPOST http://localhost:9200/classes/1/ -d ' {"title": "acb", "subject": "def"}' {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}% 이렇게 옵션을 추가해주니 되었다. curl..
[elasticsearch, kibana] homebrew로 설치하기 on mac 맥북 Elasticsearch / kibana homebrew를 사용해서 설치하기 (맥북) elasticsearch 설치 전, JDK 설치 / java_home 환경변수 설정이 필요하다. 1. JDK 설치 https://blckchainetc.tistory.com/376 JAVA JDK mac m1에 설치하기 JDK를 mac m1에 설치하는 방법 (homebrew 이용) 1. homebrew가 없다면 먼저 설치하기 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2. openJdk 설치하기 br.. blckchainetc.tistory.com 2. JAVA_HOME 환경변수 설정 http..
JAVA_HOME 환경변수 설정 on 맥북 Mac Os X JDK 설치 후 JAVA HOME 환경변수 설정 방법 1. 내가 쓰고 있는 shell이 무엇인지 알기 ( bash / zsh ) echo $SHELL 2. JAVA_HOME 변수에 값 넣어 해당 파일로 넣기 bash 의 경우 echo export "JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.bash_profile zsh 의 경우 echo export "JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.zshrc * 만약 multiple JDK versions 이 설치되어 있다면 특정해주기 echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" >> ~/.bash_profile (또는 ~/.zs..
JAVA JDK mac m1에 설치하기 JDK를 mac m1에 설치하는 방법 (homebrew 이용) 1. homebrew가 없다면 먼저 설치하기 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2. openJdk 설치하기 brew install openjdk 3. 설치되었는지 확인하기 $(brew --prefix openjdk)/bin/java --version 4. arm64 hardware 인지 확인하기 file $(brew --prefix openjdk)/bin/java #결과 : /opt/homebrew/opt/openjdk/bin/java: Mach-O 64-bit executable arm64
[gitflow Error ] /Applications/Sourcetree.app/Contents/Resources/bin/getopt: No such file or directory flags:FATAL unable to parse provided options with getopt. gitflow 설치 후 init rep하려니 아래와 같은 에러가 나왔다. Error : /Applications/Sourcetree.app/Contents/Resources/bin/getopt: No such file or directory flags:FATAL unable to parse provided options with getopt. 이유를 찾아보니 sourceTree path와 뭔가 꼬인 것 같다. 해결법 $ cat ~/.gitflow_export => export FLAGS_GETOPT_CMD=/Applications/Sourcetree.app/Contents/Re~ 이런게 쭉 보인다. $ nano ~/.gitflow_export => 파일 편집하러 가서 위에서 본 저 줄을 모두 삭제한다. ..
[gitflow Error] 'fatal: branch 'develop' does not exist' gitflow설치 후, webstorm 오른 아래쪽에 no-git 이었나 요걸 클릭해서 init repo(gitflow 시작) 클릭하니 아래의 에러가 나왔다. Error 'fatal: branch 'develop' does not exist 해결법 $ git checkout develop develop으로 체크아웃 한 후 init repo를 다시 클릭하면 된다. 만약 에러가 Error 'fatal: branch 'master' does not exist Master로 나오면 master로 checkout 해주고 init repo 를 하면 된다. Reference : https://stackoverflow.com/questions/46915350/got-fatal-branch-master-does-not-..
[React] select options box 사용하기 선택지를 주어야 할 때 select, option tag? 를 사용한다. option에는 key가 꼭 있어야 한다고 한다. 사용 예제 const [symbol, setSymbol] = useState('ETH'); . . . ETH TTK 
Expected `onClick` listener to be a function, instead got a value of `object` type. [ERROR] Expected `onClick` listener to be a function, instead got a value of `object` type. "onClick" 이 실행되어야 한다는 오류 return {v} 여기의 OnClickd을 넣자마자 오류가 나왔다. 찾아보니 () => {실행시킬 함수} 로 click을 하면 바로 실행되게 만들면 오류가 사라진다. Transactions {info['block'].transactions.map((v,i) => { return {search(info['block'].transactions[i])}} className={"hover"}>{v} })} ​
[ERROR]DELETE_FAILED: IamRoleLambdaExecution (AWS::IAM::Role)Cannot delete entity, must detach all policies first. (Service: AmazonIdentityManagement; Status Code: 409; Error Code: DeleteConflict; 에러난 상황 : aws batch 서버의 권한 - 실행 역할을 재설정(기존 거를 다른 거로 변경)하기위해 serverless.yml의 소스 코드에 iam을 추가하고 재배포하려다가 에러가 났다. ERROR: DELETE_FAILED: IamRoleLambdaExecution (AWS::IAM::Role) Cannot delete entity, must detach all policies first. (Service: AmazonIdentityManagement; Status Code: 409; Error Code: DeleteConflict; 해결법 : aws - Lambda 함수 - 구성 - 권한 - 실행 역할을 바꿀 새로운 역할 이름으로 변경해준다. -> serverless.yml 코드에 iam 주소를..
package.json 최신 버전으로 업데이트하기 TypeScript 컴파일 중 /node_modules/mongoose/node_modules/mongodb/mongodb.ts34.d.ts (3688,4): Expression expected. 요런 에러가 많이 났다. package.json 최신 버전으로 한번에 업데이트를 해주니 오류 해결되었다. npm 모듈 버전 확인 npm show [모듈명] version npm 모듈 개별 업데이트 npm update [모듈명] npm package.json 모듈 한번에 업데이트 시키기 npm install -g npm-check-updates 최신버전 확인 ncu 최신버전 업데이트 ncu -u 모듈 설치 npm install
Error: EPERM: operation not permitted Error: EPERM: operation not permitted, unlink ~ serverless 서버를 배포하다가 나온 에러 해결법을 찾아보니 여러개의 방법이 있었는데 첫번째로 많은 사람들이 사용한 방법은 1. 캐시 지우기 $ npm cache clean --force 2. 최신 버젼 npm 을 관리자 admin으로 설치하기 $ npm install -g npm@latest --force 3. 캐시 다시 지우기 $npm cache clean --force 이었는데 나는 그대로 에러가 나왔다. 에러 끝에 자세히 보니 Error: EPERM: operation not permitted, unlink '/Users/'userName'/Documents/project/batch-serverless/.b..
Resource handler returned message: "Request must be smaller than 5120 bytes for the UpdateFunctionConfiguration operation [ERROR : ] Resource handler returned message: "Request must be smaller than 5120 bytes for the UpdateFunctionConfiguration operation aws lambda 서비스에 배포할 때 나온 에러 메세지이다. 원인 : 환경 변수의 용량이 초과됨 아래 문서에 보면 함수의 환경변수의 사이즈가 4KB까지로 정의되어 있다. Documents : https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html Lambda quotas - AWS Lambda The Lambda documentation, log messages, and console use th..
AWS Lambda Error: Unzipped size must be smaller than 262144000 bytes AWS Lambda Error: Unzipped size must be smaller than 262144000 bytes AWS Lambda 서버 배포 중 4KB 환경변수 크기 에러 해결 이후 또 나타난 에러 해결 방법 : 프로젝트 파일 크기를 크게 만드는 개발 packages를 제외시키면 된다. serverless.yml 파일에서 package: exclude: - node_modules/** node_modules/** 를 제외하도록 추가하기 -> 해결되었다 ! References : https://stackoverflow.com/questions/45342990/aws-lambda-error-unzipped-size-must-be-smaller-than-262144000-bytes AWS Lamb..
[JavaScript] 객체 복사하기 <옅은 복사 vs 깊은 복사> JavaScript, 자바스크립트에서 객체 복사하는 여러 방법들이 헷갈려서 직접 공부겸 글로 남기기 긴 글 짧게 요약하면 ↘↘ clone() : 복사를 하고 참조도 한다. (옅은 복사) deepClone() : 복사를 하고 참조는 없다. (깊은 복사) 참조란 ? = > 같은 객체를 바라보고 있는 것 const example1 = { a:1, b:2}; const copied = example1; console.log(example1); // { a:1, b:2} console.log(copied); // { a:1, b:2} // example1의 'a'의 값을 100으로 변경 example1.a = 100; console.log(example1); // { a:100, b:2} console.log(c..
[mysql] ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails dataGrip으로 mysql 의 테이블에 원격 저장소에서 불러온 데이터를 복붙하려고 했는데 계속 에러가 났다. 해당 테이블을 삭제하려고 해도 삭제가 안되었다. (update & delete 불가라고 나옴) 터미널 가서 삭제 명령어를 쳐보니 foreign key 설정이 되어 있어서 (다른 데이터와 연결되어 있어서) update & delete를 제한한다고...! 일단 복붙할 곳은 local mysql 이고 당장 foreign키 사용 예정이 없어서 강제 해제하고 삭제 진행 -> 다시 복붙을 했다. // 해당 db에 들어가기 use [database-name]; // foreign_key 해제 set foreign_key_checks = 0; // 원하는 테이블 삭제 drop table [table-name..

반응형