agent

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

README

Chorus agent

Serves webhook on port :9673 to receive push notifications from s3. Then converts received s3 bucket notification to chorus replication task and puts it into chorus work queue to be later processed by Chorus worker. Can be used as alternative to Chorus proxy.

Usage

Set proper url, fromStorage, and redis credentials to config and deploy agent to be reachable by source S3 storage.

[!IMPORTANT]
Make sure that chorus-worker and chorus-agent are using the same Redis instance.

[!NOTE]
Worker is required to use CLI. Deploy worker and provide worker GRPC api address to CLI.

With CLI:

  • check that agent successfully registered itself and can be listed with CLI:
    chorctl agent
    
  • use FROM_STORAGE and PUSH_URL from previous command output to create replication policy:
chorctl repl add --from="<src_storage_name>" --to="<dest_storage_name>" --user="<s3 user>" --bucket="<bucket name>" --agent-url="PUSH_URL"
  • Chorus will automatically configure bucket notifications in soruce storage for given bucket and url (tested with aws and ceph rgw).
  • now all changes from src storage will be propagated to dest

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPHandler

func HTTPHandler(handler *notifications.Handler) http.HandlerFunc

func Start

func Start(ctx context.Context, app dom.AppInfo, conf *Config) error

Types

type Config

type Config struct {
	config.Common `yaml:",inline,omitempty" mapstructure:",squash"`

	Port        int    `yaml:"port"`
	FromStorage string `yaml:"fromStorage"`
	URL         string `yaml:"url"`
}

func GetConfig

func GetConfig(src ...config.Src) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL