· 7 years ago · Feb 28, 2019, 10:42 AM
1arenadata_configs/ .bash_logout .bashrc .gphostcache .lesshst .pgpass.1550490837 .ssh/
2[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/
3.ansible/ .bash_history .bash_profile gpAdminLogs/ .gshist .pgpass .psql_history .viminfo
4arenadata_configs/ .bash_logout .bashrc .gphostcache .lesshst .pgpass.1550490837 .ssh/
5[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/
6arenadata_all_hosts.hosts collect_table_stats.log db_datfrozenxid_alerter.sh operation.sh system_db.sh
7arenadata_segment_hosts.hosts collect_table_stats.sql gzip_pg_log.log operation_vacuum.log test_database.sh
8arenadata_segments_monitor.log crontab.txt gzip_pg_log.sql run_sql.sh vacuum_catalog_tables.log
9arenadata_segments_monitor.sh database init_config.conf run_sql_to_gpssh.sh vacuum_catalog_tables.sql
10arenadata_toolkit_create.sql db_datfrozenxid_alerter.log operation_analyze.log system_db.log
11[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts ls
12[sdw2] arenadata_configs gpAdminLogs
13[sdw1] arenadata_configs gpAdminLogs
14[gpadmin@mdw ~]$ less /etc/
15Display all 223 possibilities? (y or n)
16[gpadmin@mdw ~]$ exit
17logout
18[root@mdw ~]# ls /etc/
19Display all 223 possibilities? (y or n)
20[root@mdw ~]# su - gpadmin
21Last login: Thu Feb 28 01:00:02 MSK 2019 from mdw on pts/5
22[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts locate pxf-private.classpath
23[sdw2] /etc/pxf-3.3.0.0/conf/pxf-private.classpath
24[sdw1] /etc/pxf-3.3.0.0/conf/pxf-private.classpath
25[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts cat /etc/pxf/conf/pxf-private.classpath
26[sdw2] # Licensed to the Apache Software Foundation (ASF) under one or more
27[sdw2] # contributor license agreements. See the NOTICE file distributed with
28[sdw2] # this work for additional information regarding copyright ownership.
29[sdw2] # The ASF licenses this file to You under the Apache License, Version 2.0
30[sdw2] # (the "License"); you may not use this file except in compliance with
31[sdw2] # the License. You may obtain a copy of the License at
32[sdw2] #
33[sdw2] # http://www.apache.org/licenses/LICENSE-2.0
34[sdw2] #
35[sdw2] # Unless required by applicable law or agreed to in writing, software
36[sdw2] # distributed under the License is distributed on an "AS IS" BASIS,
37[sdw2] # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38[sdw2] # See the License for the specific language governing permissions and
39[sdw2] # limitations under the License.
40[sdw2]
41[sdw2] ##################################################################
42[sdw2] # This file contains the internal classpaths required to run PXF
43[sdw2] # with RPM-based installation of hadoop clients from CDH distribution.
44[sdw2] # WARNING: DO NOT EDIT!
45[sdw2] # Any change in this file can result in PXF failing to run.
46[sdw2] # Adding resources should be done using pxf-public.classpath file.
47[sdw2] ##################################################################
48[sdw2]
49[sdw2] # PXF Configuration
50[sdw2] /etc/pxf/conf
51[sdw2]
52[sdw2] # PXF Libraries
53[sdw2] /etc/pxf/lib/pxf-hbase.jar
54[sdw2] /etc/pxf/lib/pxf-hdfs.jar
55[sdw2] /etc/pxf/lib/pxf-hive.jar
56[sdw2] /etc/pxf/lib/pxf-json.jar
57[sdw2] /etc/pxf/lib/pxf-jdbc.jar
58[sdw2] /etc/pxf/lib/pxf-ignite.jar
59[sdw2]
60[sdw2] # Hadoop/Hive/HBase configurations
61[sdw2] /etc/hadoop/conf
62[sdw2] /etc/hive/conf
63[sdw2] /etc/hbase/conf
64[sdw2]
65[sdw2] # Hadoop Libraries
66[sdw2] /usr/lib/hadoop/client/hadoop-hdfs-client.jar
67[sdw2] /usr/lib/hadoop/lib/jackson-core-asl-1.9.13.jar
68[sdw2] /usr/lib/hadoop/client/hadoop-hdfs.jar
69[sdw2] /usr/lib/hadoop/client/hadoop-mapreduce-client-core.jar
70[sdw2] /usr/lib/hadoop/client/hadoop-mapreduce-client-common.jar
71[sdw2] /usr/lib/hadoop/client/hadoop-auth.jar
72[sdw2] /usr/lib/hadoop/client/hadoop-common.jar
73[sdw2] /usr/lib/hadoop/client/avro.jar
74[sdw2] /usr/lib/hadoop/client/commons-cli.jar
75[sdw2] /usr/lib/hadoop/client/commons-codec.jar
76[sdw2] /usr/lib/hadoop/client/commons-collections.jar
77[sdw2] /usr/lib/hadoop/client/commons-configuration.jar
78[sdw2] /usr/lib/hadoop/client/commons-io.jar
79[sdw2] /usr/lib/hadoop/client/commons-lang.jar
80[sdw2] /usr/lib/hadoop/client/commons-logging.jar
81[sdw2] /usr/lib/hadoop/client/guava.jar
82[sdw2] /usr/lib/hadoop/client/htrace-core4.jar
83[sdw2] /usr/lib/hadoop/client/jackson-core.jar
84[sdw2] /usr/lib/hadoop/client/jackson-mapper-asl.jar
85[sdw2] /usr/lib/hadoop/client/jetty-*.jar
86[sdw2] /usr/lib/hadoop/client/jersey-core.jar
87[sdw2] /usr/lib/hadoop/client/log4j.jar
88[sdw2] /usr/lib/hadoop/client/protobuf-java-*[0-9].jar
89[sdw2] /usr/lib/hadoop/client/slf4j-api.jar
90[sdw2] /usr/lib/hadoop/client/snappy-java.jar
91[sdw2] /usr/lib/hadoop/lib/asm-*[0-9].jar
92[sdw2] /usr/lib/hadoop/lib/jersey-server-*[0-9].jar
93[sdw2]
94[sdw2] # Hive Libraries
95[sdw2] /usr/lib/hive/lib/antlr-runtime-*[0-9].jar
96[sdw2] /usr/lib/hive/lib/datanucleus-api-jdo-*[0-9].jar
97[sdw2] /usr/lib/hive/lib/datanucleus-core-*[0-9].jar
98[sdw2] /usr/lib/hive/lib/hive-exec.jar
99[sdw2] /usr/lib/hive/lib/hive-metastore.jar
100[sdw2] /usr/lib/hive/lib/jdo-api-*[0-9].jar
101[sdw2] /usr/lib/hive/lib/libfb303-*[0-9].jar
102[sdw2]
103[sdw2] # HBase Libraries
104[sdw2] /usr/lib/hadoop/client/htrace-core.jar
105[sdw2] /usr/lib/hbase/hbase-client.jar
106[sdw2] /usr/lib/hbase/hbase-common.jar
107[sdw2] /usr/lib/hbase/hbase-protocol.jar
108[sdw2] /usr/lib/hbase/lib/htrace-core.jar
109[sdw2] /usr/lib/hbase/lib/netty-*[0-9].Final.jar
110[sdw2] /usr/lib/hbase/lib/metrics-core*.jar
111[sdw2] /usr/lib/zookeeper/zookeeper.jar
112[sdw2] /usr/lib/pxf/mssql-jdbc-6.4.0.jre8.jar
113[sdw2] /usr/lib/pxf/mongodb_unityjdbc_full.jar
114[sdw2] /usr/lib/pxf/mysql-connector-java-5.1.45-bin.jar
115[sdw2] /usr/lib/pxf/ignite-core-2.3.0.jar
116[sdw2] /usr/lib/pxf/commons-compress-1.14.jar
117[sdw2] /usr/lib/pxf/mongo-java-driver-3.6.2.jar
118[sdw2] /usr/lib/pxf/postgresql-42.2.2.jar
119[sdw2] /usr/lib/pxf/ojdbc6.jar
120[sdw1] # Licensed to the Apache Software Foundation (ASF) under one or more
121[sdw1] # contributor license agreements. See the NOTICE file distributed with
122[sdw1] # this work for additional information regarding copyright ownership.
123[sdw1] # The ASF licenses this file to You under the Apache License, Version 2.0
124[sdw1] # (the "License"); you may not use this file except in compliance with
125[sdw1] # the License. You may obtain a copy of the License at
126[sdw1] #
127[sdw1] # http://www.apache.org/licenses/LICENSE-2.0
128[sdw1] #
129[sdw1] # Unless required by applicable law or agreed to in writing, software
130[sdw1] # distributed under the License is distributed on an "AS IS" BASIS,
131[sdw1] # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132[sdw1] # See the License for the specific language governing permissions and
133[sdw1] # limitations under the License.
134[sdw1]
135[sdw1] ##################################################################
136[sdw1] # This file contains the internal classpaths required to run PXF
137[sdw1] # with RPM-based installation of hadoop clients from CDH distribution.
138[sdw1] # WARNING: DO NOT EDIT!
139[sdw1] # Any change in this file can result in PXF failing to run.
140[sdw1] # Adding resources should be done using pxf-public.classpath file.
141[sdw1] ##################################################################
142[sdw1]
143[sdw1] # PXF Configuration
144[sdw1] /etc/pxf/conf
145[sdw1]
146[sdw1] # PXF Libraries
147[sdw1] /etc/pxf/lib/pxf-hbase.jar
148[sdw1] /etc/pxf/lib/pxf-hdfs.jar
149[sdw1] /etc/pxf/lib/pxf-hive.jar
150[sdw1] /etc/pxf/lib/pxf-json.jar
151[sdw1] /etc/pxf/lib/pxf-jdbc.jar
152[sdw1] /etc/pxf/lib/pxf-ignite.jar
153[sdw1]
154[sdw1] # Hadoop/Hive/HBase configurations
155[sdw1] /etc/hadoop/conf
156[sdw1] /etc/hive/conf
157[sdw1] /etc/hbase/conf
158[sdw1]
159[sdw1] # Hadoop Libraries
160[sdw1] /usr/lib/hadoop/client/hadoop-hdfs-client.jar
161[sdw1] /usr/lib/hadoop/lib/jackson-core-asl-1.9.13.jar
162[sdw1] /usr/lib/hadoop/client/hadoop-hdfs.jar
163[sdw1] /usr/lib/hadoop/client/hadoop-mapreduce-client-core.jar
164[sdw1] /usr/lib/hadoop/client/hadoop-mapreduce-client-common.jar
165[sdw1] /usr/lib/hadoop/client/hadoop-auth.jar
166[sdw1] /usr/lib/hadoop/client/hadoop-common.jar
167[sdw1] /usr/lib/hadoop/client/avro.jar
168[sdw1] /usr/lib/hadoop/client/commons-cli.jar
169[sdw1] /usr/lib/hadoop/client/commons-codec.jar
170[sdw1] /usr/lib/hadoop/client/commons-collections.jar
171[sdw1] /usr/lib/hadoop/client/commons-configuration.jar
172[sdw1] /usr/lib/hadoop/client/commons-io.jar
173[sdw1] /usr/lib/hadoop/client/commons-lang.jar
174[sdw1] /usr/lib/hadoop/client/commons-logging.jar
175[sdw1] /usr/lib/hadoop/client/guava.jar
176[sdw1] /usr/lib/hadoop/client/htrace-core4.jar
177[sdw1] /usr/lib/hadoop/client/jackson-core.jar
178[sdw1] /usr/lib/hadoop/client/jackson-mapper-asl.jar
179[sdw1] /usr/lib/hadoop/client/jetty-*.jar
180[sdw1] /usr/lib/hadoop/client/jersey-core.jar
181[sdw1] /usr/lib/hadoop/client/log4j.jar
182[sdw1] /usr/lib/hadoop/client/protobuf-java-*[0-9].jar
183[sdw1] /usr/lib/hadoop/client/slf4j-api.jar
184[sdw1] /usr/lib/hadoop/client/snappy-java.jar
185[sdw1] /usr/lib/hadoop/lib/asm-*[0-9].jar
186[sdw1] /usr/lib/hadoop/lib/jersey-server-*[0-9].jar
187[sdw1]
188[sdw1] # Hive Libraries
189[sdw1] /usr/lib/hive/lib/antlr-runtime-*[0-9].jar
190[sdw1] /usr/lib/hive/lib/datanucleus-api-jdo-*[0-9].jar
191[sdw1] /usr/lib/hive/lib/datanucleus-core-*[0-9].jar
192[sdw1] /usr/lib/hive/lib/hive-exec.jar
193[sdw1] /usr/lib/hive/lib/hive-metastore.jar
194[sdw1] /usr/lib/hive/lib/jdo-api-*[0-9].jar
195[sdw1] /usr/lib/hive/lib/libfb303-*[0-9].jar
196[sdw1]
197[sdw1] # HBase Libraries
198[sdw1] /usr/lib/hadoop/client/htrace-core.jar
199[sdw1] /usr/lib/hbase/hbase-client.jar
200[sdw1] /usr/lib/hbase/hbase-common.jar
201[sdw1] /usr/lib/hbase/hbase-protocol.jar
202[sdw1] /usr/lib/hbase/lib/htrace-core.jar
203[sdw1] /usr/lib/hbase/lib/netty-*[0-9].Final.jar
204[sdw1] /usr/lib/hbase/lib/metrics-core*.jar
205[sdw1] /usr/lib/zookeeper/zookeeper.jar
206[sdw1] /usr/lib/pxf/mssql-jdbc-6.4.0.jre8.jar
207[sdw1] /usr/lib/pxf/mongodb_unityjdbc_full.jar
208[sdw1] /usr/lib/pxf/mysql-connector-java-5.1.45-bin.jar
209[sdw1] /usr/lib/pxf/ignite-core-2.3.0.jar
210[sdw1] /usr/lib/pxf/commons-compress-1.14.jar
211[sdw1] /usr/lib/pxf/mongo-java-driver-3.6.2.jar
212[sdw1] /usr/lib/pxf/postgresql-42.2.2.jar
213[sdw1] /usr/lib/pxf/ojdbc6.jar
214[gpadmin@mdw ~]$ exit
215logout
216[root@mdw ~]# gpssg
217-bash: gpssg: command not found
218[root@mdw ~]# gpssh
219-bash: gpssh: command not found
220[root@mdw ~]# locate gpssh
221/data1/master/gpseg-1/gpssh.conf
222/home/gpadmin/arenadata_configs/run_sql_to_gpssh.sh
223/opt/adb_ansible_stack/database/run_sql_to_gpssh.sh
224/usr/lib/gpdb/bin/gpssh
225/usr/lib/gpdb/bin/gpssh-exkeys
226/usr/lib/gpdb/bin/gpssh_modules
227/usr/lib/gpdb/bin/gpssh_modules/README.md
228/usr/lib/gpdb/bin/gpssh_modules/__init__.py
229/usr/lib/gpdb/bin/gpssh_modules/gppxssh_wrapper.py
230/usr/lib/gpdb/docs/cli_help/gpssh-exkeys_help
231/usr/lib/gpdb/docs/cli_help/gpssh_help
232/usr/lib/gpdb/docs/cli_help/gpconfigs/hostfile_gpssh_allhosts
233/usr/lib/gpdb/docs/cli_help/gpconfigs/hostfile_gpssh_segonly
234[root@mdw ~]# /usr/lib/gpdb/bin/gpssh -f /home/gpadmin/
235.ansible/ .bash_history .bash_profile gpAdminLogs/ .gshist .pgpass .psql_history .viminfo
236arenadata_configs/ .bash_logout .bashrc .gphostcache .lesshst .pgpass.1550490837 .ssh/
237[root@mdw ~]# /usr/lib/gpdb/bin/gpssh -f /home/gpadmin/arenadata_configs/
238arenadata_all_hosts.hosts collect_table_stats.log db_datfrozenxid_alerter.sh operation.sh system_db.sh
239arenadata_segment_hosts.hosts collect_table_stats.sql gzip_pg_log.log operation_vacuum.log test_database.sh
240arenadata_segments_monitor.log crontab.txt gzip_pg_log.sql run_sql.sh vacuum_catalog_tables.log
241arenadata_segments_monitor.sh database init_config.conf run_sql_to_gpssh.sh vacuum_catalog_tables.sql
242arenadata_toolkit_create.sql db_datfrozenxid_alerter.log operation_analyze.log system_db.log
243[root@mdw ~]# /usr/lib/gpdb/bin/gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts ls
244Traceback (most recent call last):
245 File "/usr/lib/gpdb/bin/gpssh", line 32, in <module>
246 from gppylib.util import ssh_utils
247ImportError: No module named gppylib.util
248[root@mdw ~]# ser
249serialver servertool service
250[root@mdw ~]# ser
251serialver servertool service
252[root@mdw ~]# ser
253serialver servertool service
254[root@mdw ~]# su - gpadmin
255Last login: Thu Feb 28 11:17:17 MSK 2019 on pts/1
256[gpadmin@mdw ~]$ ser
257serialver servertool service
258[gpadmin@mdw ~]$ ser
259serialver servertool service
260[gpadmin@mdw ~]$ ser
261serialver servertool service
262[gpadmin@mdw ~]$ service pxf
263The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemc
264[gpadmin@mdw ~]$ service pxf status
265Redirecting to /bin/systemctl status pxf.service
266Unit pxf.service could not be found.
267[gpadmin@mdw ~]$ exit
268logout
269[root@mdw ~]# /usr/lib/gpdb/bin/gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts ls
270Traceback (most recent call last):
271 File "/usr/lib/gpdb/bin/gpssh", line 32, in <module>
272 from gppylib.util import ssh_utils
273ImportError: No module named gppylib.util
274[root@mdw ~]# su - gpadmin
275Last login: Thu Feb 28 11:22:58 MSK 2019 on pts/1
276[gpadmin@mdw ~]$ gpssh --help
277COMMAND NAME: gpssh
278
279Provides ssh access to multiple hosts at once.
280
281
282*****************************************************
283SYNOPSIS
284*****************************************************
285
286gpssh { -f <hostfile_gpssh> | -h <hostname> [-h <hostname> ...] }
287[-u userid] [-s] [-v] [-e] [-d seconds] [-t multiplier] [<bash_command>]
288
289gpssh -?
290
291gpssh --version
292
293
294*****************************************************
295DESCRIPTION
296*****************************************************
297
298The gpssh utility allows you to run bash shell commands on
299multiple hosts at once using SSH (secure shell). You can execute
300a single command by specifying it on the command-line, or omit
301the command to enter into an interactive command-line session.
302
303To specify the hosts involved in the SSH session, use the -f
304option to specify a file containing a list of host names, or use
305the -h option to name single host names on the command-line. At
306least one host name (-h) or a host file (-f) is required. Note that
307the current host is not included in the session by default to
308include the local host, you must explicitly declare it in the
309list of hosts involved in the session.
310
311Before using gpssh, you must have a trusted host setup between
312the hosts involved in the SSH session. You can use the utility
313gpssh-exkeys to update the known host files and exchange public
314keys between hosts if you have not done so already.
315
316If you do not specify a command on the command-line, gpssh will
317go into interactive mode. At the gpssh command prompt (=>), you
318can enter a command as you would in a regular bash terminal command-line,
319and the command will be executed on all hosts involved in the session.
320To end an interactive session, press CTRL+D on the keyboard or type exit.
321
322If a user name is not specified in the host list file, gpssh will
323execute commands as the currently logged in user. To determine the
324currently logged in user, do a whoami command. By default, gpssh goes
325to $HOME of the session user on the remote hosts after login. To ensure
326commands are executed correctly on all remote hosts, you should always
327enter absolute paths.
328
329If you encounter network timeout problems when using gpssh, you can
330use -d and -t options or set parameters in the gpssh.conf file to
331control the timing that gpssh uses when validating the initial ssh
332connection. For information about the configuration file, see gpssh
333Configuration File.
334
335*****************************************************
336OPTIONS
337*****************************************************
338
339<bash_command>
340
341 A bash shell command to execute on all hosts involved in this
342 session (optionally enclosed in quotes). If not specified, gpssh
343 will start an interactive session.
344
345
346-d (delay) seconds
347
348 Optional. Specifies the time, in seconds, to wait at the start of a
349 gpssh interaction with ssh. Default is 0.05. This option overrides the
350 delaybeforesend value that is specified in the gpssh.conf configuration
351 file.
352
353 Increasing this value can cause a long wait time during gpssh startup.
354
355
356-e (echo)
357
358 Optional. Echoes the commands passed to each host and their
359 resulting output while running in non-interactive mode.
360
361
362-f <hostfile_gpssh>
363
364 Specifies the name of a file that contains a list of hosts that
365 will participate in this SSH session. The host name is required.
366 The syntax of the host file is one host per line as follows:
367
368 <hostname>
369
370
371-h <hostname>
372
373 Specifies a single host name that will participate in this SSH session.
374 You can use the -h option multiple times to specify multiple host names.
375
376
377-s
378
379 Optional. If specified, before executing any commands on the target
380 host, gpssh sources the file greenplum_path.sh in the directory
381 specified by the $GPHOME environment variable.
382
383 This option is valid for both interactive mode and single command mode.
384
385
386-t multiplier
387
388 Optional. A decimal number greater than 0 (zero) that is the multiplier
389 for the timeout that gpssh uses when validating the ssh prompt. Default
390 is 1. This option overrides the prompt_validation_timeout value that is
391 specified in the gpssh.conf configuration file.
392
393 Increasing this value has a small impact during gpssh startup.
394
395
396-u <userid>
397
398 Specifies the userid for this SSH session.
399
400
401-v (verbose mode)
402
403 Optional. Reports additional messages in addition to the command
404 output when running in non-interactive mode.
405
406
407--version
408
409 Displays the version of this utility.
410
411
412-? (help)
413
414 Displays the online help.
415
416
417
418
419*****************************************************
420gpssh Configuration File
421*****************************************************
422The gpssh.conf file contains parameters that let you adjust the timing
423that gpssh uses when validating the initial ssh connection. These
424parameters affect the network connection before the gpssh session
425executes commands with ssh. The location of the file is specified by the
426environment variable MASTER_DATA_DIRECTORY. If the environment variable
427is not defined or the gpssh.conf file does not exist in the directory
428gpssh uses the default values or the values set with the -d and -t
429options. For information about the environment variable, see the
430Greenplum Database Reference Guide.
431
432The gpssh.conf file is a text file that consists of a [gpssh] section
433and parameters. On a line, the # (pound sign) indicates the start of a
434comment. This is an example gpssh.conf file.
435
436
437 [gpssh]
438 delaybeforesend = 0.05
439 prompt_validation_timeout = 1.0
440 sync_retries = 3
441
442
443These are the gpssh.conf parameters.
444
445delaybeforesend = seconds
446
447 Specifies the time, in seconds, to wait at the start of a gpssh
448 interaction with ssh. Default is 0.05. Increasing this value can
449 cause a long wait time during gpssh startup. The -d option
450 overrides this parameter.
451
452prompt_validation_timeout = multiplier
453
454 A decimal number greater than 0 (zero) that is the multiplier for the
455 timeout that gpssh uses when validating the ssh prompt. Increasing this
456 value has a small impact during gpssh startup. Default is 1. The -t
457 option overrides this parameter.
458
459sync_retry = attempts
460
461 A non-negative integer that specifies the maximum number of retry attempts
462 that gpssh performs to try connecting to a Greenplum Database remote host. The
463 default is 3. If the value is 0, gpssh returns an error if the initial
464 connection attempt fails. This parameter cannot be configured with a
465 command-line option.
466
467 Increasing this value compensates for slow network performance or performance
468 issues such as heavy CPU or I/O load on the segment host. However, when a
469 connection cannot be established, an increased value also increases the delay
470 when an error is returned.
471
472
473
474
475*****************************************************
476EXAMPLES
477*****************************************************
478
479Start an interactive group SSH session with all hosts listed
480in the file hostfile_gpssh:
481
482 $ gpssh -f hostfile_gpssh
483
484
485At the gpssh interactive command prompt, run a shell command
486on all the hosts involved in this session.
487
488 => ls -a /data/primary/*
489
490Exit an interactive session:
491
492 => exit
493
494
495Start a non-interactive group SSH session with the hosts named
496sdw1 and sdw2 and pass a file containing several commands
497named command_file to gpssh:
498
499 $ gpssh -h sdw1 -h sdw2 -v -e < command_file
500
501
502Execute single commands in non-interactive mode on hosts
503sdw2 and localhost:
504
505 $ gpssh -h sdw2 -h localhost -v -e 'ls -a /data/primary/*'
506
507 $ gpssh -h sdw2 -h localhost -v -e 'echo $GPHOME'
508
509 $ gpssh -h sdw2 -h localhost -v -e 'ls -1 | wc -l'
510
511
512*****************************************************
513SEE ALSO
514*****************************************************
515
516gpssh-exkeys, gpscp
517
518Error: option --help not recognized
519[gpadmin@mdw ~]$ legpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts cat /etc/pxf/conf/pxf-private.classpath
520-bash: legpssh: command not found
521[gpadmin@mdw ~]$
522[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts cat /etc/pxf/conf/pxf-private.classpath
523[sdw1] # Licensed to the Apache Software Foundation (ASF) under one or more
524[sdw1] # contributor license agreements. See the NOTICE file distributed with
525[sdw1] # this work for additional information regarding copyright ownership.
526[sdw1] # The ASF licenses this file to You under the Apache License, Version 2.0
527[sdw1] # (the "License"); you may not use this file except in compliance with
528[sdw1] # the License. You may obtain a copy of the License at
529[sdw1] #
530[sdw1] # http://www.apache.org/licenses/LICENSE-2.0
531[sdw1] #
532[sdw1] # Unless required by applicable law or agreed to in writing, software
533[sdw1] # distributed under the License is distributed on an "AS IS" BASIS,
534[sdw1] # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
535[sdw1] # See the License for the specific language governing permissions and
536[sdw1] # limitations under the License.
537[sdw1]
538[sdw1] ##################################################################
539[sdw1] # This file contains the internal classpaths required to run PXF
540[sdw1] # with RPM-based installation of hadoop clients from CDH distribution.
541[sdw1] # WARNING: DO NOT EDIT!
542[sdw1] # Any change in this file can result in PXF failing to run.
543[sdw1] # Adding resources should be done using pxf-public.classpath file.
544[sdw1] ##################################################################
545[sdw1]
546[sdw1] # PXF Configuration
547[sdw1] /etc/pxf/conf
548[sdw1]
549[sdw1] # PXF Libraries
550[sdw1] /etc/pxf/lib/pxf-hbase.jar
551[sdw1] /etc/pxf/lib/pxf-hdfs.jar
552[sdw1] /etc/pxf/lib/pxf-hive.jar
553[sdw1] /etc/pxf/lib/pxf-json.jar
554[sdw1] /etc/pxf/lib/pxf-jdbc.jar
555[sdw1] /etc/pxf/lib/pxf-ignite.jar
556[sdw1]
557[sdw1] # Hadoop/Hive/HBase configurations
558[sdw1] /etc/hadoop/conf
559[sdw1] /etc/hive/conf
560[sdw1] /etc/hbase/conf
561[sdw1]
562[sdw1] # Hadoop Libraries
563[sdw1] /usr/lib/hadoop/client/hadoop-hdfs-client.jar
564[sdw1] /usr/lib/hadoop/lib/jackson-core-asl-1.9.13.jar
565[sdw1] /usr/lib/hadoop/client/hadoop-hdfs.jar
566[sdw1] /usr/lib/hadoop/client/hadoop-mapreduce-client-core.jar
567[sdw1] /usr/lib/hadoop/client/hadoop-mapreduce-client-common.jar
568[sdw1] /usr/lib/hadoop/client/hadoop-auth.jar
569[sdw1] /usr/lib/hadoop/client/hadoop-common.jar
570[sdw1] /usr/lib/hadoop/client/avro.jar
571[sdw1] /usr/lib/hadoop/client/commons-cli.jar
572[sdw1] /usr/lib/hadoop/client/commons-codec.jar
573[sdw1] /usr/lib/hadoop/client/commons-collections.jar
574[sdw1] /usr/lib/hadoop/client/commons-configuration.jar
575[sdw1] /usr/lib/hadoop/client/commons-io.jar
576[sdw1] /usr/lib/hadoop/client/commons-lang.jar
577[sdw1] /usr/lib/hadoop/client/commons-logging.jar
578[sdw1] /usr/lib/hadoop/client/guava.jar
579[sdw1] /usr/lib/hadoop/client/htrace-core4.jar
580[sdw1] /usr/lib/hadoop/client/jackson-core.jar
581[sdw1] /usr/lib/hadoop/client/jackson-mapper-asl.jar
582[sdw1] /usr/lib/hadoop/client/jetty-*.jar
583[sdw1] /usr/lib/hadoop/client/jersey-core.jar
584[sdw1] /usr/lib/hadoop/client/log4j.jar
585[sdw1] /usr/lib/hadoop/client/protobuf-java-*[0-9].jar
586[sdw1] /usr/lib/hadoop/client/slf4j-api.jar
587[sdw1] /usr/lib/hadoop/client/snappy-java.jar
588[sdw1] /usr/lib/hadoop/lib/asm-*[0-9].jar
589[sdw1] /usr/lib/hadoop/lib/jersey-server-*[0-9].jar
590[sdw1]
591[sdw1] # Hive Libraries
592[sdw1] /usr/lib/hive/lib/antlr-runtime-*[0-9].jar
593[sdw1] /usr/lib/hive/lib/datanucleus-api-jdo-*[0-9].jar
594[sdw1] /usr/lib/hive/lib/datanucleus-core-*[0-9].jar
595[sdw1] /usr/lib/hive/lib/hive-exec.jar
596[sdw1] /usr/lib/hive/lib/hive-metastore.jar
597[sdw1] /usr/lib/hive/lib/jdo-api-*[0-9].jar
598[sdw1] /usr/lib/hive/lib/libfb303-*[0-9].jar
599[sdw1]
600[sdw1] # HBase Libraries
601[sdw1] /usr/lib/hadoop/client/htrace-core.jar
602[sdw1] /usr/lib/hbase/hbase-client.jar
603[sdw1] /usr/lib/hbase/hbase-common.jar
604[sdw1] /usr/lib/hbase/hbase-protocol.jar
605[sdw1] /usr/lib/hbase/lib/htrace-core.jar
606[sdw1] /usr/lib/hbase/lib/netty-*[0-9].Final.jar
607[sdw1] /usr/lib/hbase/lib/metrics-core*.jar
608[sdw1] /usr/lib/zookeeper/zookeeper.jar
609[sdw1] /usr/lib/pxf/mssql-jdbc-6.4.0.jre8.jar
610[sdw1] /usr/lib/pxf/mongodb_unityjdbc_full.jar
611[sdw1] /usr/lib/pxf/mysql-connector-java-5.1.45-bin.jar
612[sdw1] /usr/lib/pxf/ignite-core-2.3.0.jar
613[sdw1] /usr/lib/pxf/commons-compress-1.14.jar
614[sdw1] /usr/lib/pxf/mongo-java-driver-3.6.2.jar
615[sdw1] /usr/lib/pxf/postgresql-42.2.2.jar
616[sdw1] /usr/lib/pxf/ojdbc6.jar
617[sdw2] # Licensed to the Apache Software Foundation (ASF) under one or more
618[sdw2] # contributor license agreements. See the NOTICE file distributed with
619[sdw2] # this work for additional information regarding copyright ownership.
620[sdw2] # The ASF licenses this file to You under the Apache License, Version 2.0
621[sdw2] # (the "License"); you may not use this file except in compliance with
622[sdw2] # the License. You may obtain a copy of the License at
623[sdw2] #
624[sdw2] # http://www.apache.org/licenses/LICENSE-2.0
625[sdw2] #
626[sdw2] # Unless required by applicable law or agreed to in writing, software
627[sdw2] # distributed under the License is distributed on an "AS IS" BASIS,
628[sdw2] # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629[sdw2] # See the License for the specific language governing permissions and
630[sdw2] # limitations under the License.
631[sdw2]
632[sdw2] ##################################################################
633[sdw2] # This file contains the internal classpaths required to run PXF
634[sdw2] # with RPM-based installation of hadoop clients from CDH distribution.
635[sdw2] # WARNING: DO NOT EDIT!
636[sdw2] # Any change in this file can result in PXF failing to run.
637[sdw2] # Adding resources should be done using pxf-public.classpath file.
638[sdw2] ##################################################################
639[sdw2]
640[sdw2] # PXF Configuration
641[sdw2] /etc/pxf/conf
642[sdw2]
643[sdw2] # PXF Libraries
644[sdw2] /etc/pxf/lib/pxf-hbase.jar
645[sdw2] /etc/pxf/lib/pxf-hdfs.jar
646[sdw2] /etc/pxf/lib/pxf-hive.jar
647[sdw2] /etc/pxf/lib/pxf-json.jar
648[sdw2] /etc/pxf/lib/pxf-jdbc.jar
649[sdw2] /etc/pxf/lib/pxf-ignite.jar
650[sdw2]
651[sdw2] # Hadoop/Hive/HBase configurations
652[sdw2] /etc/hadoop/conf
653[sdw2] /etc/hive/conf
654[sdw2] /etc/hbase/conf
655[sdw2]
656[sdw2] # Hadoop Libraries
657[sdw2] /usr/lib/hadoop/client/hadoop-hdfs-client.jar
658[sdw2] /usr/lib/hadoop/lib/jackson-core-asl-1.9.13.jar
659[sdw2] /usr/lib/hadoop/client/hadoop-hdfs.jar
660[sdw2] /usr/lib/hadoop/client/hadoop-mapreduce-client-core.jar
661[sdw2] /usr/lib/hadoop/client/hadoop-mapreduce-client-common.jar
662[sdw2] /usr/lib/hadoop/client/hadoop-auth.jar
663[sdw2] /usr/lib/hadoop/client/hadoop-common.jar
664[sdw2] /usr/lib/hadoop/client/avro.jar
665[sdw2] /usr/lib/hadoop/client/commons-cli.jar
666[sdw2] /usr/lib/hadoop/client/commons-codec.jar
667[sdw2] /usr/lib/hadoop/client/commons-collections.jar
668[sdw2] /usr/lib/hadoop/client/commons-configuration.jar
669[sdw2] /usr/lib/hadoop/client/commons-io.jar
670[sdw2] /usr/lib/hadoop/client/commons-lang.jar
671[sdw2] /usr/lib/hadoop/client/commons-logging.jar
672[sdw2] /usr/lib/hadoop/client/guava.jar
673[sdw2] /usr/lib/hadoop/client/htrace-core4.jar
674[sdw2] /usr/lib/hadoop/client/jackson-core.jar
675[sdw2] /usr/lib/hadoop/client/jackson-mapper-asl.jar
676[sdw2] /usr/lib/hadoop/client/jetty-*.jar
677[sdw2] /usr/lib/hadoop/client/jersey-core.jar
678[sdw2] /usr/lib/hadoop/client/log4j.jar
679[sdw2] /usr/lib/hadoop/client/protobuf-java-*[0-9].jar
680[sdw2] /usr/lib/hadoop/client/slf4j-api.jar
681[sdw2] /usr/lib/hadoop/client/snappy-java.jar
682[sdw2] /usr/lib/hadoop/lib/asm-*[0-9].jar
683[sdw2] /usr/lib/hadoop/lib/jersey-server-*[0-9].jar
684[sdw2]
685[sdw2] # Hive Libraries
686[sdw2] /usr/lib/hive/lib/antlr-runtime-*[0-9].jar
687[sdw2] /usr/lib/hive/lib/datanucleus-api-jdo-*[0-9].jar
688[sdw2] /usr/lib/hive/lib/datanucleus-core-*[0-9].jar
689[sdw2] /usr/lib/hive/lib/hive-exec.jar
690[sdw2] /usr/lib/hive/lib/hive-metastore.jar
691[sdw2] /usr/lib/hive/lib/jdo-api-*[0-9].jar
692[sdw2] /usr/lib/hive/lib/libfb303-*[0-9].jar
693[sdw2]
694[sdw2] # HBase Libraries
695[sdw2] /usr/lib/hadoop/client/htrace-core.jar
696[sdw2] /usr/lib/hbase/hbase-client.jar
697[sdw2] /usr/lib/hbase/hbase-common.jar
698[sdw2] /usr/lib/hbase/hbase-protocol.jar
699[sdw2] /usr/lib/hbase/lib/htrace-core.jar
700[sdw2] /usr/lib/hbase/lib/netty-*[0-9].Final.jar
701[sdw2] /usr/lib/hbase/lib/metrics-core*.jar
702[sdw2] /usr/lib/zookeeper/zookeeper.jar
703[sdw2] /usr/lib/pxf/mssql-jdbc-6.4.0.jre8.jar
704[sdw2] /usr/lib/pxf/mongodb_unityjdbc_full.jar
705[sdw2] /usr/lib/pxf/mysql-connector-java-5.1.45-bin.jar
706[sdw2] /usr/lib/pxf/ignite-core-2.3.0.jar
707[sdw2] /usr/lib/pxf/commons-compress-1.14.jar
708[sdw2] /usr/lib/pxf/mongo-java-driver-3.6.2.jar
709[sdw2] /usr/lib/pxf/postgresql-42.2.2.jar
710[sdw2] /usr/lib/pxf/ojdbc6.jar
711[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts service pxf status
712[sdw1] Redirecting to /bin/systemctl status pxf.service
713[sdw1] Unit pxf.service could not be found.
714[sdw2] Redirecting to /bin/systemctl status pxf.service
715[sdw2] Unit pxf.service could not be found.
716[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts service pxf-service status
717[sdw2] WARNING: Running as root user
718[sdw2] Checking if tomcat is up and running...
719[sdw2] Checking if PXF webapp is up and running...
720[sdw2] PXF webapp is listening on port 5888
721[sdw1] WARNING: Running as root user
722[sdw1] Checking if tomcat is up and running...
723[sdw1] Checking if PXF webapp is up and running...
724[sdw1] PXF webapp is listening on port 5888
725[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts service pxf-service restart
726[sdw2] WARNING: Running as root user
727[sdw2] Using CATALINA_BASE: /etc/pxf/pxf-service
728[sdw2] Using CATALINA_HOME: /etc/pxf/pxf-service
729[sdw2] Using CATALINA_TMPDIR: /etc/pxf/pxf-service/temp
730[sdw2] Using JRE_HOME: /etc/alternatives/jre
731[sdw2] Using CLASSPATH: /etc/pxf/pxf-service/bin/bootstrap.jar:/etc/pxf/pxf-service/bin/tomcat-juli.jar
732[sdw2] Using CATALINA_PID: /var/run/pxf/catalina.pid
733[sdw2] Feb 28, 2019 11:28:03 AM org.apache.catalina.startup.Catalina stopServer
734[sdw2] SEVERE: No shutdown port configured. Shut down server through OS signal. Server not shut down.
735[sdw2] The stop command failed. Attempting to signal the process to stop through OS signal.
736[sdw2] Tomcat stopped.
737[sdw2] Using CATALINA_BASE: /etc/pxf/pxf-service
738[sdw2] Using CATALINA_HOME: /etc/pxf/pxf-service
739[sdw2] Using CATALINA_TMPDIR: /etc/pxf/pxf-service/temp
740[sdw2] Using JRE_HOME: /etc/alternatives/jre
741[sdw2] Using CLASSPATH: /etc/pxf/pxf-service/bin/bootstrap.jar:/etc/pxf/pxf-service/bin/tomcat-juli.jar
742[sdw2] Using CATALINA_PID: /var/run/pxf/catalina.pid
743[sdw2] Tomcat started.
744[sdw2] Checking if tomcat is up and running...
745[sdw2] tomcat not responding, re-trying after 1 second (attempt number 1)
746[sdw2] Checking if PXF webapp is up and running...
747[sdw2] PXF webapp is listening on port 5888
748[sdw1] WARNING: Running as root user
749[sdw1] Using CATALINA_BASE: /etc/pxf/pxf-service
750[sdw1] Using CATALINA_HOME: /etc/pxf/pxf-service
751[sdw1] Using CATALINA_TMPDIR: /etc/pxf/pxf-service/temp
752[sdw1] Using JRE_HOME: /etc/alternatives/jre
753[sdw1] Using CLASSPATH: /etc/pxf/pxf-service/bin/bootstrap.jar:/etc/pxf/pxf-service/bin/tomcat-juli.jar
754[sdw1] Using CATALINA_PID: /var/run/pxf/catalina.pid
755[sdw1] Feb 28, 2019 11:28:03 AM org.apache.catalina.startup.Catalina stopServer
756[sdw1] SEVERE: No shutdown port configured. Shut down server through OS signal. Server not shut down.
757[sdw1] The stop command failed. Attempting to signal the process to stop through OS signal.
758[sdw1] Tomcat stopped.
759[sdw1] Using CATALINA_BASE: /etc/pxf/pxf-service
760[sdw1] Using CATALINA_HOME: /etc/pxf/pxf-service
761[sdw1] Using CATALINA_TMPDIR: /etc/pxf/pxf-service/temp
762[sdw1] Using JRE_HOME: /etc/alternatives/jre
763[sdw1] Using CLASSPATH: /etc/pxf/pxf-service/bin/bootstrap.jar:/etc/pxf/pxf-service/bin/tomcat-juli.jar
764[sdw1] Using CATALINA_PID: /var/run/pxf/catalina.pid
765[sdw1] Tomcat started.
766[sdw1] Checking if tomcat is up and running...
767[sdw1] tomcat not responding, re-trying after 1 second (attempt number 1)
768[sdw1] Checking if PXF webapp is up and running...
769[sdw1] PXF webapp is listening on port 5888
770[gpadmin@mdw ~]$ exit
771logout
772[root@mdw ~]# /usr/lib/gpdb/
773bin/ doc/ docs/ etc/ include/ lib/ sbin/ share/
774[root@mdw ~]# /usr/lib/gpdb/grenplum_path.sh
775-bash: /usr/lib/gpdb/grenplum_path.sh: No such file or directory
776[root@mdw ~]# /usr/lib/gpdb/greenplum_path.sh
777-bash: /usr/lib/gpdb/greenplum_path.sh: Permission denied
778[root@mdw ~]# source /usr/lib/gpdb/greenplum_path.sh
779[root@mdw ~]# gpssh
780COMMAND NAME: gpssh
781
782Provides ssh access to multiple hosts at once.
783
784
785*****************************************************
786SYNOPSIS
787*****************************************************
788
789gpssh { -f <hostfile_gpssh> | -h <hostname> [-h <hostname> ...] }
790[-u userid] [-s] [-v] [-e] [-d seconds] [-t multiplier] [<bash_command>]
791
792gpssh -?
793
794gpssh --version
795
796
797*****************************************************
798DESCRIPTION
799*****************************************************
800
801The gpssh utility allows you to run bash shell commands on
802multiple hosts at once using SSH (secure shell). You can execute
803a single command by specifying it on the command-line, or omit
804the command to enter into an interactive command-line session.
805
806To specify the hosts involved in the SSH session, use the -f
807option to specify a file containing a list of host names, or use
808the -h option to name single host names on the command-line. At
809least one host name (-h) or a host file (-f) is required. Note that
810the current host is not included in the session by default to
811include the local host, you must explicitly declare it in the
812list of hosts involved in the session.
813
814Before using gpssh, you must have a trusted host setup between
815the hosts involved in the SSH session. You can use the utility
816gpssh-exkeys to update the known host files and exchange public
817keys between hosts if you have not done so already.
818
819If you do not specify a command on the command-line, gpssh will
820go into interactive mode. At the gpssh command prompt (=>), you
821can enter a command as you would in a regular bash terminal command-line,
822and the command will be executed on all hosts involved in the session.
823To end an interactive session, press CTRL+D on the keyboard or type exit.
824
825If a user name is not specified in the host list file, gpssh will
826execute commands as the currently logged in user. To determine the
827currently logged in user, do a whoami command. By default, gpssh goes
828to $HOME of the session user on the remote hosts after login. To ensure
829commands are executed correctly on all remote hosts, you should always
830enter absolute paths.
831
832If you encounter network timeout problems when using gpssh, you can
833use -d and -t options or set parameters in the gpssh.conf file to
834control the timing that gpssh uses when validating the initial ssh
835connection. For information about the configuration file, see gpssh
836Configuration File.
837
838*****************************************************
839OPTIONS
840*****************************************************
841
842<bash_command>
843
844 A bash shell command to execute on all hosts involved in this
845 session (optionally enclosed in quotes). If not specified, gpssh
846 will start an interactive session.
847
848
849-d (delay) seconds
850
851 Optional. Specifies the time, in seconds, to wait at the start of a
852 gpssh interaction with ssh. Default is 0.05. This option overrides the
853 delaybeforesend value that is specified in the gpssh.conf configuration
854 file.
855
856 Increasing this value can cause a long wait time during gpssh startup.
857
858
859-e (echo)
860
861 Optional. Echoes the commands passed to each host and their
862 resulting output while running in non-interactive mode.
863
864
865-f <hostfile_gpssh>
866
867 Specifies the name of a file that contains a list of hosts that
868 will participate in this SSH session. The host name is required.
869 The syntax of the host file is one host per line as follows:
870
871 <hostname>
872
873
874-h <hostname>
875
876 Specifies a single host name that will participate in this SSH session.
877 You can use the -h option multiple times to specify multiple host names.
878
879
880-s
881
882 Optional. If specified, before executing any commands on the target
883 host, gpssh sources the file greenplum_path.sh in the directory
884 specified by the $GPHOME environment variable.
885
886 This option is valid for both interactive mode and single command mode.
887
888
889-t multiplier
890
891 Optional. A decimal number greater than 0 (zero) that is the multiplier
892 for the timeout that gpssh uses when validating the ssh prompt. Default
893 is 1. This option overrides the prompt_validation_timeout value that is
894 specified in the gpssh.conf configuration file.
895
896 Increasing this value has a small impact during gpssh startup.
897
898
899-u <userid>
900
901 Specifies the userid for this SSH session.
902
903
904-v (verbose mode)
905
906 Optional. Reports additional messages in addition to the command
907 output when running in non-interactive mode.
908
909
910--version
911
912 Displays the version of this utility.
913
914
915-? (help)
916
917 Displays the online help.
918
919
920
921
922*****************************************************
923gpssh Configuration File
924*****************************************************
925The gpssh.conf file contains parameters that let you adjust the timing
926that gpssh uses when validating the initial ssh connection. These
927parameters affect the network connection before the gpssh session
928executes commands with ssh. The location of the file is specified by the
929environment variable MASTER_DATA_DIRECTORY. If the environment variable
930is not defined or the gpssh.conf file does not exist in the directory
931gpssh uses the default values or the values set with the -d and -t
932options. For information about the environment variable, see the
933Greenplum Database Reference Guide.
934
935The gpssh.conf file is a text file that consists of a [gpssh] section
936and parameters. On a line, the # (pound sign) indicates the start of a
937comment. This is an example gpssh.conf file.
938
939
940 [gpssh]
941 delaybeforesend = 0.05
942 prompt_validation_timeout = 1.0
943 sync_retries = 3
944
945
946These are the gpssh.conf parameters.
947
948delaybeforesend = seconds
949
950 Specifies the time, in seconds, to wait at the start of a gpssh
951 interaction with ssh. Default is 0.05. Increasing this value can
952 cause a long wait time during gpssh startup. The -d option
953 overrides this parameter.
954
955prompt_validation_timeout = multiplier
956
957 A decimal number greater than 0 (zero) that is the multiplier for the
958 timeout that gpssh uses when validating the ssh prompt. Increasing this
959 value has a small impact during gpssh startup. Default is 1. The -t
960 option overrides this parameter.
961
962sync_retry = attempts
963
964 A non-negative integer that specifies the maximum number of retry attempts
965 that gpssh performs to try connecting to a Greenplum Database remote host. The
966 default is 3. If the value is 0, gpssh returns an error if the initial
967 connection attempt fails. This parameter cannot be configured with a
968 command-line option.
969
970 Increasing this value compensates for slow network performance or performance
971 issues such as heavy CPU or I/O load on the segment host. However, when a
972 connection cannot be established, an increased value also increases the delay
973 when an error is returned.
974
975
976
977
978*****************************************************
979EXAMPLES
980*****************************************************
981
982Start an interactive group SSH session with all hosts listed
983in the file hostfile_gpssh:
984
985 $ gpssh -f hostfile_gpssh
986
987
988At the gpssh interactive command prompt, run a shell command
989on all the hosts involved in this session.
990
991 => ls -a /data/primary/*
992
993Exit an interactive session:
994
995 => exit
996
997
998Start a non-interactive group SSH session with the hosts named
999sdw1 and sdw2 and pass a file containing several commands
1000named command_file to gpssh:
1001
1002 $ gpssh -h sdw1 -h sdw2 -v -e < command_file
1003
1004
1005Execute single commands in non-interactive mode on hosts
1006sdw2 and localhost:
1007
1008 $ gpssh -h sdw2 -h localhost -v -e 'ls -a /data/primary/*'
1009
1010 $ gpssh -h sdw2 -h localhost -v -e 'echo $GPHOME'
1011
1012 $ gpssh -h sdw2 -h localhost -v -e 'ls -1 | wc -l'
1013
1014
1015*****************************************************
1016SEE ALSO
1017*****************************************************
1018
1019gpssh-exkeys, gpscp
1020
1021Error: please specify at least one of -h or -f args, but not both
1022[root@mdw ~]# /usr/lib/gpdb/bin/gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts ls
1023[sdw2] anaconda-ks.cfg
1024[sdw1] anaconda-ks.cfg
1025[root@mdw ~]# su - gpadmin
1026Last login: Thu Feb 28 11:23:37 MSK 2019 on pts/1
1027[gpadmin@mdw ~]$ insert into table11 select gen, gen, 'text' || gen::text, now() from generate_series(1, 4000000) gen;
1028-bash: syntax error near unexpected token `('
1029[gpadmin@mdw ~]$ psql adb
1030psql (8.3.23)
1031Type "help" for help.
1032
1033adb=# insert into table11 select gen, gen, 'text' || gen::text, now() from generate_series(1, 4000000) gen;
1034INSERT 0 4000000
1035adb=# create external table table_11_pxf_read (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table11?PROFILE=Jdbc&JDBC_DRIVEql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_import');
1036CREATE EXTERNAL TABLE
1037adb=# select * from table table_11_pxf_read;
1038ERROR: syntax error at or near "table"
1039LINE 1: select * from table table_11_pxf_read;
1040 ^
1041adb=# select * from table_11_pxf_read;
1042ERROR: remote component error (500) from '127.0.0.1:5888': type Exception report message FATAL: no pg_hba.conf entry for host "10.2.57.4", user &qot;, database "adb", SSL off description The server encountered an internal error that prevented it from fulfilling this request. exception javon: FATAL: no pg_hba.conf entry for host "10.2.57.4", user "gpadmin", database "adb", SSL off (libchurl.c:944) (seg3 slice1 10.2.57.257) (cdbdisp.c:254)
1043DETAIL: External table table_11_pxf_read
1044adb=# select * from table_11_pxf_read;
1045ERROR: remote component error (500) from '127.0.0.1:5888': type Exception report message FATAL: no pg_hba.conf entry for host "10.2.57.4", user &qot;, database "adb", SSL off description The server encountered an internal error that prevented it from fulfilling this request. exception javon: FATAL: no pg_hba.conf entry for host "10.2.57.4", user "gpadmin", database "adb", SSL off (libchurl.c:944) (seg2 slice1 10.2.57.294) (cdbdisp.c:254)
1046DETAIL: External table table_11_pxf_read
1047adb=# \q
1048[gpadmin@mdw ~]$ vi
1049.ansible/ .bash_history .bash_profile gpAdminLogs/ .gshist .pgpass .psql_history .viminfo
1050arenadata_configs/ .bash_logout .bashrc .gphostcache .lesshst .pgpass.1550490837 .ssh/
1051[gpadmin@mdw ~]$ vi /data1/master/gpseg-1/
1052base/ gpssh.conf pg_log/ PG_VERSION
1053db_analyze/ pg_changetracking/ pg_multixact/ pg_xlog/
1054global/ pg_clog/ pg_stat_tmp/ plcontainer_configuration.xml
1055gpbackup_history.yaml pg_distributedlog/ pg_subtrans/ postgresql.conf
1056gp_dbid pg_distributedxidmap/ pg_tblspc/ postgresql.conf.bak
1057gpperfmon/ pg_hba.conf pg_twophase/ postmaster.opts
1058gp_restore_status_-1_1_20190227160658 pg_ident.conf pg_utilitymodedtmredo/ postmaster.pid
1059[gpadmin@mdw ~]$ vi /data1/master/gpseg-1/pg_hba.conf
1060[gpadmin@mdw ~]$ gpstop -u
106120190228:11:59:28:126665 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -u
106220190228:11:59:28:126665 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
106320190228:11:59:28:126665 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
106420190228:11:59:28:126665 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
106520190228:11:59:28:126665 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 5.13.0 build 5.13.0_arenadata4-253.el7'
106620190228:11:59:28:126665 gpstop:mdw:gpadmin-[INFO]:-Signalling all postmaster processes to reload
1067.
1068[gpadmin@mdw ~]$ psql adb
1069psql (8.3.23)
1070Type "help" for help.
1071
1072adb=# select * from table_11_pxf_read;
1073ERROR: remote component error (500) from '127.0.0.1:5888': type Exception report message FATAL: no pg_hba.conf entry for host "10.2.57.4", user &qot;, database "adb", SSL off description The server encountered an internal error that prevented it from fulfilling this request. exception javon: FATAL: no pg_hba.conf entry for host "10.2.57.4", user "gpadmin", database "adb", SSL off (libchurl.c:944) (seg3 slice1 10.2.57.455) (cdbdisp.c:254)
1074DETAIL: External table table_11_pxf_read
1075adb=# \q
1076[gpadmin@mdw ~]$ vi /data1/master/gpseg-1/pg_hba.conf
1077[gpadmin@mdw ~]$ vi /data1/master/gpseg-1/pg_hba.conf
1078[gpadmin@mdw ~]$ gpstop -u
107920190228:12:01:50:127352 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -u
108020190228:12:01:50:127352 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
108120190228:12:01:50:127352 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
108220190228:12:01:50:127352 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
108320190228:12:01:50:127352 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 5.13.0 build 5.13.0_arenadata4-253.el7'
108420190228:12:01:50:127352 gpstop:mdw:gpadmin-[INFO]:-Signalling all postmaster processes to reload
1085.
1086[gpadmin@mdw ~]$ psql adb
1087psql (8.3.23)
1088Type "help" for help.
1089
1090adb=# select * from table_11_pxf_read;
1091 id1 | id2 | gen | now
1092---------+---------+-------------+----------------------------
1093 2 | 2 | text2 | 2019-02-28 11:33:09.946684
1094 6 | 6 | text6 | 2019-02-28 11:33:09.946684
1095 10 | 10 | text10 | 2019-02-28 11:33:09.946684
1096 14 | 14 | text14 | 2019-02-28 11:33:09.946684
1097 18 | 18 | text18 | 2019-02-28 11:33:09.946684
1098 22 | 22 | text22 | 2019-02-28 11:33:09.946684
1099 26 | 26 | text26 | 2019-02-28 11:33:09.946684
1100 30 | 30 | text30 | 2019-02-28 11:33:09.946684
1101 34 | 34 | text34 | 2019-02-28 11:33:09.946684
1102 38 | 38 | text38 | 2019-02-28 11:33:09.946684
1103 42 | 42 | text42 | 2019-02-28 11:33:09.946684
1104 46 | 46 | text46 | 2019-02-28 11:33:09.946684
1105 50 | 50 | text50 | 2019-02-28 11:33:09.946684
1106 54 | 54 | text54 | 2019-02-28 11:33:09.946684
1107 58 | 58 | text58 | 2019-02-28 11:33:09.946684
1108 62 | 62 | text62 | 2019-02-28 11:33:09.946684
1109 66 | 66 | text66 | 2019-02-28 11:33:09.946684
1110 70 | 70 | text70 | 2019-02-28 11:33:09.946684
1111 74 | 74 | text74 | 2019-02-28 11:33:09.946684
1112 78 | 78 | text78 | 2019-02-28 11:33:09.946684
1113 82 | 82 | text82 | 2019-02-28 11:33:09.946684
1114 86 | 86 | text86 | 2019-02-28 11:33:09.946684
1115 90 | 90 | text90 | 2019-02-28 11:33:09.946684
1116 94 | 94 | text94 | 2019-02-28 11:33:09.946684
1117 98 | 98 | text98 | 2019-02-28 11:33:09.946684
1118 102 | 102 | text102 | 2019-02-28 11:33:09.946684
1119 106 | 106 | text106 | 2019-02-28 11:33:09.946684
1120 110 | 110 | text110 | 2019-02-28 11:33:09.946684
1121 114 | 114 | text114 | 2019-02-28 11:33:09.946684
1122 118 | 118 | text118 | 2019-02-28 11:33:09.946684
1123 122 | 122 | text122 | 2019-02-28 11:33:09.946684
1124 126 | 126 | text126 | 2019-02-28 11:33:09.946684
1125 130 | 130 | text130 | 2019-02-28 11:33:09.946684
1126 134 | 134 | text134 | 2019-02-28 11:33:09.946684
1127 138 | 138 | text138 | 2019-02-28 11:33:09.946684
1128 142 | 142 | text142 | 2019-02-28 11:33:09.946684
1129 146 | 146 | text146 | 2019-02-28 11:33:09.946684
1130 150 | 150 | text150 | 2019-02-28 11:33:09.946684
1131 154 | 154 | text154 | 2019-02-28 11:33:09.946684
1132 158 | 158 | text158 | 2019-02-28 11:33:09.946684
1133 162 | 162 | text162 | 2019-02-28 11:33:09.946684
1134 166 | 166 | text166 | 2019-02-28 11:33:09.946684
1135 170 | 170 | text170 | 2019-02-28 11:33:09.946684
1136 174 | 174 | text174 | 2019-02-28 11:33:09.946684
1137 178 | 178 | text178 | 2019-02-28 11:33:09.946684
1138 182 | 182 | text182 | 2019-02-28 11:33:09.946684
1139 186 | 186 | text186 | 2019-02-28 11:33:09.946684
1140 190 | 190 | text190 | 2019-02-28 11:33:09.946684
1141 194 | 194 | text194 | 2019-02-28 11:33:09.946684
1142adb=# select * from table_11_pxf_read limit 10;
1143 id1 | id2 | gen | now
1144-----+-----+--------+----------------------------
1145 2 | 2 | text2 | 2019-02-28 11:33:09.946684
1146 6 | 6 | text6 | 2019-02-28 11:33:09.946684
1147 10 | 10 | text10 | 2019-02-28 11:33:09.946684
1148 14 | 14 | text14 | 2019-02-28 11:33:09.946684
1149 18 | 18 | text18 | 2019-02-28 11:33:09.946684
1150 22 | 22 | text22 | 2019-02-28 11:33:09.946684
1151 26 | 26 | text26 | 2019-02-28 11:33:09.946684
1152 30 | 30 | text30 | 2019-02-28 11:33:09.946684
1153 34 | 34 | text34 | 2019-02-28 11:33:09.946684
1154 38 | 38 | text38 | 2019-02-28 11:33:09.946684
1155(10 rows)
1156
1157adb=# select count(1) from table_11_pxf_read limit 10;
1158 count
1159---------
1160 4000000
1161(1 row)
1162
1163adb=# explain analyze select count(1) from table_11_pxf_read limit 10;
1164 QUERY PLAN
1165------------------------------------------------------------------------------------------------------
1166 Limit (cost=0.00..438.89 rows=1 width=8)
1167 Rows out: 1 rows with 20930 ms to end.
1168 -> Aggregate (cost=0.00..438.89 rows=1 width=8)
1169 Rows out: 1 rows with 20930 ms to end.
1170 -> Gather Motion 4:1 (slice1; segments: 4) (cost=0.00..438.89 rows=1 width=8)
1171 Rows out: 4 rows at destination with 7.147 ms to first row, 20930 ms to end.
1172 -> Aggregate (cost=0.00..438.89 rows=1 width=8)
1173 Rows out: Avg 1.0 rows x 4 workers. Max 1 rows (seg0) with 20929 ms to end.
1174 -> External Scan on table_11_pxf_read (cost=0.00..438.43 rows=250000 width=1)
1175 Rows out: 4000000 rows (seg0) with 6647 ms to first row, 18548 ms to end.
1176 Slice statistics:
1177 (slice0) Executor memory: 386K bytes.
1178 (slice1) Executor memory: 241K bytes avg x 4 workers, 323K bytes max (seg0).
1179 Statement statistics:
1180 Memory used: 32768K bytes
1181 Settings: optimizer=on
1182 Optimizer status: PQO version 3.9.0
1183 Total runtime: 20933.281 ms
1184(18 rows)
1185
1186adb=# create external table table_11_pxf_read_parallel (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table11?PROFILE=Jdbc&J.postgresql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&PARTITION_BY=id1:int&RANGE=1:400000&INTERVAL=500000') FORMAT 'CUSTOM' (FORMATTER='pxfwritable
1187CREATE EXTERNAL TABLE
1188adb=# explain analyze select count(1) from table_11_pxf_read_parallel limit 10; QUERY PLAN
1189--------------------------------------------------------------------------------------------------------------
1190 Limit (cost=0.00..438.89 rows=1 width=8)
1191 Rows out: 1 rows with 2017 ms to end.
1192 -> Aggregate (cost=0.00..438.89 rows=1 width=8)
1193 Rows out: 1 rows with 2017 ms to end.
1194 -> Gather Motion 4:1 (slice1; segments: 4) (cost=0.00..438.89 rows=1 width=8)
1195 Rows out: 4 rows at destination with 18 ms to first row, 2017 ms to end.
1196 -> Aggregate (cost=0.00..438.89 rows=1 width=8)
1197 Rows out: Avg 1.0 rows x 4 workers. Max 1 rows (seg0) with 16 ms to end.
1198 -> External Scan on table_11_pxf_read_parallel (cost=0.00..438.43 rows=250000 width=1)
1199 Rows out: 399999 rows (seg2) with 684 ms to first row, 1965 ms to end.
1200 Slice statistics:
1201 (slice0) Executor memory: 386K bytes.
1202 (slice1) Executor memory: 241K bytes avg x 4 workers, 323K bytes max (seg2).
1203 Statement statistics:
1204 Memory used: 32768K bytes
1205 Settings: optimizer=on
1206 Optimizer status: PQO version 3.9.0
1207 Total runtime: 2020.967 ms
1208(18 rows)
1209
1210adb=# explain analyze select count(1) from table_11_pxf_read_parallel;
1211 QUERY PLAN
1212--------------------------------------------------------------------------------------------------------
1213 Aggregate (cost=0.00..438.89 rows=1 width=8)
1214 Rows out: 1 rows with 1934 ms to end.
1215 -> Gather Motion 4:1 (slice1; segments: 4) (cost=0.00..438.89 rows=1 width=8)
1216 Rows out: 4 rows at destination with 11 ms to first row, 1934 ms to end.
1217 -> Aggregate (cost=0.00..438.89 rows=1 width=8)
1218 Rows out: Avg 1.0 rows x 4 workers. Max 1 rows (seg0) with 10 ms to end.
1219 -> External Scan on table_11_pxf_read_parallel (cost=0.00..438.43 rows=250000 width=1)
1220 Rows out: 399999 rows (seg2) with 642 ms to first row, 1889 ms to end.
1221 Slice statistics:
1222 (slice0) Executor memory: 386K bytes.
1223 (slice1) Executor memory: 273K bytes avg x 4 workers, 355K bytes max (seg2).
1224 Statement statistics:
1225 Memory used: 32768K bytes
1226 Settings: optimizer=on
1227 Optimizer status: PQO version 3.9.0
1228 Total runtime: 1945.930 ms
1229(16 rows)
1230
1231adb=# explain analyze select count(1) from table_11_pxf_read_parallel;
1232 QUERY PLAN
1233--------------------------------------------------------------------------------------------------------
1234 Aggregate (cost=0.00..438.89 rows=1 width=8)
1235 Rows out: 1 rows with 2320 ms to end.
1236 -> Gather Motion 4:1 (slice1; segments: 4) (cost=0.00..438.89 rows=1 width=8)
1237 Rows out: 4 rows at destination with 10 ms to first row, 2319 ms to end.
1238 -> Aggregate (cost=0.00..438.89 rows=1 width=8)
1239 Rows out: Avg 1.0 rows x 4 workers. Max 1 rows (seg0) with 2317 ms to end.
1240 -> External Scan on table_11_pxf_read_parallel (cost=0.00..438.43 rows=250000 width=1)
1241 Rows out: 399999 rows (seg0) with 673 ms to first row, 2063 ms to end.
1242 Slice statistics:
1243 (slice0) Executor memory: 386K bytes.
1244 (slice1) Executor memory: 273K bytes avg x 4 workers, 355K bytes max (seg0).
1245 Statement statistics:
1246 Memory used: 32768K bytes
1247 Settings: optimizer=on
1248 Optimizer status: PQO version 3.9.0
1249 Total runtime: 2329.321 ms
1250(16 rows)
1251
1252adb=# create external table table_11_pxf_read_parallel (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table11?PROFILE=Jdbc&J.postgresql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&PARTITION_BY=id1:int&RANGE=0:400000&INTERVAL=50000') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_
1253ERROR: relation "table_11_pxf_read_parallel" already exists
1254adb=# drop table table_11_pxf_read_parallel;
1255ERROR: "table_11_pxf_read_parallel" is not a base table
1256HINT: Use DROP EXTERNAL TABLE to remove an external table
1257adb=# drop external table table_11_pxf_read_parallel;
1258DROP EXTERNAL TABLE
1259adb=# create external table table_11_pxf_read_parallel (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table11?PROFILE=Jdbc&J.postgresql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&PARTITION_BY=id1:int&RANGE=0:400000&INTERVAL=50000') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_
1260CREATE EXTERNAL TABLE
1261adb=# explain analyze select count(1) from table_11_pxf_read_parallel; QUERY PLAN
1262--------------------------------------------------------------------------------------------------------------------------------
1263 Aggregate (cost=0.00..438.89 rows=1 width=8)
1264 Rows out: 1 rows with 2699 ms to end.
1265 -> Gather Motion 4:1 (slice1; segments: 4) (cost=0.00..438.89 rows=1 width=8)
1266 Rows out: 4 rows at destination with 2529 ms to first row, 2699 ms to end.
1267 -> Aggregate (cost=0.00..438.89 rows=1 width=8)
1268 Rows out: Avg 1.0 rows x 4 workers. Max 1 rows (seg0) with 2696 ms to end.
1269 -> External Scan on table_11_pxf_read_parallel (cost=0.00..438.43 rows=250000 width=1)
1270 Rows out: Avg 99999.8 rows x 4 workers. Max 100000 rows (seg1) with 994 ms to first row, 2498 ms to end.
1271 Slice statistics:
1272 (slice0) Executor memory: 386K bytes.
1273 (slice1) Executor memory: 323K bytes avg x 4 workers, 323K bytes max (seg0).
1274 Statement statistics:
1275 Memory used: 32768K bytes
1276 Settings: optimizer=on
1277 Optimizer status: PQO version 3.9.0
1278 Total runtime: 2700.969 ms
1279(16 rows)
1280
1281adb=# create external table table_12_pxf_write (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table12?PROFILE=Jdbc&JDBC_DRIVsql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&BATCH_SIZE=25&POOL_SIZE=2') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_export');
1282CREATE EXTERNAL TABLE
1283adb=# explain analyze select count(1) from table_12_pxf_write; ERROR: formatter function pxfwritable_export of type readable was not found.
1284HINT: Create it with CREATE FUNCTION.
1285adb=# drop external table table_12_pxf_write;
1286DROP EXTERNAL TABLE
1287adb=# create external table table_12_pxf_write (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table12?PROFILE=Jdbc&JDBC_DRIVsql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&BATCH_SIZE=25&POOL_SIZE=2') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_export');
1288CREATE EXTERNAL TABLE
1289adb=# drop external table table_12_pxf_write;
1290DROP EXTERNAL TABLE
1291adb=# create external table table_12_pxf_write (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table12?PROFILE=Jdbc&JDBC_DRIVsql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&BATCH_SIZE=25&POOL_SIZE=2') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_import');
1292CREATE EXTERNAL TABLE
1293adb=# explain analyze select count(1) from table_11_pxf_read_parallel; QUERY PLAN
1294---------------------------------------------------------------------------------------------------------------------------------
1295 Aggregate (cost=0.00..438.89 rows=1 width=8)
1296 Rows out: 1 rows with 2602 ms to end.
1297 -> Gather Motion 4:1 (slice1; segments: 4) (cost=0.00..438.89 rows=1 width=8)
1298 Rows out: 4 rows at destination with 2469 ms to first row, 2602 ms to end.
1299 -> Aggregate (cost=0.00..438.89 rows=1 width=8)
1300 Rows out: Avg 1.0 rows x 4 workers. Max 1 rows (seg0) with 2580 ms to end.
1301 -> External Scan on table_11_pxf_read_parallel (cost=0.00..438.43 rows=250000 width=1)
1302 Rows out: Avg 99999.8 rows x 4 workers. Max 100000 rows (seg1) with 1013 ms to first row, 2407 ms to end.
1303 Slice statistics:
1304 (slice0) Executor memory: 386K bytes.
1305 (slice1) Executor memory: 323K bytes avg x 4 workers, 323K bytes max (seg0).
1306 Statement statistics:
1307 Memory used: 32768K bytes
1308 Settings: optimizer=on
1309 Optimizer status: PQO version 3.9.0
1310 Total runtime: 2605.598 ms
1311(16 rows)
1312
1313adb=# explain analyze insert into table_12_pxf_write select * from table11 limit 100;
1314ERROR: cannot change a readable external table "table_12_pxf_write"
1315adb=# create external writable table table_12_pxf_write (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table12?PROFILE=Jdbc&g.postgresql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&BATCH_SIZE=25&POOL_SIZE=2') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_import');
1316ERROR: syntax error at or near "writable"
1317LINE 1: create external writable table table_12_pxf_write (id1 int, ...
1318 ^
1319adb=# create writable external table table_12_pxf_write (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table12?PROFILE=Jdbc&g.postgresql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&BATCH_SIZE=25&POOL_SIZE=2') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_import');
1320ERROR: relation "table_12_pxf_write" already exists
1321adb=# drop external table table_12_pxf_write;
1322DROP EXTERNAL TABLE
1323adb=# create writable external table table_12_pxf_write (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table12?PROFILE=Jdbc&g.postgresql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&BATCH_SIZE=25&POOL_SIZE=2') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_import');
1324CREATE EXTERNAL TABLE
1325adb=# explain analyze insert into table_12_pxf_write select * from table11 limit 100; NOTICE: formatter function pxfwritable_import of type writable was not found. (seg2 10.2.57.4:20000 pid=34326)
1326adb=# drop external table table_12_pxf_write;
1327DROP EXTERNAL TABLE
1328adb=# create writable external table table_12_pxf_write (id1 int, id2 int, gen text, now timestamp without time zone) location ('pxf://public.table12?PROFILE=Jdbc&g.postgresql.Driver&DB_URL=jdbc:postgresql://mdw:5432/adb&USER=gpadmin&BATCH_SIZE=25&POOL_SIZE=2') FORMAT 'CUSTOM' (FORMATTER='pxfwritable_export');
1329CREATE EXTERNAL TABLE
1330adb=# explain analyze insert into table_12_pxf_write select * from table11 limit 100;
1331 QUERY PLAN
1332------------------------------------------------------------------------------------------------------------------------------------------
1333 Insert (cost=0.00..431.03 rows=1 width=24)
1334 Rows out: Avg 25.0 rows x 4 workers. Max 26 rows (seg1) with 5.927 ms to first row, 52 ms to end.
1335 Executor memory: 1K bytes avg, 1K bytes max (seg0).
1336 -> Result (cost=0.00..431.00 rows=1 width=28)
1337 Rows out: Avg 25.0 rows x 4 workers. Max 26 rows (seg1) with 3.892 ms to first row, 3.945 ms to end.
1338 -> Redistribute Motion 1:4 (slice2; segments: 1) (cost=0.00..431.00 rows=1 width=24)
1339 Rows out: Avg 25.0 rows x 4 workers at destination. Max 26 rows (seg1) with 3.882 ms to first row, 3.901 ms to end.
1340 -> Limit (cost=0.00..431.00 rows=1 width=24)
1341 Rows out: 100 rows with 0.048 ms to first row, 0.285 ms to end.
1342 -> Gather Motion 4:1 (slice1; segments: 4) (cost=0.00..431.00 rows=1 width=24)
1343 Rows out: 100 rows at destination with 0.040 ms to first row, 0.091 ms to end.
1344 -> Table Scan on table11 (cost=0.00..431.00 rows=1 width=24)
1345 Rows out: Avg 600.0 rows x 4 workers. Max 922 rows (seg0) with 0.842 ms to first row, 1.368 ms to end.
1346 Slice statistics:
1347 (slice0) Executor memory: 253K bytes avg x 4 workers, 253K bytes max (seg0).
1348 (slice1) Executor memory: 709K bytes avg x 4 workers, 709K bytes max (seg0).
1349 (slice2) Executor memory: 239K bytes (seg0).
1350 Statement statistics:
1351 Memory used: 32768K bytes
1352 Settings: optimizer=on
1353 Optimizer status: PQO version 3.9.0
1354 Total runtime: 9607.139 ms
1355(22 rows)
1356
1357adb=# \q
1358[gpadmin@mdw ~]$ gpssh -f /home/adb_
1359adb_monitoring/ adb_zeppelin/
1360[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/
1361.ansible/ .bash_history .bash_profile gpAdminLogs/ .gshist .pgpass .psql_history .viminfo
1362arenadata_configs/ .bash_logout .bashrc .gphostcache .lesshst .pgpass.1550490837 .ssh/
1363[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/
1364.ansible/ .bash_history .bash_profile gpAdminLogs/ .gshist .pgpass .psql_history .viminfo
1365arenadata_configs/ .bash_logout .bashrc .gphostcache .lesshst .pgpass.1550490837 .ssh/
1366[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/
1367arenadata_all_hosts.hosts collect_table_stats.log db_datfrozenxid_alerter.sh operation.sh system_db.sh
1368arenadata_segment_hosts.hosts collect_table_stats.sql gzip_pg_log.log operation_vacuum.log test_database.sh
1369arenadata_segments_monitor.log crontab.txt gzip_pg_log.sql run_sql.sh vacuum_catalog_tables.log
1370arenadata_segments_monitor.sh database init_config.conf run_sql_to_gpssh.sh vacuum_catalog_tables.sql
1371arenadata_toolkit_create.sql db_datfrozenxid_alerter.log operation_analyze.log system_db.log
1372[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/
1373arenadata_all_hosts.hosts collect_table_stats.log db_datfrozenxid_alerter.sh operation.sh system_db.sh
1374arenadata_segment_hosts.hosts collect_table_stats.sql gzip_pg_log.log operation_vacuum.log test_database.sh
1375arenadata_segments_monitor.log crontab.txt gzip_pg_log.sql run_sql.sh vacuum_catalog_tables.log
1376arenadata_segments_monitor.sh database init_config.conf run_sql_to_gpssh.sh vacuum_catalog_tables.sql
1377arenadata_toolkit_create.sql db_datfrozenxid_alerter.log operation_analyze.log system_db.log
1378[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/
1379arenadata_all_hosts.hosts collect_table_stats.log db_datfrozenxid_alerter.sh operation.sh system_db.sh
1380arenadata_segment_hosts.hosts collect_table_stats.sql gzip_pg_log.log operation_vacuum.log test_database.sh
1381arenadata_segments_monitor.log crontab.txt gzip_pg_log.sql run_sql.sh vacuum_catalog_tables.log
1382arenadata_segments_monitor.sh database init_config.conf run_sql_to_gpssh.sh vacuum_catalog_tables.sql
1383arenadata_toolkit_create.sql db_datfrozenxid_alerter.log operation_analyze.log system_db.log
1384[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment
1385arenadata_segment_hosts.hosts arenadata_segments_monitor.log arenadata_segments_monitor.sh
1386[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts ls /
1387[sdw2] bin data1 etc lib media opt root sbin sys usr
1388[sdw2] boot dev home lib64 mnt proc run srv tmp var
1389[sdw1] bin data1 etc lib media opt root sbin sys usr
1390[sdw1] boot dev home lib64 mnt proc run srv tmp var
1391[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts ls -l /
1392[sdw1] total 32
1393[sdw1] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 bin -> usr/bin
1394[sdw1] dr-xr-xr-x. 5 root root 4096 Sep 12 18:03 boot
1395[sdw1] drwxr-xr-x. 4 gpadmin gpadmin 33 Feb 18 14:08 data1
1396[sdw1] drwxr-xr-x 19 root root 3180 Feb 22 13:22 dev
1397[sdw1] drwxr-xr-x. 98 root root 8192 Feb 22 13:22 etc
1398[sdw1] drwxr-xr-x. 4 root root 34 Feb 18 14:07 home
1399[sdw1] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 lib -> usr/lib
1400[sdw1] lrwxrwxrwx. 1 root root 9 Sep 12 17:47 lib64 -> usr/lib64
1401[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 media
1402[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
1403[sdw1] drwxr-xr-x. 5 root root 95 Feb 18 15:05 opt
1404[sdw1] dr-xr-xr-x 173 root root 0 Feb 22 13:21 proc
1405[sdw1] dr-xr-x---. 9 root root 4096 Feb 18 14:05 root
1406[sdw1] drwxr-xr-x 29 root root 900 Feb 27 12:56 run
1407[sdw1] lrwxrwxrwx. 1 root root 8 Sep 12 17:47 sbin -> usr/sbin
1408[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
1409[sdw1] dr-xr-xr-x 13 root root 0 Feb 22 13:22 sys
1410[sdw1] drwxrwxrwt. 33 root root 4096 Feb 28 03:33 tmp
1411[sdw1] drwxr-xr-x. 13 root root 4096 Sep 12 17:47 usr
1412[sdw1] drwxr-xr-x. 20 root root 4096 Sep 12 17:47 var
1413[sdw2] total 32
1414[sdw2] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 bin -> usr/bin
1415[sdw2] dr-xr-xr-x. 5 root root 4096 Sep 12 18:03 boot
1416[sdw2] drwxr-xr-x. 4 gpadmin gpadmin 33 Feb 18 14:08 data1
1417[sdw2] drwxr-xr-x 19 root root 3180 Feb 22 13:22 dev
1418[sdw2] drwxr-xr-x. 98 root root 8192 Feb 22 13:22 etc
1419[sdw2] drwxr-xr-x. 4 root root 34 Feb 18 14:07 home
1420[sdw2] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 lib -> usr/lib
1421[sdw2] lrwxrwxrwx. 1 root root 9 Sep 12 17:47 lib64 -> usr/lib64
1422[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 media
1423[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
1424[sdw2] drwxr-xr-x. 5 root root 95 Feb 18 15:05 opt
1425[sdw2] dr-xr-xr-x 172 root root 0 Feb 22 13:21 proc
1426[sdw2] dr-xr-x---. 9 root root 4096 Feb 18 14:05 root
1427[sdw2] drwxr-xr-x 29 root root 900 Feb 27 12:56 run
1428[sdw2] lrwxrwxrwx. 1 root root 8 Sep 12 17:47 sbin -> usr/sbin
1429[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
1430[sdw2] dr-xr-xr-x 13 root root 0 Feb 22 13:22 sys
1431[sdw2] drwxrwxrwt. 30 root root 4096 Feb 28 03:08 tmp
1432[sdw2] drwxr-xr-x. 13 root root 4096 Sep 12 17:47 usr
1433[sdw2] drwxr-xr-x. 20 root root 4096 Sep 12 17:47 var
1434[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts mkdir data2
1435[sdw1]
1436[sdw2]
1437[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts df -h
1438[sdw1] Filesystem Size Used Avail Use% Mounted on
1439[sdw1] /dev/mapper/centos-root 48G 12G 36G 25% /
1440[sdw1] devtmpfs 12G 0 12G 0% /dev
1441[sdw1] tmpfs 12G 0 12G 0% /dev/shm
1442[sdw1] tmpfs 12G 20M 12G 1% /run
1443[sdw1] tmpfs 12G 0 12G 0% /sys/fs/cgroup
1444[sdw1] /dev/sda1 497M 281M 216M 57% /boot
1445[sdw1] tmpfs 2.4G 0 2.4G 0% /run/user/2042
1446[sdw1] tmpfs 2.4G 0 2.4G 0% /run/user/0
1447[sdw2] Filesystem Size Used Avail Use% Mounted on
1448[sdw2] /dev/mapper/centos-root 48G 12G 36G 25% /
1449[sdw2] devtmpfs 12G 0 12G 0% /dev
1450[sdw2] tmpfs 12G 0 12G 0% /dev/shm
1451[sdw2] tmpfs 12G 20M 12G 1% /run
1452[sdw2] tmpfs 12G 0 12G 0% /sys/fs/cgroup
1453[sdw2] /dev/sda1 497M 281M 216M 57% /boot
1454[sdw2] tmpfs 2.4G 0 2.4G 0% /run/user/2042
1455[sdw2] tmpfs 2.4G 0 2.4G 0% /run/user/0
1456[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts chown gpadmin:gpadmin /data2
1457[sdw2] chown: cannot access ‘/data2’: No such file or directory
1458[sdw1] chown: cannot access ‘/data2’: No such file or directory
1459[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts ls -l /
1460[sdw2] total 32
1461[sdw2] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 bin -> usr/bin
1462[sdw2] dr-xr-xr-x. 5 root root 4096 Sep 12 18:03 boot
1463[sdw2] drwxr-xr-x. 4 gpadmin gpadmin 33 Feb 18 14:08 data1
1464[sdw2] drwxr-xr-x 19 root root 3180 Feb 22 13:22 dev
1465[sdw2] drwxr-xr-x. 98 root root 8192 Feb 22 13:22 etc
1466[sdw2] drwxr-xr-x. 4 root root 34 Feb 18 14:07 home
1467[sdw2] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 lib -> usr/lib
1468[sdw2] lrwxrwxrwx. 1 root root 9 Sep 12 17:47 lib64 -> usr/lib64
1469[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 media
1470[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
1471[sdw2] drwxr-xr-x. 5 root root 95 Feb 18 15:05 opt
1472[sdw2] dr-xr-xr-x 172 root root 0 Feb 22 13:21 proc
1473[sdw2] dr-xr-x---. 10 root root 4096 Feb 28 12:37 root
1474[sdw2] drwxr-xr-x 29 root root 900 Feb 27 12:56 run
1475[sdw2] lrwxrwxrwx. 1 root root 8 Sep 12 17:47 sbin -> usr/sbin
1476[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
1477[sdw2] dr-xr-xr-x 13 root root 0 Feb 28 12:36 sys
1478[sdw2] drwxrwxrwt. 30 root root 4096 Feb 28 03:08 tmp
1479[sdw2] drwxr-xr-x. 13 root root 4096 Sep 12 17:47 usr
1480[sdw2] drwxr-xr-x. 20 root root 4096 Sep 12 17:47 var
1481[sdw1] total 32
1482[sdw1] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 bin -> usr/bin
1483[sdw1] dr-xr-xr-x. 5 root root 4096 Sep 12 18:03 boot
1484[sdw1] drwxr-xr-x. 4 gpadmin gpadmin 33 Feb 18 14:08 data1
1485[sdw1] drwxr-xr-x 19 root root 3180 Feb 22 13:22 dev
1486[sdw1] drwxr-xr-x. 98 root root 8192 Feb 22 13:22 etc
1487[sdw1] drwxr-xr-x. 4 root root 34 Feb 18 14:07 home
1488[sdw1] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 lib -> usr/lib
1489[sdw1] lrwxrwxrwx. 1 root root 9 Sep 12 17:47 lib64 -> usr/lib64
1490[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 media
1491[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
1492[sdw1] drwxr-xr-x. 5 root root 95 Feb 18 15:05 opt
1493[sdw1] dr-xr-xr-x 173 root root 0 Feb 22 13:21 proc
1494[sdw1] dr-xr-x---. 10 root root 4096 Feb 28 12:37 root
1495[sdw1] drwxr-xr-x 29 root root 900 Feb 27 12:56 run
1496[sdw1] lrwxrwxrwx. 1 root root 8 Sep 12 17:47 sbin -> usr/sbin
1497[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
1498[sdw1] dr-xr-xr-x 13 root root 0 Feb 28 12:36 sys
1499[sdw1] drwxrwxrwt. 33 root root 4096 Feb 28 03:33 tmp
1500[sdw1] drwxr-xr-x. 13 root root 4096 Sep 12 17:47 usr
1501[sdw1] drwxr-xr-x. 20 root root 4096 Sep 12 17:47 var
1502[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts mkdir data2
1503[sdw2] mkdir: cannot create directory ‘data2’: File exists
1504[sdw1] mkdir: cannot create directory ‘data2’: File exists
1505[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts mkdir /data2
1506[sdw1]
1507[sdw2]
1508[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts chown gpadmin:gpadmin /data2
1509[sdw1]
1510[sdw2]
1511[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts ls -l /
1512[sdw2] total 32
1513[sdw2] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 bin -> usr/bin
1514[sdw2] dr-xr-xr-x. 5 root root 4096 Sep 12 18:03 boot
1515[sdw2] drwxr-xr-x. 4 gpadmin gpadmin 33 Feb 18 14:08 data1
1516[sdw2] drwxr-xr-x 2 gpadmin gpadmin 6 Feb 28 12:40 data2
1517[sdw2] drwxr-xr-x 19 root root 3180 Feb 22 13:22 dev
1518[sdw2] drwxr-xr-x. 98 root root 8192 Feb 22 13:22 etc
1519[sdw2] drwxr-xr-x. 4 root root 34 Feb 18 14:07 home
1520[sdw2] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 lib -> usr/lib
1521[sdw2] lrwxrwxrwx. 1 root root 9 Sep 12 17:47 lib64 -> usr/lib64
1522[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 media
1523[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
1524[sdw2] drwxr-xr-x. 5 root root 95 Feb 18 15:05 opt
1525[sdw2] dr-xr-xr-x 172 root root 0 Feb 22 13:21 proc
1526[sdw2] dr-xr-x---. 10 root root 4096 Feb 28 12:37 root
1527[sdw2] drwxr-xr-x 29 root root 900 Feb 27 12:56 run
1528[sdw2] lrwxrwxrwx. 1 root root 8 Sep 12 17:47 sbin -> usr/sbin
1529[sdw2] drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
1530[sdw2] dr-xr-xr-x 13 root root 0 Feb 28 12:36 sys
1531[sdw2] drwxrwxrwt. 30 root root 4096 Feb 28 03:08 tmp
1532[sdw2] drwxr-xr-x. 13 root root 4096 Sep 12 17:47 usr
1533[sdw2] drwxr-xr-x. 20 root root 4096 Sep 12 17:47 var
1534[sdw1] total 32
1535[sdw1] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 bin -> usr/bin
1536[sdw1] dr-xr-xr-x. 5 root root 4096 Sep 12 18:03 boot
1537[sdw1] drwxr-xr-x. 4 gpadmin gpadmin 33 Feb 18 14:08 data1
1538[sdw1] drwxr-xr-x 2 gpadmin gpadmin 6 Feb 28 12:40 data2
1539[sdw1] drwxr-xr-x 19 root root 3180 Feb 22 13:22 dev
1540[sdw1] drwxr-xr-x. 98 root root 8192 Feb 22 13:22 etc
1541[sdw1] drwxr-xr-x. 4 root root 34 Feb 18 14:07 home
1542[sdw1] lrwxrwxrwx. 1 root root 7 Sep 12 17:47 lib -> usr/lib
1543[sdw1] lrwxrwxrwx. 1 root root 9 Sep 12 17:47 lib64 -> usr/lib64
1544[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 media
1545[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
1546[sdw1] drwxr-xr-x. 5 root root 95 Feb 18 15:05 opt
1547[sdw1] dr-xr-xr-x 174 root root 0 Feb 22 13:21 proc
1548[sdw1] dr-xr-x---. 10 root root 4096 Feb 28 12:37 root
1549[sdw1] drwxr-xr-x 29 root root 900 Feb 27 12:56 run
1550[sdw1] lrwxrwxrwx. 1 root root 8 Sep 12 17:47 sbin -> usr/sbin
1551[sdw1] drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
1552[sdw1] dr-xr-xr-x 13 root root 0 Feb 28 12:36 sys
1553[sdw1] drwxrwxrwt. 33 root root 4096 Feb 28 03:33 tmp
1554[sdw1] drwxr-xr-x. 13 root root 4096 Sep 12 17:47 usr
1555[sdw1] drwxr-xr-x. 20 root root 4096 Sep 12 17:47 var
1556[gpadmin@mdw ~]$ gp
1557gpactivatestandby gpg-zip
1558gpaddmirrors gpic
1559gpasswd gpinitstandby
1560gpbackup gpinitsystem
1561gpbackup_helper gpload
1562gp_bsa_delete_agent gpload.py
1563gp_bsa_dump_agent gplogfilter
1564gp_bsa_query_agent gpmfr
1565gp_bsa_restore_agent gpmfr.py
1566gpcheck gpmmon
1567gpcheckcat gpmovemirrors
1568gpcheckcloud gpperfmoncat.sh
1569gpcheckmirrorseg.pl gpperfmon_install
1570gpcheckperf gppkg
1571gpcheckresgroupimpl gp_primarymirror
1572gpconfig gprecoverseg
1573gpcrondump gpreload
1574gpdbrestore gprestore
1575gpddboost gp_restore
1576gpdeletesystem gp_restore_agent
1577gp_df gprestore_filter.py
1578gpdiff.pl gprestore_post_data_filter.py
1579gp_dump gprof
1580[gpadmin@mdw ~]$ gpfilespace --showtempfilespace
158120190228:12:43:08:002426 gpfilespace:mdw:gpadmin-[INFO]:-
1582A tablespace requires a file system location to store its database
1583files. A filespace is a collection of file system locations for all components
1584in a Greenplum system (primary segment, mirror segment and master instances).
1585Once a filespace is created, it can be used by one or more tablespaces.
1586
1587
158820190228:12:43:08:002426 gpfilespace:mdw:gpadmin-[INFO]:-Getting filespace infor mation for TEMPORARY_FILES
158920190228:12:43:08:002426 gpfilespace:mdw:gpadmin-[INFO]:-Checking for filespace consistency
159020190228:12:43:08:002426 gpfilespace:mdw:gpadmin-[INFO]:-Obtaining current files pace entries used by TEMPORARY_FILES
159120190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-TEMPORARY_FILES OIDs ar e consistent for pg_system filespace
159220190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-TEMPORARY_FILES entries are consistent for pg_system filespace
159320190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-Obtaining current files pace entries used by TEMPORARY_FILES
159420190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-Current Filespace for T EMPORARY_FILES is pg_system
159520190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-1 /data1/master/gpse g-1
159620190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-2 /data1/primary/gps eg0
159720190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-6 /data1/mirror/gpse g0
159820190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-3 /data1/primary/gps eg1
159920190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-7 /data1/mirror/gpse g1
160020190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-4 /data1/primary/gps eg2
160120190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-8 /data1/mirror/gpse g2
160220190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-5 /data1/primary/gps eg3
160320190228:12:43:09:002426 gpfilespace:mdw:gpadmin-[INFO]:-9 /data1/mirror/gpse g3
1604[gpadmin@mdw ~]$ gpfilespace --showtempfilespace
160520190228:12:43:14:002529 gpfilespace:mdw:gpadmin-[INFO]:-
1606A tablespace requires a file system location to store its database
1607files. A filespace is a collection of file system locations for all components
1608in a Greenplum system (primary segment, mirror segment and master instances).
1609Once a filespace is created, it can be used by one or more tablespaces.
1610
1611
161220190228:12:43:14:002529 gpfilespace:mdw:gpadmin-[INFO]:-Getting filespace information for TEMPORARY_FILES
161320190228:12:43:14:002529 gpfilespace:mdw:gpadmin-[INFO]:-Checking for filespace consistency
161420190228:12:43:14:002529 gpfilespace:mdw:gpadmin-[INFO]:-Obtaining current filespace entries used by TEMPORARY_FILES
161520190228:12:43:15:002529 gpfilespace:mdw:gpadmin-[INFO]:-TEMPORARY_FILES OIDs are consistent for pg_system filespace
161620190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-TEMPORARY_FILES entries are consistent for pg_system filespace
161720190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-Obtaining current filespace entries used by TEMPORARY_FILES
161820190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-Current Filespace for TEMPORARY_FILES is pg_system
161920190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-1 /data1/master/gpseg-1
162020190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-2 /data1/primary/gpseg0
162120190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-6 /data1/mirror/gpseg0
162220190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-3 /data1/primary/gpseg1
162320190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-7 /data1/mirror/gpseg1
162420190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-4 /data1/primary/gpseg2
162520190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-8 /data1/mirror/gpseg2
162620190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-5 /data1/primary/gpseg3
162720190228:12:43:16:002529 gpfilespace:mdw:gpadmin-[INFO]:-9 /data1/mirror/gpseg3
1628[gpadmin@mdw ~]$ gpfilespace --showtransfilespace
162920190228:12:43:44:002658 gpfilespace:mdw:gpadmin-[INFO]:-
1630A tablespace requires a file system location to store its database
1631files. A filespace is a collection of file system locations for all components
1632in a Greenplum system (primary segment, mirror segment and master instances).
1633Once a filespace is created, it can be used by one or more tablespaces.
1634
1635
163620190228:12:43:44:002658 gpfilespace:mdw:gpadmin-[INFO]:-Getting filespace information for TRANSACTION_FILES
163720190228:12:43:45:002658 gpfilespace:mdw:gpadmin-[INFO]:-Checking for filespace consistency
163820190228:12:43:45:002658 gpfilespace:mdw:gpadmin-[INFO]:-Obtaining current filespace entries used by TRANSACTION_FILES
163920190228:12:43:45:002658 gpfilespace:mdw:gpadmin-[INFO]:-TRANSACTION_FILES OIDs are consistent for pg_system filespace
164020190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-TRANSACTION_FILES entries are consistent for pg_system filespace
164120190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-Obtaining current filespace entries used by TRANSACTION_FILES
164220190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-Current Filespace for TRANSACTION_FILES is pg_system
164320190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-1 /data1/master/gpseg-1
164420190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-2 /data1/primary/gpseg0
164520190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-6 /data1/mirror/gpseg0
164620190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-3 /data1/primary/gpseg1
164720190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-7 /data1/mirror/gpseg1
164820190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-4 /data1/primary/gpseg2
164920190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-8 /data1/mirror/gpseg2
165020190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-5 /data1/primary/gpseg3
165120190228:12:43:46:002658 gpfilespace:mdw:gpadmin-[INFO]:-9 /data1/mirror/gpseg3
1652[gpadmin@mdw ~]$
1653[gpadmin@mdw ~]$ gpfilespace -o .
165420190228:12:47:39:003214 gpfilespace:mdw:gpadmin-[INFO]:-
1655A tablespace requires a file system location to store its database
1656files. A filespace is a collection of file system locations for all components
1657in a Greenplum system (primary segment, mirror segment and master instances).
1658Once a filespace is created, it can be used by one or more tablespaces.
1659
1660
166120190228:12:47:39:003214 gpfilespace:mdw:gpadmin-[INFO]:-getting config
1662Enter a name for this filespace
1663> ^C
166420190228:12:51:48:003214 gpfilespace:mdw:gpadmin-[INFO]:-[Cancelled]
1665[gpadmin@mdw ~]$ psql adb
1666psql (8.3.23)
1667Type "help" for help.
1668
1669adb=# select * from gp_filespace
1670
1671adb=# select * from gp_files
1672
1673adb=# select * from gp_toolkit.gp_files
1674
1675adb=# select * from gp_toolkit.gp_files
1676
1677adb=# select * from pg_tablespace ;
1678 spcname | spcowner | spclocation | spcacl | spcprilocations | spcmirlocations | spcfsoid
1679------------+----------+-------------+--------+-----------------+-----------------+----------
1680 pg_default | 10 | | | | | 3052
1681 pg_global | 10 | | | | | 3052
1682(2 rows)
1683
1684adb=# select * from pg_filespace;
1685 fsname | fsowner
1686-----------+---------
1687 pg_system | 10
1688(1 row)
1689
1690adb=# select * from pg_filespace
1691pg_filespace pg_filespace_entry
1692adb=# select * from pg_filespace
1693pg_filespace pg_filespace_entry
1694adb=# select * from pg_filespace_entry ;
1695 fsefsoid | fsedbid | fselocation
1696----------+---------+-----------------------
1697 3052 | 1 | /data1/master/gpseg-1
1698 3052 | 2 | /data1/primary/gpseg0
1699 3052 | 4 | /data1/primary/gpseg2
1700 3052 | 3 | /data1/primary/gpseg1
1701 3052 | 5 | /data1/primary/gpseg3
1702 3052 | 6 | /data1/mirror/gpseg0
1703 3052 | 7 | /data1/mirror/gpseg1
1704 3052 | 8 | /data1/mirror/gpseg2
1705 3052 | 9 | /data1/mirror/gpseg3
1706(9 rows)
1707
1708adb=# select oid, * from pg_filespace;
1709 oid | fsname | fsowner
1710------+-----------+---------
1711 3052 | pg_system | 10
1712(1 row)
1713
1714adb=# \q
1715[gpadmin@mdw ~]$ gpfilespace -o .
171620190228:12:59:49:004674 gpfilespace:mdw:gpadmin-[INFO]:-
1717A tablespace requires a file system location to store its database
1718files. A filespace is a collection of file system locations for all components
1719in a Greenplum system (primary segment, mirror segment and master instances).
1720Once a filespace is created, it can be used by one or more tablespaces.
1721
1722
172320190228:12:59:49:004674 gpfilespace:mdw:gpadmin-[INFO]:-getting config
1724Enter a name for this filespace
1725> pg_default
1726[Error] The name prefix 'pg_' is reserved for system filespaces
1727
1728Enter a name for this filespace
1729> default
1730
1731Checking your configuration:
1732Your system has 2 hosts with 2 primary and 2 mirror segments per host.
1733Your system has 1 hosts with 0 primary and 0 mirror segments per host.
1734
1735Configuring hosts: [sdw2, sdw1]
1736
1737Please specify 2 locations for the primary segments, one per line:
1738primary location 1> /data2/primary
1739[Error] sdw2: /data2/primary : No such file or directory
1740
1741primary location 1> ^C
174220190228:13:02:36:004674 gpfilespace:mdw:gpadmin-[INFO]:-[Cancelled]
1743[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts chown gpadmin:gpadmin /data2
1744[sdw1]
1745[sdw2]
1746[gpadmin@mdw ~]$ gpssh -u root -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts chown -R gpadmin:gpadmin /data2
1747[sdw2]
1748[sdw1]
1749[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts mkdir /data2/primary
1750[sdw2]
1751[sdw1]
1752[gpadmin@mdw ~]$ gpssh -f /home/gpadmin/arenadata_configs/arenadata_segment_hosts.hosts mkdir /data2/mirror
1753[sdw1]
1754[sdw2]
1755[gpadmin@mdw ~]$ gpfilespace -o .
175620190228:13:03:55:005687 gpfilespace:mdw:gpadmin-[INFO]:-
1757A tablespace requires a file system location to store its database
1758files. A filespace is a collection of file system locations for all components
1759in a Greenplum system (primary segment, mirror segment and master instances).
1760Once a filespace is created, it can be used by one or more tablespaces.
1761
1762
176320190228:13:03:55:005687 gpfilespace:mdw:gpadmin-[INFO]:-getting config
1764Enter a name for this filespace
1765> default
1766
1767Checking your configuration:
1768Your system has 2 hosts with 2 primary and 2 mirror segments per host.
1769Your system has 1 hosts with 0 primary and 0 mirror segments per host.
1770
1771Configuring hosts: [sdw2, sdw1]
1772
1773Please specify 2 locations for the primary segments, one per line:
1774primary location 1> /data2/primary
1775primary location 2> /data2/primary
1776
1777Please specify 2 locations for the mirror segments, one per line:
1778mirror location 1> /data2/mirror
1779mirror location 2> /data2/mirror
1780
1781Configuring hosts: [mdw]
1782
1783Enter a file system location for the master
1784master location> /data2/master
1785[Error] mdw: /data2/master : No write permissions
1786
1787master location> /data2/master
178820190228:13:07:02:005687 gpfilespace:mdw:gpadmin-[INFO]:-Creating configuration file...
178920190228:13:07:02:005687 gpfilespace:mdw:gpadmin-[INFO]:-[created]
179020190228:13:07:02:005687 gpfilespace:mdw:gpadmin-[INFO]:-
1791To add this filespace to the database please run the command:
1792 gpfilespace --config ./gpfilespace_config_20190228_130355
1793
1794[gpadmin@mdw ~]$ less ./gp
1795gpAdminLogs/ gpfilespace_config_20190228_130355
1796[gpadmin@mdw ~]$ less ./gpfilespace_config_20190228_130355
1797[gpadmin@mdw ~]$ gpfilespace --config ./gpfilespace_config_20190228_130355
179820190228:13:09:20:006408 gpfilespace:mdw:gpadmin-[INFO]:-
1799A tablespace requires a file system location to store its database
1800files. A filespace is a collection of file system locations for all components
1801in a Greenplum system (primary segment, mirror segment and master instances).
1802Once a filespace is created, it can be used by one or more tablespaces.
1803
1804
180520190228:13:09:20:006408 gpfilespace:mdw:gpadmin-[INFO]:-getting config
1806Reading Configuration file: './gpfilespace_config_20190228_130355'
180720190228:13:09:20:006408 gpfilespace:mdw:gpadmin-[INFO]:-Performing validation on paths
1808..............................................................................
1809
181020190228:13:09:20:006408 gpfilespace:mdw:gpadmin-[INFO]:-Connecting to database
181120190228:13:09:20:006408 gpfilespace:mdw:gpadmin-[ERROR]:-error 'ERROR: syntax error at or near "default"
1812LINE 2: CREATE FILESPACE default
1813 ^
1814' in '
1815CREATE FILESPACE default
1816(
1817 1: '/data2/master/gpseg-1',
1818 2: '/data2/primary/gpseg0',
1819 3: '/data2/primary/gpseg1',
1820 4: '/data2/primary/gpseg2',
1821 5: '/data2/primary/gpseg3',
1822 6: '/data2/mirror/gpseg0',
1823 7: '/data2/mirror/gpseg1',
1824 8: '/data2/mirror/gpseg2',
1825 9: '/data2/mirror/gpseg3'
1826);'
1827[gpadmin@mdw ~]$ vi ./gpfilespace_config_20190228_130355
1828[gpadmin@mdw ~]$ gpfilespace --config ./gpfilespace_config_20190228_130355
182920190228:13:09:56:006498 gpfilespace:mdw:gpadmin-[INFO]:-
1830A tablespace requires a file system location to store its database
1831files. A filespace is a collection of file system locations for all components
1832in a Greenplum system (primary segment, mirror segment and master instances).
1833Once a filespace is created, it can be used by one or more tablespaces.
1834
1835
183620190228:13:09:56:006498 gpfilespace:mdw:gpadmin-[INFO]:-getting config
1837Reading Configuration file: './gpfilespace_config_20190228_130355'
183820190228:13:09:56:006498 gpfilespace:mdw:gpadmin-[INFO]:-Performing validation on paths
1839..............................................................................
1840
184120190228:13:09:56:006498 gpfilespace:mdw:gpadmin-[INFO]:-Connecting to database
184220190228:13:09:56:006498 gpfilespace:mdw:gpadmin-[INFO]:-Filespace "default_hdd" successfully created
1843[gpadmin@mdw ~]$ psql adb
1844psql (8.3.23)
1845Type "help" for help.
1846
1847adb=# create tablespace pg_default_hdd filespace default_hdd;
1848ERROR: unacceptable tablespace name "pg_default_hdd"
1849DETAIL: The prefix "pg_" is reserved for system tablespaces.
1850adb=# create tablespace default_hdd filespace default_hdd;
1851CREATE TABLESPACE
1852adb=# alter database set default tablespace 'default_hdd';
1853ERROR: syntax error at or near "default"
1854LINE 1: alter database set default tablespace 'default_hdd';
1855 ^
1856adb=# alter database set tablespace 'default_hdd';
1857ERROR: syntax error at or near "tablespace"
1858LINE 1: alter database set tablespace 'default_hdd';
1859 ^
1860adb=# alter database tablespace 'default_hdd';
1861ERROR: syntax error at or near "'default_hdd'"
1862LINE 1: alter database tablespace 'default_hdd';
1863 ^
1864adb=# alter database tablespace default_hdd;
1865ERROR: syntax error at or near "default_hdd"
1866LINE 1: alter database tablespace default_hdd;
1867 ^
1868adb=# alter database adb set tablespace 'default_hdd';
1869ERROR: syntax error at or near "'default_hdd'"
1870LINE 1: alter database adb set tablespace 'default_hdd';
1871 ^
1872adb=# alter database adb set tablespace default_hdd;
1873ERROR: syntax error at or near "default_hdd"
1874LINE 1: alter database adb set tablespace default_hdd;
1875 ^
1876adb=# alter database adb with tablespace default_hdd;
1877ERROR: syntax error at or near "tablespace"
1878LINE 1: alter database adb with tablespace default_hdd;
1879 ^
1880adb=# alter database adb set tablespace='default_hdd';
1881ERROR: unrecognized configuration parameter "tablespace"
1882adb=# alter database adb set default_tablespace='default_hdd';
1883ALTER DATABASE
1884adb=# \q
1885[gpadmin@mdw ~]$ psql adb
1886psql (8.3.23)
1887Type "help" for help.
1888
1889adb=# create table table_1 (i int);
1890NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum Database data distribution key for this table.
1891HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
1892CREATE TABLE
1893adb=# insert into t
1894table0 table_11_pxf_read table3 table3_2 table7
1895table01 table_11_pxf_read_parallel table3_1_prt_2 table3_3 table8
1896table1 table12 table3_1_prt_3 table3_5 table9
1897table_1 table_12_pxf_write table3_1_prt_4 table4 test_dist
1898table10 table13 table3_1_prt_default_p table5
1899table11 table2 table3_1_prt_year_2015 table6
1900adb=# insert into table_1 select oid from pg_class;
1901INSERT 0 606
1902adb=# ^C
1903adb=# select relfilenode from pg_class where relname='table_1';
1904 relfilenode
1905-------------
1906 17019
1907(1 row)
1908
1909adb=# ^C
1910adb=# ^C
1911adb=# ^C
1912adb=# \q
1913[gpadmin@mdw ~]$ ssh sdw1
1914Last login: Thu Feb 28 13:03:42 2019 from mdw
1915[gpadmin@sdw1 ~]$ cd /
1916.autorelabel lib/ run/
1917bin/ lib64/ sbin/
1918boot/ .markerfile-cb82af80-e161-48b7-a61d-bce6664e523a.txt srv/
1919data1/ media/ sys/
1920data2/ mnt/ tmp/
1921dev/ opt/ usr/
1922etc/ proc/ var/
1923home/ root/
1924[gpadmin@sdw1 ~]$ cd /data2/
1925mirror/ primary/
1926[gpadmin@sdw1 ~]$ cd /data2/primary/gpseg
1927gpseg0/ gpseg1/
1928[gpadmin@sdw1 ~]$ cd /data2/primary/gpseg0/28495/16384/
192916783 PG_VERSION
1930[gpadmin@sdw1 ~]$ cd /data2/primary/gpseg0/28495/16384/16783
1931arenadata_configs/ .bash_logout .bashrc .lesshst .viminfo
1932.bash_history .bash_profile gpAdminLogs/ .ssh/
1933[gpadmin@sdw1 ~]$ ll /data2/primary/gpseg0/28495/16384/16783
1934-rw------- 1 gpadmin gpadmin 32768 Feb 28 13:26 /data2/primary/gpseg0/28495/16384/16783
1935[gpadmin@sdw1 ~]$ PS1='[PEXPECT]\$ '^C
1936[gpadmin@sdw1 ~]$ logout
1937Connection to sdw1 closed.
1938[gpadmin@mdw ~]$ psql adb
1939psql (8.3.23)
1940Type "help" for help.
1941
1942adb=# select gp_dist_random(relfilenode) from pg_class where relname='table_1';
1943ERROR: function gp_dist_random(oid) does not exist
1944LINE 1: select gp_dist_random(relfilenode) from pg_class where relna...
1945 ^
1946HINT: No function matches the given name and argument types. You might need to add explicit type casts.
1947adb=# select relfilenode from gp_dist_random(pg_class) where relname='table_1';
1948ERROR: GP_DIST_RANDOM: invalid argument type (parse_clause.c:1249)
1949adb=# select relfilenode from gp_dist_random(pg_catalog.pg_class) where relname='table_1';
1950ERROR: GP_DIST_RANDOM: invalid argument type (parse_clause.c:1249)
1951adb=# select relfilenode from gp_dist_random('pg_catalog.pg_class') where relname='table_1';
1952 relfilenode
1953-------------
1954 24973
1955 16783
1956 16783
1957 16783
1958(4 rows)
1959
1960adb=#