Skip to content

Commit

Permalink
Merge pull request #1 from haiwen/add_deploy_by_docker_and_opt_struct…
Browse files Browse the repository at this point in the history
…ures

add_deploy_by_docker_and_opt_structures
  • Loading branch information
freeplant authored Sep 29, 2024
2 parents 5195c43 + a9c2738 commit 874ff9b
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 271 deletions.
12 changes: 8 additions & 4 deletions manual/config/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# SeaSearch Configuration

The official configuration can be referenced:[https://zincsearch-docs.zinc.dev/environment-variables/](https://zincsearch-docs.zinc.dev/environment-variables/)
## Original Configurations

The original configurations of environment variables can be referenced:[https://zincsearch-docs.zinc.dev/environment-variables/](https://zincsearch-docs.zinc.dev/environment-variables/)

The following configuration instructions are for our extended configuration items. All configurations are set in the form of environment variables.

## Extended configuration
## Extended Configurations in SeaSearch

### Single-Node Configurations

```
GIN_MODE, log mode of gin framework,default release
Expand Down Expand Up @@ -45,7 +49,7 @@ ZINC_LOG_LEVEL, log level,default debug
```

## proxy configuration
### Proxy Configurations

```
ZINC_CLUSTER_PROXY_LOG_DIR=./log
Expand All @@ -58,7 +62,7 @@ ZINC_MAX_DOCUMENT_SIZE=1m # Bulk and multisearch limit on the maximum single doc
ZINC_CLUSTER_MANAGER_ADDR=127.0.0.1:4081 # manager address
```

## cluster-manger configuration
### Cluster-manger Configurations

```
ZINC_CLUSTER_MANAGER_LOG_DIR=./log
Expand Down
42 changes: 26 additions & 16 deletions manual/deploy/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
# Launch SeaSearch
# Deploy

## Start a single machine
Note: SeaSearch only supports deployment via docker now.

For the development environment, you only need to follow the official instructions to configure the two environment variables of the startup account and startup password.
## Download the seasearch.yml

Compile SeaSearch reference: [Setup](../setup/README.md)
```bash
wget https://haiwen.github.io/seasearch-docs/repo/seasearch.yml
```

For the development environment, simply configure the environment variables and start the binary file
## Modify .env file

The following command will first create a data folder as the default storage path, then start a SeaSearch program with admin and xxx as the initial users, and listen to port 4080 by default:
First, you need to specify the environment variables used by the SeaSearch image in the relevant `.env` file. Some environment variables can be found in [here](../config/README.md). Please add and modify the values (i.e., `<...>`) ​​of the following fields in the `.env` file.

```
mkdir data
ZINC_FIRST_ADMIN_USER=admin ZINC_FIRST_ADMIN_PASSWORD=xxx GIN_MODE=release ./SeaSearch
```

If you need to reset the data, just delete the entire data directory and restart, which will clean up all metadata and index data.
```shell
# If seasearch uses a separate configuration file such as seasearch.yml, you need to write it into COMPOSE_FILE
COMPOSE_FILE='docker-compose.yml,seasearch.yml'

## Start the cluster
# other environment variables in .env file
# For Apple's chip (M2, e.g.), you should use the images with -nomkl tags (i.e., seafileltd/seasearch-nomkl:latest)
SEASEARCH_IMAGE=seafileltd/seasearch:latest

1. Start etcd
SEASEARCH_DATA_PATH=<persistent-volume-path-of-seasearch>
ZINC_FIRST_ADMIN_USER=<admin-username>
ZINC_FIRST_ADMIN_PASSWORD=<admin-password>
```

Note: if new environment variables are added in .env, they also need to **be set synchronously** in the `seasearch.yml`

2. Start the SeaSearch node, which will automatically register its heartbeat with etcd.
## Restart the Service

3. Start cluster-manager, then set the address of the SeaSearch node through the API or directly set cluster-info to etcd. At the same time, cluster-manager starts to allocate shards based on the node heartbeat.
```shell
docker-compose down
docker-compose up
```

4. Start SeaSearch-proxy, and you can now provide services to the outside world.
Browse seasearch services in [http://127.0.0.1:4080/](http://127.0.0.1:4080/).
21 changes: 21 additions & 0 deletions manual/repo/seasearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
seasearch:
image: ${SEASEARCH_IMAGE:-seafileltd/seasearch:latest}
container_name: seasearch
volumes:
- ${SEASEARCH_DATA_PATH}:/opt/seasearch/data
ports:
- "4080:4080"
environment:
- ZINC_FIRST_ADMIN_USER=${ZINC_FIRST_ADMIN_USER}
- ZINC_FIRST_ADMIN_PASSWORD=${ZINC_FIRST_ADMIN_PASSWORD}
networks:
- frontend-net
- backend-scheduler-net


networks:
frontend-net:
name: frontend-net
backend-scheduler-net:
name: backend-scheduler-net
247 changes: 0 additions & 247 deletions manual/setup/README.md

This file was deleted.

5 changes: 1 addition & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ markdown_extensions:

# Page tree
nav:
- SeaSearch Setup:
- Installation: setup/README.md
- Deploy:
- Deploy SeaSearch: deploy/README.md
- Deploy: deploy/README.md
- Configuration: config/README.md
- SeaSearch API: api/seasearch_api.md

0 comments on commit 874ff9b

Please sign in to comment.