citus-docker icon indicating copy to clipboard operation
citus-docker copied to clipboard

Stock Citus `up` doesn't seem to have Citus extension / functions installed

Open sb8244 opened this issue 7 years ago • 2 comments

When using docker-compose to bring up a stock citus cluster, I can't seem to execute any citus commands, other than SELECT * FROM master_get_active_worker_nodes();. I have provided my up output as well as the SQL showing my \dx and an attempt to create a sharded table. While this table doesn't exist in my system, the exact same situation was happening previously for a table that exists (and the keys exist).

Have you seen this before? Can I provide any information that would help out?

➜  citus-docker git:(master) docker-compose -p citus up
Starting citus_worker_1
Starting citus_master
Creating citus_config
Attaching to citus_worker_1, citus_master, citus_config
worker_1  | LOG:  database system was shut down at 2017-05-09 03:18:53 UTC
worker_1  | LOG:  MultiXact member wraparound protections are now enabled
master_1  | The files belonging to this database system will be owned by user "postgres".
master_1  | This user must also own the server process.
master_1  |
worker_1  | LOG:  database system is ready to accept connections
master_1  | The database cluster will be initialized with locale "en_US.utf8".
master_1  | The default database encoding has accordingly been set to "UTF8".
master_1  | The default text search configuration will be set to "english".
master_1  |
master_1  | Data page checksums are disabled.
master_1  |
master_1  | fixing permissions on existing directory /data ... ok
worker_1  | LOG:  autovacuum launcher started
master_1  | creating subdirectories ... ok
master_1  | selecting default max_connections ... 100
master_1  | selecting default shared_buffers ... 128MB
master_1  | selecting dynamic shared memory implementation ... posix
master_1  | creating configuration files ... ok
master_1  | creating template1 database in /data/base/1 ... ok
master_1  | initializing pg_authid ... ok
master_1  | initializing dependencies ... ok
master_1  | creating shardid sequence ... ok
master_1  | creating jobid sequence ... ok
config_1  | 2017/05/09 03:19:18 Generated '/etc/citus/pg_worker_list.conf' from 3 containers
config_1  | 2017/05/09 03:19:18 Sending container 'citus_master' signal '1'
config_1  | 2017/05/09 03:19:18 Watching docker events
config_1  | 2017/05/09 03:19:18 Contents of /etc/citus/pg_worker_list.conf did not change. Skipping notification ''
master_1  | creating system views ... ok
master_1  | loading system objects' descriptions ... ok
master_1  | creating collations ... ok
master_1  | creating conversions ... ok
master_1  | creating dictionaries ... ok
master_1  | setting privileges on built-in objects ... ok
master_1  | creating information schema ... ok
master_1  | loading PL/pgSQL server-side language ... ok
master_1  | vacuuming database template1 ... ok
master_1  | copying template1 to template0 ... ok
master_1  | copying template1 to postgres ... ok
master_1  | syncing data to disk ... ok
master_1  |
master_1  | Success. You can now start the database server using:
master_1  |
master_1  |     postgres -D /data
master_1  | or
master_1  |     pg_ctl -D /data -l logfile start
master_1  |
master_1  |
master_1  | WARNING: enabling "trust" authentication for local connections
master_1  | You can change this by editing pg_hba.conf or using the option -A, or
master_1  | --auth-local and --auth-host, the next time you run initdb.
master_1  | ****************************************************
master_1  | WARNING: No password has been set for the database.
master_1  |          This will allow anyone with access to the
master_1  |          Postgres port to access your database. In
master_1  |          Docker's default configuration, this is
master_1  |          effectively any other container on the same
master_1  |          system.
master_1  |
master_1  |          Use "-e POSTGRES_PASSWORD=password" to set
master_1  |          it in "docker run".
master_1  | ****************************************************
master_1  |
master_1  | PostgreSQL stand-alone backend 9.4.4
master_1  | backend> statement: ALTER USER "postgres" WITH SUPERUSER  ;
master_1  |
master_1  | backend>
master_1  | LOG:  database system was shut down at 2017-05-09 03:19:19 UTC
master_1  | LOG:  MultiXact member wraparound protections are now enabled
master_1  | LOG:  database system is ready to accept connections
master_1  | LOG:  autovacuum launcher started
master_1  | ERROR:  function create_distributed_table(unknown, unknown) does not exist at character 8
master_1  | HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
master_1  | STATEMENT:  SELECT create_distributed_table('github_events', 'repo_id');
➜  docker exec -it citus_master psql -U postgres
psql (9.4.4)
Type "help" for help.

postgres=# \dxx
                 List of installed extensions
  Name   | Version |   Schema   |         Description
---------+---------+------------+------------------------------
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
(1 row)

postgres=# \dx
                 List of installed extensions
  Name   | Version |   Schema   |         Description
---------+---------+------------+------------------------------
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
(1 row)

postgres=# SELECT create_distributed_table('github_events', 'repo_id');
ERROR:  function create_distributed_table(unknown, unknown) does not exist
LINE 1: SELECT create_distributed_table('github_events', 'repo_id');
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

sb8244 avatar May 09 '17 03:05 sb8244

Hi @sb8244, thanks for opening this issue! Something that we should probably make more clear in the README is that this docker image is for Citus 4.x, which was actually a fork of Postgres instead of an extension. This means that Citus should not show up in \dx, and the syntax for creating distributed tables is not a function call (so create_distributed_table is not a function in 4.x).

Judging from your usage, I assume that you are trying to use Citus 5.x or later. I recommend the official image from Citus for that https://github.com/citusdata/docker.

enochcheung avatar May 15 '17 23:05 enochcheung

Thank you @enochcheung. You are correct that their image is what I was looking for.

sb8244 avatar May 15 '17 23:05 sb8244