Table of Contents
6월 3일 (일) TIL
ElasticSearch 에서 index 의 alias 를 변경하는 방법을 알아보았다.
Alias 확인
먼저 ElasticSearch 클러스터에 /_alias
로 접속하면 현재 생성된 인덱스 들과 연결된 alias 를 확인할 수 있다.
{
"activity-log-index": {
"aliases": {
}
},
"my-contents-index-v1": {
"aliases": {
"contents": {
}
}
},
"my-contents-index-v2": {
"aliases": {
}
}
}
현재 my-contents-index-v1
이라는 인덱스에 contents
라는 alias 가 부여되어 있다. 이를 my-contents-index-v2
으로 교체해보겠다.
curl -XPOST 'http://my-elasticsearch-host:9200/_aliases?pretty' -d'
{
"actions" : [
{ "remove" : { "index" : "my-contents-index-v1", "alias" : "contents" } },
{ "add" : { "index" : "my-contents-index-v2", "alias" : "contents" } }
]
}'
한번의 쿼리를 통해서 my-contents-index-v1
에서는 alias 가 삭제되고 my-contents-index-v2
에는 alias 가 추가되었다.
이후 다시 /_alias
로 확인해보면 변경된 결과를 확인가능하다
{
"activity-log-index": {
"aliases": {
}
},
"my-contents-index-v1": {
"aliases": {
}
},
"my-contents-index-v2": {
"aliases": {
"contents": {
}
}
}
}
comments powered by Disqus
FEATURED TAGS
accesscontrol
adaptive-growth
alpine-linux
ansible
ansible-tower
apache2.4
architecture
argocd
asgi
aws
awx
backoffice
beautiful-goodbye
begining-docker
benchmark
blockhound
blocking-code
blog
book
brew-cask
build-cache
collaboration
communication
composer
confluence
cronjob
curl
customizing
customlog
data.sql
database
developer
difference
docker
docker-desktop
dockerize
dos-attack
eks
elasticsearch
empty-string
environment-to-do-well
errorlogformat
event-driven
experience
file-upload
filebeat
fluentd
forwarded-option
framework
fuse.js
golang
graceful-deploy
happy-new-year
haproxy
haproxy-1.8
haproxy-acl-logging
haproxy-custom-variable-logging
haproxy-metric
haproxy-reload-fail
haproxy-stat
heap-memory
hedgehog-sharp
how-do-i-work
hugo
index-alias
install
installation
instance-type
inverted-index
istio
iterm
java
jdk-21
jekyll
jekyll-to-hugo
jetbrains
json
k8s
k8s-api
kmooc
kubernetes
leadership
learning-in-2019
lets-encrypt
letsencrypt
limit_req_zone
litestar
logstash
m1-macbook-pro
macro
macro-key-mapping
mapping
match
match_phrase
maven
microservice-설계-및-구현
migration
mm
multi-datasource
mysql
nginx
nginx-ingress
nginx-regexp
ngram
null
openjdk
partial-matching
phpstorm
poeaa
portfolio-expansion
product-strategy
python
query-dsl
rate-limit
rate-litmiting
rds
reindex
rss-template
seamless-reload
search-on-hugo
service-account-role
sidebar-search
speed-up
speedup
spring
spring-boot
spring-camp
spring-camp-2023
spring-event
ssh
struct
study
system-manager
systemd-reload
template
term
throughput
timezone
tips
traffic-management
ulid
unused-plugins
uuid
ux-consideration
virtual-thread
vm-options
webflux
wildcard
zero-downtime
만들면서-배우는-클린-아키텍처
시작하세요-도커
엔터프라이즈-애플리케이션-아키텍처-패턴
쿠버네티스-시작하기