问题描述
我们有带有 postgresql 的 ambari 集群
我们尝试如下打印集群中的所有主机,但似乎我的选择命令不正确
psql -U ambari ambari
Password for user ambari:
psql (9.2.24)
Type "help" for help.
ambari=>
ambari-> select host_id from hosts;
ERROR: Syntax error at or near "select"
LINE 2: select host_id from hosts;
^
ambari=>
我哪里错了?
解决方法
命令是(带有 mem 的详细信息)
ambari=>
select host_name,ipv4,public_host_name,total_mem from hosts;
或
ambari=> select host_name,public_host_name from hosts;