Metasploit issue

Hello Everyone - I am using Kali 2017.3 version. I am not able to use Metasploit tool. I am not so experienced in pen testing and Kali Linux so not able to practice properly. Please suggest me possible solutions.

oot@kali:~# msfconsole
[-] Failed to connect to the database: could not connect to server: Connection refused
Is the server running on host “localhost” (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host “localhost” (127.0.0.1) and accepting
TCP/IP connections on port 5432?

/usr/share/metasploit-framework/lib/msf/core/payload/android.rb:87:in not_after=': bignum too big to convert into long’ (RangeError)
from /usr/share/metasploit-framework/lib/msf/core/payload/android.rb:87:in sign_jar' from /usr/share/metasploit-framework/lib/msf/core/payload/android.rb:118:in generate_jar’
from /usr/share/metasploit-framework/modules/payloads/singles/android/meterpreter_reverse_https.rb:50:in generate_jar' from /usr/share/metasploit-framework/lib/msf/core/payload/android.rb:38:in generate’
from /usr/share/metasploit-framework/lib/msf/core/payload.rb:204:in size' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:91:in block in recalculate’
from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:78:in each_pair' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:78:in recalculate’
from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:251:in block in load_modules' from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:248:in each’
from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:248:in load_modules' from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:119:in block in load_modules’
from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:117:in each' from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:117:in load_modules’
from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:41:in block in add_module_path' from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:40:in each’
from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:40:in add_module_path' from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:50:in block in init_module_paths’
from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:49:in each' from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:49:in init_module_paths’
from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:219:in initialize' from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in new’
from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in driver' from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in start’
from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in start' from /usr/bin/msfconsole:48:in

I was also trying to install it by downloading the new version but no luck

total 199216
drwxr-xr-x 2 root root 4096 May 7 11:42 hackthebox
-rwxrwxrwx 1 root root 203975420 May 9 06:11 metasploit-latest-linux-x64-installer.run
-rw-r–r-- 1 root root 9489 May 10 07:31 strangerspy.ovpn
root@kali:~/Desktop#
root@kali:~/Desktop#
root@kali:~/Desktop# ./metasploit-latest-linux-x64-installer.run
bash: ./metasploit-latest-linux-x64-installer.run: cannot execute binary file: Exec format error
root@kali:~/Desktop#