-
Notifications
You must be signed in to change notification settings - Fork 282
How to add a notification
Cesar Celis Hernandez edited this page Feb 26, 2022
·
18 revisions
The reason to add this wiki page is to document the steps on how to enable and disable the notifications, so that we can test manually, learn and then implement automation via GoLang on the API end points. Feel free to improve and share these steps.
- Start MinIO Server
minio server /Volumes/data{1...4} --address localhost:9000 --console-address localhost:9001
As a result you should see this:
Automatically configured API requests per node based on available memory on the system: 263
Status: 4 Online, 0 Offline.
API: http://192.168.0.21:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin
Console: http://localhost:6001
RootUser: minioadmin
RootPass: minioadmin
Command-line: https://docs.min.io/docs/minio-client-quickstart-guide
$ mc alias set myminio http://192.168.0.21:9000 minioadmin minioadmin
Documentation: https://docs.min.io
- Then launch docker container to have PostgreSQL, make sure your
docker daemon
is running:
docker run --name pgsqlcontainer -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres
- Then connect to the Data Base and create this table below:
psql --host localhost --port 5432 --user postgres
The password is: password
as set above in docker command: POSTGRES_PASSWORD=password
CREATE TABLE events (
key serial PRIMARY KEY,
value varchar(30),
event_time timestamp DEFAULT now(),
event_data text
);
- Navigate to
http://localhost:9001/login
:
Where credentials are:
User: minioadmin
Password: minioadmin
- Then go to
notification
page underhttp://localhost:9001/settings/notification-endpoints
:
- Then select
PostgreSQL
option:
- Then fill out the form:
Connection String: user=postgres password=password host=localhost dbname=postgres port=5432 sslmode=disable
Table: events
Queue Dir: Blank
Queue Limit: 10000
Comment: some comment
- Then restart the system:
- Put the credentials after restart and go to notifications:
http://localhost:9001/settings/notification-endpoints
this time you will see thePostgreSQL
notification added andonline
:
mc alias set myminio http://localhost:9000 minioadmin minioadmin
mc admin config reset myminio/ notify_postgres
mc admin service restart myminio/
This is how it looks from example above:
$ mc alias set myminio http://localhost:9000 minioadmin minioadmin
Added `myminio` successfully.
$ mc admin config reset myminio/ notify_postgres
Key is successfully reset.
Please restart your server with `mc admin service restart myminio/`.
$ mc admin service restart myminio/
Restart command successfully sent to `myminio/`. Type Ctrl-C to quit or wait to follow the status of the restart process.
....
Restarted `myminio/` successfully in 2 seconds
And after deletion we are back to empty stage: