El primer paso es instalar los paquetes binarios de PostgreSQL:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# apt install postgresql Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: bigtop-groovy bigtop-jsvc bigtop-utils hadoop hadoop-hdfs libevent-core-2.1-7 libevent-pthreads -2.1-7 libopts25 libssl-dev sntp zookeeper Use 'apt autoremove' to remove them. The following additional packages will be installed: libllvm10 libpq5 postgresql-12 postgresql-client-12 postgresql-client-common postgresql-common ssl-cert sysstat Suggested packages: postgresql-doc postgresql-doc-12 libjson-perl openssl-blacklist isag The following NEW packages will be installed: libllvm10 libpq5 postgresql postgresql-12 postgresql-client-12 postgresql-client-common postgresql-common ssl-cert sysstat Ø upgraded, 9 newly installed, to remove and 60 not upgraded. Need to get 30.7 MB of archives. After this operation, 122 MB of additional disk space will be used. Do you want to continue? [Y/n] |
1 2 3 |
# vim /etc/postgresql/12/main/postgresql.conf # grep listen_addresses /etc/postgresql/12/main/postgresql.conf listen_addresses = '*' # what IP address(es) to listen on; |
samenet
:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# vim /etc/postgresql/12/main/pg_hba.conf # tail /etc/postgresql/12/main/pg_hba.conf host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 #Hadoop cluster connections host all all samenet md5 # Allow replication connections from localhost, by a user with the # replication privilege. local replication all peer host replication all 127.0.0.1/32 md5 host replication all ::1/128 md5 |
1 2 3 |
# sudo su - postgres -c "createuser -s hive -p" Enter password for new role: Enter it again: |
1 2 3 4 5 6 7 |
# sudo su - postgres -c 'createdb hive" # psql -U hive -h 127.0.0.1 hive Password for user hive: psql (12.17 (Ubuntu 12.17-0ubuntu0.20.04.1)) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) Type "help" for help. hive=# \q |