2021年10月28日

pgadmin4 err

err
(sqlite3.IntegrityError) UNIQUE constraint failed: database.id, database.server
[SQL: INSERT INTO "database" (id, schema_res, server) VALUES (?, ?, ?)]
[parameters: (16384, '', 19)]
(Background on this error at: http://sqlalche.me/e/13/gkpj)

pger.png
posted by a23 at 13:05| Comment(0) | PostgreSQL

Download and install Zabbix PostgreSQL

Download and install Zabbix
Screenshot from 2021-10-28 09-26-36.png


a. Install Zabbix repository


sudo dpkg -i zabbix-release_5.0-1+focal_all.deb

sudo apt update
Screenshot from 2021-10-28 09-34-34.png


err
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています       
状態情報を読み取っています... 完了
アップグレードできるパッケージが 310 個あります。表示するには 'apt list --upgradable' を実行してください。
N: リポジトリ 'http://repo.zabbix.com/zabbix/5.0/ubuntu focal InRelease' がアーキテクチャ 'i386' をサポートしないため設定ファイル 'main/binary-i386/Packages' の取得をスキップ
N: リポジトリ 'http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' がアーキテクチャ 'i386' をサポートしないため設定ファイル 'main/binary-i386/Packages' の取得をスキップ


b. Install Zabbix server, frontend, agent

sudo apt install zabbix-server-pgsql zabbix-frontend-php php7.4-pgsql zabbix-apache-conf zabbix-agent
Screenshot from 2021-10-28 09-37-10.png

Screenshot from 2021-10-28 09-38-52.png


c. Create initial database

sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
Screenshot from 2021-10-28 09-40-14.png

d. Configure the database for Zabbix server
Edit file /etc/zabbix/zabbix_server.conf

sudo gedit /etc/zabbix/zabbix_server.conf

DBPassword=New_db_password
Screenshot from 2021-10-28 09-42-43.png

e. Configure PHP for Zabbix frontend
Edit file /etc/zabbix/apache.conf, uncomment and set the right timezone for you.

sudo gedit /etc/zabbix/apache.conf,

php_value date.timezone Asia/Tokyo
Screenshot from 2021-10-28 10-09-13.png

f. Start Zabbix server and agent processes
Start Zabbix server and agent processes and make it start at system boot.

sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2
Screenshot from 2021-10-28 10-01-58.png


g. Configure Zabbix frontend
Connect to your newly installed Zabbix frontend: http://server_ip_or_name/zabbix
Follow steps described in Zabbix documentation: Installing frontend

127.0.0.1/zabbix
Screenshot from 2021-10-28 10-02-56.png


posted by a23 at 09:27| Comment(0) | JavaScript

2021年10月25日

PostGraphile

-------------------------------------------------------
node.js


sudo apt update

sudo apt install nodejs
-------------------------------------------------------



npm install -g postgraphile



-------------------------------------------------------
PostgreSQLとPostGraphileでサクッとGraphQLエンドポイントを作成する


-------------------------------------------------------
sudo gedit !/usr/bin/env bash

#!/usr/bin/env bash
pnpx postgraphile \
  --connection postgres:///postgres \
  --watch
-------------------------------------------------------




‣ GraphQL API:         http://localhost:5000/graphql
  ‣ GraphiQL GUI/IDE:    http://localhost:5000/graphiql
  ‣ Postgres connection: postgres://postgres:[SECRET]@localhost/mydb (watching)
  ‣ Postgres schema(s):  public
  ‣ Documentation:       https://graphile.org/postgraphile/introduction/
  ‣ Node.js version:     v10.19.0 on linux x64
  ‣ Join Robert Claypool in supporting PostGraphile development: https://graphile.org/sponsor/
  
  
  
  
  
posted by a23 at 08:39| Comment(0) | PostgreSQL