Unable to connect to SQL server instance ubuntu 18.04 - sql-server

I am running SQL server on ubuntu 18.04 which I was able to connect to successfully via SSMS. But I am not able to connect anymore.
My first instinct was to check if the SQL server was running by executing
sudo systemctl status mssql-server
lo and behold the SQL server instance was active so I rebooted the entire server and ran the above command again and saw the following:
mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-10-16 16:49:17 UTC; 1min 13s ago
Docs: https://learn.microsoft.com/en-us/sql/linux
Process: 1025 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=1/FAILURE)
Main PID: 1025 (code=exited, status=1/FAILURE)
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Main process exited, code=exited, status=1/FAILURE
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Scheduled restart job, restart counter is at 3.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: Stopped Microsoft SQL Server Database Engine.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Start request repeated too quickly.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: Failed to start Microsoft SQL Server Database Engine.
I checked the logs at /var/opt/mssql/log/errorlog and found this .
2019-10-14 13:52:56.16 spid51 CImageHelper::Init () Failed load of
symbol file with path = /binn/;/BINN - Not enough storage is available to
process this command.
2019-10-14 13:52:56.17 spid51 CImageHelper::Init () Failed load of
symbol file with path = /binn/;/BINN - Not enough storage is available to process this command.
2019-10-14 13:52:56.19 spid51 Error: 19099, Severity: 16, State: 1.
2019-10-14 13:52:56.19 spid51 Trace ID '1' was stopped because of an error. Cause: 0x80070005(Access is denied.). Restart the trace after correcting the problem.
2019-10-14 13:52:56.20 spid51 Error: 17053, Severity: 16, State: 1.
2019-10-14 13:52:56.20 spid51 FCB::MakePreviousWritesDurable: Operating system error (null) encountered.
2019-10-14 13:52:56.21 spid51 Error: 9001, Severity: 21, State: 1.
2019-10-14 13:52:56.21 spid51 The log for database 'master' is not available. Check the operating system error log for related error messages. Resolve any errors and restart the database.
2019-10-14 13:52:56.24 spid51 Error: 9001, Severity: 21, State: 16.
I'm not an expert and don't know the next move to make.

So the reason for this error was getting was because I messed up with the file ownership..
running the following command fixed it for me too bad I spend so much time on this:
cd /var/opt
sudo chown mssql:mssql -R mssql
time to take that dump :-D.

Related

SQLServer.service Active is running but can`t connection (on CentOS8.3)

When I run systemctl status mssql-server.service,there are no errors reported,Active is active(running)
mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-11-18 10:16:13 CST; 32s ago
Docs: https://learn.microsoft.com/en-us/sql/linux
Main PID: 478033 (sqlservr)
Tasks: 34
Memory: 1.5G
CGroup: /system.slice/mssql-server.service
├─478033 /opt/mssql/bin/sqlservr
└─478037 /opt/mssql/bin/sqlservr
11月 18 10:16:13 systemd[1]: mssql-server.service: Main process exited, code=exited, status=1/FAILURE
11月 18 10:16:13 systemd[1]: mssql-server.service: Failed with result 'exit-code'.
11月 18 10:16:13 systemd[1]: Stopped Microsoft SQL Server Database Engine.
11月 18 10:16:13 systemd[1]: mssql-server.service: Found left-over process 478029 (sh) in control group while starting unit. Ignoring.
11月 18 10:16:13 systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
11月 18 10:16:13 systemd[1]: mssql-server.service: Found left-over process 478031 (tar) in control group while starting unit. Ignoring.
11月 18 10:16:13 systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
11月 18 10:16:13 systemd[1]: mssql-server.service: Found left-over process 478032 (bzip2) in control group while starting unit. Ignoring.
11月 18 10:16:13 systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
11月 18 10:16:13 systemd[1]: Started Microsoft SQL Server Database Engine.
but ,when I try to connect local service by sqlcmd sqlcmd -S localhost -U SA -p
i got
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2749.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
understand, SQLServer has benn started, but can`t connect.
Another question, in the /var/opt/mssql/log path, generated many log file
enter image description here

mongod.service active : failed (failed to start mongodb server)

I just started learning mongodb everything was going well until I tried stoping the server using sudo systemctl stop mongod and restarting it usingsudo systemctl start mongod.
now its showing:-
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-01-16 12:39:04 IST; 3s ago
Docs: https://docs.mongodb.org/manual
Process: 357998 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 357998 (code=exited, status=1/FAILURE)
Jan 16 12:39:04 prabal-computer systemd[1]: Started MongoDB Database Server.
Jan 16 12:39:04 prabal-computer mongod[357998]: {"t":{"$date":"2021-01-16T07:09:04.669Z"},"s":"F", "c":"CONTROL", "id":20574, "ctx":"main">
Jan 16 12:39:04 prabal-computer systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 12:39:04 prabal-computer systemd[1]: mongod.service: Failed with result 'exit-code'.
lines 1-11/11 (END)
whenever I am trying to start and see the status using sudo systemctl status mongod,this error appears.
note: I have already tried reinstalling the mongodb

MSSQL Service failed to start on ubuntu

Every time i checked the MSSQL service is failing i have over 5 GB memory on my virtual server. I have changed the sql port to 1533.
r*****k:~# sudo systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Fri 2017-11-17 15:39:39 UTC; 1min 37s ago
Process: 4906 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=255)
Main PID: 4906 (code=exited, status=255)
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Unit entered failed state.
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Nov 17 15:39:39 SV0*****.com systemd[1]: Stopped Microsoft SQL Server Database Engine.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Start request repeated too quickly.
Nov 17 15:39:39 SV0*****.com systemd[1]: Failed to start Microsoft SQL Server Database Engine.
r*****k:/var/opt/mssql# cat mssql.conf
> [EULA] accepteula = Y</br>
>
> [network] ipaddress = 6*.*1.1*2.*8 kerberoskeytabfile =
> /var/opt/mssql/secrets/mssql.keytab tcpport = 1533
>
> [memory] memorylimitmb = 3328
>
> [filelocation] defaultdatadir = /tmp/data
Anyone can help to stable the mssql service on the vm.
Does your Ubuntu server have the firewall enabled? If so, it may be blocking port 1533, which is preventing the service from starting on that custom port.
You may want to look in /var/log/messages for additional information as well.

Centos : Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2749

I have installed MSSSQL on Centos 7. Installation is completed but when I am a connection to the SQL via sqlcmd It is giving the following error.
[root#S*03****k ~]# sqlcmd -S 127.0.0.1 -U sa -P H*****3
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2749.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
root#S*****k ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 699/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 793/master
tcp6 0 0 :::80 :::* LISTEN 704/httpd
tcp6 0 0 :::22 :::* LISTEN 699/sshd
Can anyone help?
After wasting so many days i have come to know that this happens due to Stopped SQL Service. I have tried to start but some how this is not get up.
Every time i checked the MSSQL service is failing i have over 5 GB memory on my virtual server.
r*****k:~# sudo systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Fri 2017-11-17 15:39:39 UTC; 1min 37s ago
Process: 4906 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=255)
Main PID: 4906 (code=exited, status=255)
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Unit entered failed state.
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Nov 17 15:39:39 SV0*****.com systemd[1]: Stopped Microsoft SQL Server Database Engine.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Start request repeated too quickly.
Nov 17 15:39:39 SV0*****.com systemd[1]: Failed to start Microsoft SQL Server Database Engine.
Finally, i have created a new virtual machine and SQL Service is working fine. SQL Databases are working as expected.

Nagios Core 4.2.0 Service not running after reboot

I am running Nagios Core 4.2.0 to monitor hosts and services via Check_MK plugin. This is running on a VM. Once I rebooted, I cannot get a PID for Nagios.
root#hostname:/etc/init.d# service nagios status
● nagios.service - Nagios
Loaded: loaded (/etc/systemd/system/nagios.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-08-10 09:09:34 CDT; 1min 2s ago
Process: 2369 ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg (code=exited, status=1/FAILURE)
Main PID: 2369 (code=exited, status=1/FAILURE)
Aug 10 09:09:34 hostname systemd[1]: Started Nagios.
Aug 10 09:09:34 hostname systemd[1]: nagios.service: Main process exited, code=exited, status=1/FAILURE
Aug 10 09:09:34 hostname systemd[1]: nagios.service: Unit entered failed state.
Aug 10 09:09:34 hostname systemd[1]: nagios.service: Failed with result 'exit-code'.
Is there a way to get this PID to run? I am not sure how a simple reboot can make this go bad.

Resources