- Install and start Docker Desktop
- Run
docker network create elastic docker pull docker.elastic.co/elasticsearch/elasticsearch:7.13.2 docker run --name es01-test --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.13.2
- To verify it is running successfully
curl -X GET http://localhost:9200
- In a new terminal session, run
docker pull docker.elastic.co/kibana/kibana:7.13.2 docker run --name kib01-test --net elastic -p 5601:5601 -e "ELASTICSEARCH_HOSTS=http://es01-test:9200" docker.elastic.co/kibana/kibana:7.13.2
- To access Kibana, go to http://localhost:5601/app/dev_tools#/console
- Create index
PUT /usersg0
- Add mapping
PUT /usersg0/_mapping { "properties": { "name": { "type": "text" }, "dob": { "type": "long" }, "address": { "type": "text" }, "description": { "type": "text" }, "ctime": { "type": "long" } } }
- Run
docker pull jaegertracing/all-in-one docker run -d -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one:latest
- Go to http://localhost:16686/ to see traces
There are 2 options to start the server
- Build and run
go build main.go nohup ./UserSearch &
- Run locally
go run main.go
- Testing api
cd api go test Test -v
- Testing dao
cd dao go test Test -v