mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
Setting up single node is now: ``` CREATE EXTENSION IF NOT EXISTS iobeamdb CASCADE; select setup_single_node(); ``` To setup a cluster do (on meta node): ``` CREATE EXTENSION IF NOT EXISTS iobeamdb CASCADE; select set_meta(); ``` on data node: ``` CREATE EXTENSION IF NOT EXISTS iobeamdb CASCADE; select join_cluster('metadb', 'metahost'); ``` This assumes that the commands are issued by the same user on both the meta node and the data node. Otherwise the data node also has to specify the user name to use when connecting to the meta node.
25 lines
771 B
SQL
25 lines
771 B
SQL
SET client_min_messages = WARNING;
|
|
DROP DATABASE IF EXISTS meta;
|
|
DROP DATABASE IF EXISTS "Test1";
|
|
DROP DATABASE IF EXISTS test2;
|
|
SET client_min_messages = NOTICE;
|
|
|
|
CREATE DATABASE meta;
|
|
CREATE DATABASE "Test1";
|
|
CREATE DATABASE test2;
|
|
|
|
\c meta
|
|
CREATE EXTENSION IF NOT EXISTS iobeamdb CASCADE;
|
|
select set_meta('localhost');
|
|
|
|
\c Test1
|
|
CREATE SCHEMA io_test;
|
|
CREATE EXTENSION IF NOT EXISTS iobeamdb SCHEMA io_test CASCADE;
|
|
ALTER DATABASE "Test1" SET search_path = "io_test";
|
|
SET search_path = 'io_test';
|
|
select join_cluster(meta_database => 'meta', meta_hostname => 'localhost', node_hostname => 'localhost');
|
|
|
|
\c test2
|
|
CREATE EXTENSION IF NOT EXISTS iobeamdb CASCADE;
|
|
select join_cluster(meta_database => 'meta', meta_hostname => 'localhost', node_hostname => 'localhost');
|