https://github.com/fernando24164/fastapi-elastic-template
https://github.com/fernando24164/fastapi-elastic-template
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fernando24164/fastapi-elastic-template
- Owner: fernando24164
- Created: 2021-12-27T22:17:26.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-09T00:05:23.000Z (about 3 years ago)
- Last Synced: 2025-01-28T02:44:23.316Z (4 months ago)
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.es.md
Awesome Lists containing this project
README
# Fastapi-elastic-template WIP
[](./README.md)
## Contenido
- [Información](#about)
- [Instalación](#getting_started)Proyecto de ejemplo de ingestión con ElasticSearch y FastAPI
### Prerequitos
Instalar docker-compose
[Install docker compose](https://docs.docker.com/compose/install/)
### Despliegue en local
Para lanzar ElasticSearch
```
docker-compose up
```Si docker-compose falla quizá necesite ejecutar
```
sudo sysctl -w vm.max_map_count=262144
```Conéctese a `localhost:9200` puede que solicite nombre y contraseña:
```
ELASTICSEARCH_USERNAME=elastic
ELASTIC_PASSWORD=changeme
```Para crear un indice en ElasticSearch llamado `ingestion_index`
```
curl --request PUT \
--url 'http://localhost:9200/userindex2?pretty=' \
--header 'Content-Type: application/json' \
--data '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
```### Como desplegar la interfaz de python?
Para lanzar la aplicación de python
```
uvicorn src.main:app
```El servidor estara escuchando en http://127.0.0.1:8000
En este dirección se puede acceder al la URL que nos permite añadir eventos en ElasticSearch.