일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Spring
- Spring Boot
- docker
- tool
- ubuntu
- jsp
- laravel
- AWS
- linux
- Git
- java
- javascript
- elasticsearch
- 요리
- IntelliJ
- Web Server
- springboot
- php
- redis
- ReactJS
- devops
- Oracle
- MySQL
- jenkins
- 맛집
- db
- Gradle
- Design Patterns
- it
- JPA
- Today
- Total
목록Data Store (71)
아무거나
[키바나 비주얼라이즈(Kibana Visualize) - 막대그래프, 파이차트] 1. 좌측 메뉴중 Visualize탭을 선택한다.(Vertical bar chart) - Create a Visualizeation선택하고 여러 메뉴들중 Vertical bar chart를 선택해보자. - 그러면 name쪽에 생성한 인덱스가 표시된다(=basketball). 그것을 클릭하자 - 이제 평균 점수를 구할것이다. 먼저 Add metrics를 선택해서 Y축인 Y-Axis를 선택하자 그리고 Y-Axis(Count)를 제거하자. - 그 다음 Aggregation에서(select box) Metric Aggregations 에서 Average를 선택 - 그리고 Field는 points를 선택(우리가 원하는 결과는 선수별 ..
1. 좌측메뉴중에 Discover를 선택한다. - 그럼 no results found라고 뜨는데 그 이유는 데이터가 15분동안 없었기 때문이다. 2. 우측 상단에 Last 15 minutes를 선택하여 Last 6 months 로 변경. 그러면 바 차트가 보일것이다. 3. 바 차트에 바에다가 마우스온을하면 그 바 차트에 있는 도큐먼트의 개수가 나온다. 4. 또 다르게 검색하려면 2번처럼 우측 상단을 클릭 후 Relative기능을 사용하여 조건을 변경할 수 있다. 그리고 Absolute를 선택하면 달력에서 시간을 지정할 수 있다. 5. 하단 데이터 목록의 row별 왼쪽 화살표를 클릭하면 table과 json형식을 선택하여 볼 수 있다. - 만약 예를 들어 name이라는 필드에서 Stephen Curry에 ..
키바나 매니지먼트(kibana management) 1. curl -XDELETE localhost:9200/basketball // 이전 basketball 인덱스를 삭제(새로 작업하기 위함) 2. curl -XPUT localhost:9200/basketball // basketball 인덱스를 생성 3. curl -XPUT 'localhost:9200/basketball/record/_mapping' -d @basketball_mapping.json # [basketball_mapping.json] { "record" : { "properties" : { "team" : { "type" : "string", "fielddata" : true }, "name" : { "type" : "string",..
[kibana 설치] # kibana 5.x 1. wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - 2. sudo apt-get install apt-transport-https 3. echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list 4. sudo apt-get update && sudo apt-get install kibana 5. config kibana(/etc/kibana/kibana.yml) - elasticsearch.url..
[모든 인덱스 삭제 및 방어] - curl -XDELETE 'http://localhost:9200/*' // 모든 인덱스 삭제 - 방어설정은 elasticsearch.yml에서 action.destructive_requires_name: true 로 바꿔놓자.
버킷 어그리게이션(Bucket Aggregation) * 메트릭 어그리게이션과는 다르게 버킷 어그리게이션은 group by라고 보면 된다. 예를 들어 그룹별로 결과값을 도출할때 사용한다. 1. curl -XPUT localhost:9200/basketball // 인덱스생성 2. sudo vi basketball_mapping.json // 매핑 데이터 생성 # [basketball_mapping.json] { "record" : { "properties" : { "team" : { "type" : "string", "fielddata" : true }, "name" : { "type" : "string", "fielddata" : true }, "points" : { "type" : "long" }, ..
메트릭 어그리게이션(Metric Aggregation) * elasticsearch안에있는 도큐먼트안에서 조합을 통해서 어떠한 값을 도출할때 쓰는 방법중 하나이다. 그중 메트릭 어그리게이션은 평균, 최소값, 최대값 등.. 산술값을 구할때 쓴다. 1. vi simple_basketball.json #[data내용] { "index" : { "_index" : "basketball", "_type" : "record", "_id" : "1" } } {"team" : "Chicago Bulls","name" : "Michael Jordan", "points" : 30,"rebounds" : 3,"assists" : 4, "submit_date" : "1996-10-11"} { "index" : { "_inde..
1. simple_basketball.json을 bulk로 데이터를 넣는다. - curl -XPOST 'localhost:9200/_bulk' --data-binary @simple_basketball.json # [json data 내용] { "index" : { "_index" : "basketball", "_type" : "record", "_id" : "1" } } {"team" : "Chicago Bulls","name" : "Michael Jordan", "points" : 30,"rebounds" : 3,"assists" : 4, "submit_date" : "1996-10-11"} { "index" : { "_index" : "basketball", "_type" : "record", "_..
매핑없이 데이터를 넣는것은 매우 위험한일이다 예를들어 도큐먼트에 date를 넣는다하면 elasticsearch가 날짜인지 아닌지 모르니까 단순히 문자열로 저장하는 경우가 있다. 또한 숫자를 넣을때 숫자일지 문자일지 구분이 안갈때 문자로 넣을 수도 있다. 이런 부분들은 예를들어 계산이나 데이터 시각화에 문제가 생긴다. 그러므로 매핑은 적극적으로 해야한다. [매핑할 json 파일] { "class":{ "properties":{ "title":{"type":"string"}, "professor":{"type":"string"}, "major":{"type":"string"}, "semester":{"type":"string"}, "student_count":{"type":"integer"}, "unit":..
[벌크(bulk)] - 여러개의 document를 한번에 elasticsearch에 삽입하는 방법을 bulk라한다. curl -XPOST 'http://localhost:9200/_bulk?pretty' --data-binary @classes.json [classes.json] { "index" : { "_index" : "classes", "_type" : "class", "_id" : "1" } } {"title" : "Machine Learning","Professor" : "Minsuk Heo","major" : "Computer Science","semester" : ["spring", "fall"],"student_count" : 100,"unit" : 3,"rating" : 5, "subm..