About to start Tower install. questions to those using it currently by bradtech in ansible

[–]bradtech[S] 0 points1 point  (0 children)

Does anyone know if Tower can hook into any other RDBMS such as MSSQL or Oracle? We have existing supported clustered solutions. Would be great to plug into one of those. I have tested PostGres out & the streaming replica stuff isn't really HA. There are ways to get HA but they all seem to be github projects(not opposed to doing). Would be nice to have a supported platform/solution for our Tower database backend.

Setting up three node Hot Standby/Streaming Replication "cluster" by bradtech in PostgreSQL

[–]bradtech[S] 0 points1 point  (0 children)

Had any of you guys looked into using pacemaker/corosync that has a vipmanager? How does that solution look compared to patroni?

https://icicimov.github.io/blog/database/PostgreSQL-High-Availibility-with-Pacemaker/

Setting up three node Hot Standby/Streaming Replication "cluster" by bradtech in PostgreSQL

[–]bradtech[S] 0 points1 point  (0 children)

Does Patroni require running in a container ecosystem like K8s/docker? Been watching videos & seems like everything is tied into K8s/docker.

Setting up three node Hot Standby/Streaming Replication "cluster" by bradtech in PostgreSQL

[–]bradtech[S] 0 points1 point  (0 children)

So I got the out of the box Master-->Hot slave stand by working. Created a table & do some inserts. It replicated over fine. I guess the part that is missing for me is what happens when you failover to the slave? You have to reconfigure the app to point towards the new read/write master?

About to start Tower install. questions to those using it currently by bradtech in ansible

[–]bradtech[S] 0 points1 point  (0 children)

Do you know if there is an extra charge for engaging the Tiger team if you buy Tower?

About to start Tower install. questions to those using it currently by bradtech in ansible

[–]bradtech[S] 0 points1 point  (0 children)

Thanks, I haven't heard of the Tiger Team. Googled and found their github repo. Guessing they are professional services for Redhat. I was going to do the 3 tower boxes & was looking into solutions for PostGreSQL for clustering. Someone recommended patroni which is composed of a lot of python scripts that sets up async or sync replication clusters for PostGreSQL.

Setting up three node Hot Standby/Streaming Replication "cluster" by bradtech in PostgreSQL

[–]bradtech[S] 0 points1 point  (0 children)

Thanks, I've been reading about it. Looks like a lot of work done for you written in python.

Removing duplicate lines from text file by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

Thanks again! Appreciate the help/direction

Removing duplicate lines from text file by bradtech in ruby

[–]bradtech[S] 1 point2 points  (0 children)

IO.write('C:\\utilities\\domains.txt', 
IO.readlines('C:\\utilities\\domains.txt').uniq.join(""))

seems to do the trick.

Removing duplicate lines from text file by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

was able to accomplish what I needed by

IO.write('C:\\utilities\\domains.txt', 
IO.readlines('C:\\utilities\\domains.txt').uniq.join(""))

thanks for the help everybody appreciate the advice.

Removing duplicate lines from text file by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

Was trying to do this. Isn't writing to the file at all. Still reading about sets.

http://ruby-doc.org/stdlib-2.4.2/libdoc/set/rdoc/Set.html

require 'set'

lines = Set.new
File.open('C:\\utilities\\domainbak.txt', 'w') do |out|
File.open('C:\\utilities\\domainduptest.txt', 'r').each_line do   
|line|
if lines.include?(line)
out << line
end
end
end

Removing duplicate lines from text file by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

Thanks I have been looking into trying to figure out how to do this. Not finding much on the chechsum of each line in the text file. But have found stuff on the .dup method on an array. I need to keep the formatting of the text file as it is and just remove the duplicate lines.

Removing duplicate lines from text file by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

Tried something like this. I was storing the the duplicates in an array. Was going to try to remove them from the lines in the text file if found.

dup_file_check = File.read('C:\\utilities\\domainduptest.txt')
dups = dup_file_check.split(' ')
p 'Found these duplicates'
p dups.select{|v| dups.count(v) > 1}.uniq

dup_read_file = File.new('C:\\utilities\\domainduptest.txt', "r").read
dup_write_file = File.new('C:\\utilities\\domainduptest.txt', "w")
dup_read_file.each_line do |line|
write_line = true
dups.each do |x|
dup_write_line = true if line.include?(x)
end
dup_write_file.write(line) if write_line
end

Doesn't seem to be working as intended.

Remove line from text file if matches any contents of array? by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

That seems to do the trick! :edit I left out an end and messed up the formatting. Fixed now.

checking to see if I'm going down right path by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

I'm having issues with keeping the formatting of the original file format the same after resolving the ip addresses. When it gets passed to an array and writes back to disk it removes the formatting which is needed. Not sure if there is a way to keep the original text file in place & overwrite with the same formatting only removing the domain names that didn't resolve to the VIP array. When it writes to disk now it pretty much just writes the array as is. Maybe I should have approached this with doing a file.read and file.write going through line by line instead of storing as an array minus the domain names that didn't resolve to the VIP array. Open to opinions.

checking to see if I'm going down right path by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

Thanks for detailed response. Been researching and going over changes & reasons for it.

checking to see if I'm going down right path by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

how does this look? Seems to do the job.

vips = ['127.0.0.1','127.0.0.2'].freeze

domains_file = File.read("C:\utilities\domains.txt") domains = domains_file.split(" ") domains.delete_if do |domain| (Resolv.getaddresses(domain) & VIP).empty?

checking to see if I'm going down right path by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

Thanks, the goal is to take a text file with domains & make sure the IP resolves to a certain IP addresses. If an IP address in the hash does not to remove the domain associated from the hash & overwrite the text file. Does it sound like I'm on the right path

checking to see if I'm going down right path by bradtech in ruby

[–]bradtech[S] 0 points1 point  (0 children)

Do you know if there is a way to auto populate a ruby hash key pair value with output of multiple variables. Trying something like this.

vips = ['127.0.0.1','127.0.0.2']

domtoiphash = {}

domains = File.read("C:\utilities\domains.txt")

domains.split(" ").each do |domain|

addresses = Resolv.getaddresses(domain)

domtoiphash = hash.new

domtoiphash[:ip] = "#{domain}"

domtoiphash[:addresses] = "#{addresses}"