Rundeck project and job sync between 2 instances with backend as mysql cluster - virtual-machine

I have set up 2 rundecks in 2 VMs and mysql cluster so Rundeck #1 on VM#1 connects to Mysql DB#1 and similarly Rundeck #2 on VM#2 connects to Mysql DB#2.
The problem now I have is whenever I am creating a project / job in rundeck #1 that I am not able to see it in rundeck #2. What should I do?
Any help will be appreciated

I would first try to switch the databases, i.e. Rundeck#2 connects to MySql DB#1 to see if the jobs are visible.
If this is the case, then you have a sync issue.
If jobs are still not visible, then i assume that there are some identification problems of the Rundeck instances.
Just my 2 cents.

The issue can be fixed by maintaining the default engine in my.cnf.
So in my case I just modified the /etc/my.cnf
Introduced the following option below the header [mysqld]:
default-storage-engine=NDBCLUSTER
And did a mysql restart and the tables sync started to happen.
delete the rundeck db before proceeding with any modifications.
Thanks and hope this helps everyone facing such issues.

Related

Azure SQL DB Error, This location is not available for subscription

I am having pay as you go subscription and I am creating an Azure SQL server.
While adding server, on selection of location, I am getting this error:
This location is not available for subscriptions
Please help.
There's an actual issue with Microsoft servers. They have too many Azure SQL database creation requests. They're currently trying to handle the situation. This seems to affect all types of subscriptions even paid ones. I have a Visual Studio Enterprise Subscription and I get the same error (This location is not available for subscriptions) for all locations.
See following Microsoft forum thread for more information:
https://social.msdn.microsoft.com/Forums/en-US/ac0376cb-2a0e-4dc2-a52c-d986989e6801/ongoing-issue-unable-to-create-sql-database-server?forum=ssdsgetstarted
As the other answer states, this is a (poorly handled) restriction on Azure as of now and there seems to be no ETA on when it shall be lifted
In the meantime, you can still get an SQL database up and running in Azure, if you don't mind doing a bit of extra work and don't want to wait - just set up a Docker instance and put MSSQL on it!
In the Azure Portal, create a container instance. Use the following docker image: https://hub.docker.com/r/microsoft/mssql-server-windows-express/
while creating, you might have to set the ACCEPT_EULA environment variable to "Y".
after it boots up (10-20 minutes for me), in the portal, connect to it with the "sqlcmd" command and set up your login. In my case, I just needed a quick demo db, so I took the "sa" login, ran "alter login SA with password ='{insert your password}'" and "alter login SA enable". See here for details: https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql?view=sql-server-ver15#examples
and voila, you have an SQL instance on Azure. Although it's unmanaged and poorly monitored, it might be enough for a short-term solution. The IP address of the docker instance can be found in the Properties section of the container instance blade.
Maybe you can reference this blog: Azure / SQL Server / This location is not available for subscription. It has the same error with you.
Run this powershell command to check if the location you choose is available:
Get-AzureRmLocation | select displayname
If the location is available, the best way to resolve this issue just contact the Azure support to have this enabled for you. You can do this for free using support page on your Azure Portal.
They well contact you can help you solve it.
Hope this helps.
This is how I solved myself. Let me tell you the problem first. Then the solution.
Problem: I created a brand new free Azure account (comes with $250 free credit) for a client. Then upgraded to pay-as-you-go subscription. I was unable to create Azure SQL db. The error was 'location is not available'.
How I solved: I created another pay-as-you-go subscription in the same account. Guess what - I was able to create SQL db in my new subscription right away. Then I deleted the first subscription from my account. And yes, I lost the free credit.
If your situation is similar to mine, you can try this.
PS: I have 3 clients with their own Azure accounts. I was able to create SQL Db in all of their accounts. I think the problem arises only for free accounts and/or for free accounts that upgraded to pay-as-you-go accounts.
EDIT - 2020/04/22
This is still an ongoing problem up to today, but I was told by Microsoft support that on April 24th, a new Azure cluster will be available in Europe. Thus it might get possible to finally deploy SQL Server instances on Free accounts around there.
Deploy a docker container running SQL Server
To complement on #Filip's answer, and given that the problem still remains with Azure SQL Server, a docker container running a SQL Server is a great alternative. You can set yourself one very easily running the following command on the cloud shell:
az container create --image microsoft/mssql-server-windows-express --os-type Windows --name <ContainerName> --resource-group <ResourceGroupName> --cpu <NumberOfCPUs> --memory <Memory> --port 1433 --ip-address public --environment-variables ACCEPT_EULA=Y SA_PASSWORD=<Password> MSSQL_PID=Developer --location <SomeLocationNearYou>
<ContainerName> : A container name of your choice
<ResourceGroupName> : The name of a previously created Resource Group
<NumberOfCPUs> : Number of CPUs you want to use
<Memory> : Memory you want to use
<Password> : Your password
<SomeLocationNearYou> : A location near you. For example,
westeurope
Access SQL Server
Once the container instance is deployed, in the Overview you will be able to find an IP address. Use that IP address and the password you chose in the az container command to connect to the SQL Server, either using Microsoft's SSMS, or the sqlcmd utility
Some documentation regarding the image I have used can be found here.
More information on the command I have used here.

Execute job spoon with software

I have a JOB done in SPOON, which is executed without problems in the command line, but I would like to know if there is any software in which I can execute these JOBS and go to see the execution visually. The idea is that for the most pleasant exploitation area these tasks are executed.
You have two solutions:
Carte:
Use the carte server which is shipped with the PDI. Install the PDI on any server, launch carte (specifying the port), then you can execute/view/stop/restart job/transformation from any browser. Documentation is here.
Of course you can launch a job/transformation from your own PDI. Just define a new Slave server, on the left panel, tab view, default username/password = cluster/cluster. Then each time you run a job/transformation, choose the carte server, instead of Pentaho/local in the Run configuration.
Loggin
If you just want to follow job/transformation, you may use the database logging: Right-click any where, Parameters, Logging, Job/Transformation, then define a database, a table and a logging interval of 2 seconds.
Then every two seconds, the line_read, line_written, errors, and log_field are written to a database. This database can be read by an external process and displayed on the screen or on a browser.
This method is used in the github/ETL-pilot which uses a tomcat (because you probably have a tomcat already running with a Pentaho server), but can easily be adapted to a nodejs or any other server. (If you do it and OpenSource it, please add a link to your work on our github).

Windows server is restarting by itself each 2 minutes

I am going crazy. My windows server 2008 r2 keep restarting by itself each 2 minutes. I cannot see the view logs.. Pls suggest what can be performed.. I saw the fixing in registry part but for me I am very fresh there .. And our system is life...
Thank you in advance.
Did you try this link?
To Stop automatic restart of server please un-check the marked option
in below snap shot. Also try to boot server in safe mode and check for
the similar kind of issue? Another useful step is go to run and type
msconfig|startup|uncheck startup items which are not required.

When SQL Developer is idle I lose my connection

My problem is this: I am running Oracle 10G on windows 98 on a virtual machine using VMWare on my desktop computer. I can connect to several users (SYS, HR, OE, ... ) with SQL Developer (which is on my desktop not on the virtual machine) but if a don't run any SQL statement for a short while, say about 2 minutes, I lose my connection and get an error like connection closed or IO-fault:connection reset by peer.
Could this have anything to do with the sp_reset_connection?
When I open SQL Plus on my virtual machine itself I don't lose the connection at all, even if it has been idle for 30 minutes or longer. So now I'm thinking there could be a problem between the Virtual Machine and my desktop computer. Before this all worked fine.
I tried closing recently installed anti-malware apps without any result.
Anybody has an idea what I could do to fix this problem?
Kind regards,
Veek
I stumbled upon the Keep-ALive Extension and tried it as well but without succes. Standard it is set to a 2 minute interval. I've changed this value to 1 and to 60 minutes but as soon as I stop running statements for a short while I lose my connection. There must be something else. I've already installed the newest SQL Developer version but still it is the same. (I did import the settings from my earlier release maybe I have to try without importing them.)
Any other suggestions perhaps?
Kind regards,
Veek
This extension works for SQL Developer 4:
https://github.com/scristalli/SQL-Developer-4-keepalive
DISCLAIMER: I'm the developer of the extension. I hope the answer is not considered advertising, because this extension is open source (and the previous non-open-source extensions were accepted as an answer).
MinChen Chai has created Keep-Alive Extension exactly for your situation:
https://sites.google.com/site/keepaliveext
It will continually send TCP keep-alive packets and prevent server disconnection by inactivity timeout.
When used with the latest SQL Developer Version 4.0.0.13:
- MinChen's extension (http://sites.google.com/site/keepaliveext) doesn't work.
- The keepconnext extension (http://sites.google.com/site/keepconnext) too doesn't work anymore.
On SQL Developer go to Tools > Preferences > Databases > Instances Viewer. and the option traffic duration change it to the max, this worked for me.
Go to Tools > Monitor Sessions... and select your Connection. Set the refresh value to 60 (seconds).
While monitoring, your connection will not be lost.
Oracle SQL Developer Version 4.1.3.20
As the suggested extensions in this thread have had issues with recent versions of SQL Developer, I tried my way and got scristalli's code to work in a new project based on his code AND the oracle example repo.
Needs a lot of work but oh well, at least I can install the new build on SQLDev v19.2 and it works as expected.
Disclaimer: I'm the owner of the linked repo, although it's MIT as the previous versions. Feel free to fork it, pullrequest-it or do as you like

Terminate MySQL connections on shared host?

I'm using MediaTemple's Grid Server (shared/grid hosting) to run some MySQL/PHP sites I'm writing and noticed that I wasn't closing one of my MySQL connections, which caused my site to error out:
"Too Many Connections"
I can't log in anywhere to close the connections manually.
Is that any way to close open connections using a script or other type of command?.
Should I just wait?
If you can't log into MySQL at all, you will probably have to contact your hosting provider to kill the connections.
If you can use the MySQL shell, you can use the show processlist command to view connections, then use the kill command to remove the connections.
It's been my experience that hung SQL connections tend to stay that way, unfortunately.
blindly going in an terminating connections is not the way to solve this problem. first you need to understand why you are running out of connections. is your max_connections setting selected to correctly match the number of max/anticipated users? are you using persistent connections when you really don't need them? etc.
Make sure that you're closing the connections with your PHP code. Also, you could increase the maximum connections allowed in /etc/my.cnf.
max_connections=500
Finally, you can login to a mysql prompt and type show status or show processlist to view various statistics with your server.
If all else fails, restarting the server daemon should clear the persistent connections.
Well, if you cannot ever sneak in with a connection, I dunno', but if you can occasionally sneak in, in Ruby it would be close to:
require 'mysql'
mysql = Mysql.new(ip, user, pass)
processlist = mysql.query("show full processlist")
killed = 0
processlist.each { | process |
mysql.query("KILL #{process[0].to_i}")
}
puts "#{Time.new} -- killed: #{killed} connections"
If you can access the command line with enough privileges, restart the MySQL server or the Apache (assuming that you use Apache) server - because probably it is keeping the connections open. After you successfully closed the connections, make sure that you are not using persistent connections from PHP (the general opinion seems to be that it doesn't create any significant performance gain, but it has all kinds of problems - like you've experienced - and in some cases - like using it PostgreSQL - it can even significantly slow down your site!).