RDD - Resilient Distributed Datasets 분산 이뮤터블 자바 객체
http://12bme.tistory.com/306
'몰라그거무서운거 > scala or spark' 카테고리의 다른 글
scala memo (0) | 2018.07.10 |
---|
RDD - Resilient Distributed Datasets 분산 이뮤터블 자바 객체
http://12bme.tistory.com/306
scala memo (0) | 2018.07.10 |
---|
++
나 --
는 제공하지 않으므로 += 1
을 사용해야 합니다 //////.......... -_-
scala> b
res5: List[Any] = List(a, 1, true)
scala> a
res6: (String, Int) = (솔라,112123)
spark (0) | 2018.07.17 |
---|
記録 2021.01.11. (0) | 2021.01.12 |
---|---|
메모 (0) | 2020.11.26 |
티스토리 방치상태네... (0) | 2020.09.01 |
NewSQL memo (0) | 2018.07.27 |
mac에 brew 로 설치한 nginx 메모 (0) | 2018.07.04 |
방금 맥북에 설치한 정보 메모..
==> Installing nginx
==> Downloading https://homebrew.bintray.com/bottles/nginx-1.15.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring nginx-1.15.0.high_sierra.bottle.tar.gz
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
To have launchd start nginx now and restart at login:
brew services start nginx
Or, if you don't want/need a background service you can just run:
nginx
==> Summary
🍺 /usr/local/Cellar/nginx/1.15.0: 23 files, 1.4MB
.. 암튼 맥북
시작 : $ nginx
종료 : $ nginx -s stop
재시작 : $ nginx -s reload
listen 80 으로 바꾸면 sudo
記録 2021.01.11. (0) | 2021.01.12 |
---|---|
메모 (0) | 2020.11.26 |
티스토리 방치상태네... (0) | 2020.09.01 |
NewSQL memo (0) | 2018.07.27 |
memo (0) | 2018.07.05 |
빨리 진도 빼야하는데... -_-;
아무튼 배치처리 ...
살펴보니 용도는 대충 배치(일괄) 처리 이후, 그 결과 데이터를 벌크로 올리는 것 같고, 수정이나 삭제도 할 수 있나보다.
~]$ curl -X POST "localhost:9200/customer/_doc/_bulk?pretty" -H 'Content-Type: application/json' -d'
> {"index":{"_id":"1"}}
> {"name": "John Doe1111" }
> {"index":{"_id":"2"}}
> {"name": "Jane Doe2222" }
> '
{
"took" : 11,
"errors" : false,
"items" : [
{
"index" : {
"_index" : "customer",
"_type" : "_doc",
"_id" : "1",
"_version" : 2,
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 18,
"_primary_term" : 2,
"status" : 200
}
},
{
"index" : {
"_index" : "customer",
"_type" : "_doc",
"_id" : "2",
"_version" : 2,
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 4,
"_primary_term" : 2,
"status" : 200
}
}
]
}
똑같은 패턴이다.
잘 들어갔는지 보려면 조회.
~]$ curl -X GET "localhost:9200/customer/_doc/1?pretty"
{
"_index" : "customer",
"_type" : "_doc",
"_id" : "1",
"_version" : 2,
"found" : true,
"_source" : {
"name" : "John Doe1111"
}
}
1번
~]$ curl -X GET "localhost:9200/customer/_doc/2?pretty"
{
"_index" : "customer",
"_type" : "_doc",
"_id" : "2",
"_version" : 2,
"found" : true,
"_source" : {
"name" : "Jane Doe2222"
}
}
얜 2번.
잘 들어간듯.
~]$ curl -X POST "localhost:9200/customer/_doc/_bulk?pretty" -H 'Content-Type: application/json' -d'
> {"update":{"_id":"1"}}
> {"doc": { "name": "John Doe becomes Jane Doe" } }
> {"delete":{"_id":"2"}}
> '
{
"took" : 23,
"errors" : false,
"items" : [
{
"update" : {
"_index" : "customer",
"_type" : "_doc",
"_id" : "1",
"_version" : 3,
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 19,
"_primary_term" : 2,
"status" : 200
}
},
{
"delete" : {
"_index" : "customer",
"_type" : "_doc",
"_id" : "2",
"_version" : 3,
"result" : "deleted",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 5,
"_primary_term" : 2,
"status" : 200
}
}
]
}
~]$ curl -X GET "localhost:9200/customer/_doc/1?pretty"
{
"_index" : "customer",
"_type" : "_doc",
"_id" : "1",
"_version" : 3,
"found" : true,
"_source" : {
"name" : "John Doe becomes Jane Doe"
}
}
[ㅇㅣ름이름@서버서버명 ~]$ curl -X GET "localhost:9200/customer/_doc/2?pretty"
{
"_index" : "customer",
"_type" : "_doc",
"_id" : "2",
"found" : false
}
오케이 확인 끝.
꼴랑 id 만으로 삭제함.
~]$ curl -X POST "localhost:9200/customer/_doc/_bulk?pretty" -H 'Content-Type: application/json' -d'
> {"update":{"_id":"2"}}
> {"doc": { "name": "John Doe becomes Jane Doe" } }
> {"update":{"_id":"1"}}
> {"doc": { "name": "John Doe becomes Jane Doe122434" } }
>
> '
{
"took" : 75,
"errors" : true,
"items" : [
{
"update" : {
"_index" : "customer",
"_type" : "_doc",
"_id" : "2",
"status" : 404,
"error" : {
"type" : "document_missing_exception",
"reason" : "[_doc][2]: document missing",
"index_uuid" : "4clf5AwmTQ-hruQl7EGJSg",
"shard" : "2",
"index" : "customer"
}
}
},
{
"update" : {
"_index" : "customer",
"_type" : "_doc",
"_id" : "1",
"_version" : 4,
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 20,
"_primary_term" : 2,
"status" : 200
}
}
]
}
2번을 고치고 1번을 고치도록 했는데, 음... 그렇다.
~]$ curl -X GET "localhost:9200/customer/_doc/1?pretty"
{
"_index" : "customer",
"_type" : "_doc",
"_id" : "1",
"_version" : 4,
"found" : true,
"_source" : {
"name" : "John Doe becomes Jane Doe122434"
}
}
1 잘 고쳐짐.
일단 여기까지.
Elasticsearch linux 설정 조각 (0) | 2021.01.14 |
---|---|
ES 6.x 노드를 메인터넌스 보내야할 때. (0) | 2021.01.07 |
엘라스틱서치 6.3 무따기(2) (0) | 2018.07.02 |
엘라스틱서치 6.3 무따기. (0) | 2018.06.18 |