CoreOS can seem daunting at first. This tutorial is built to encourage you in your journey and to demonstrate the power of this minimalistic operating system.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CLEAN UP RECORDS | |
DROP PROCEDURE IF EXISTS cloud.nf_destroy_historical_data; | |
delimiter // | |
CREATE PROCEDURE cloud.nf_destroy_historical_data(IN tableName VARCHAR(255), IN columnCriteria VARCHAR(255), IN batchSize INTEGER, IN intervalDays INTEGER, IN dryRun INTEGER, IN debugOn INTEGER) | |
BEGIN | |
SET @count_rows_query = CONCAT("SELECT count(id) INTO @table_row_count FROM ", tableName); | |
SET @min_id_query = CONCAT("SELECT MIN(id), MAX(id) INTO @a, @m FROM ", tableName, " WHERE ", columnCriteria, " < DATE_SUB(CURRENT_DATE(), INTERVAL ", intervalDays, " DAY)"); | |
SET @get_batch_query = CONCAT("SELECT id INTO @z FROM ", tableName, " WHERE id >= @a ORDER BY id LIMIT ", batchSize, ",1"); | |
SET @delete_batch_query = CONCAT("DELETE FROM ", tableName, " where id >= @a AND id < @z AND ", columnCriteria, " < DATE_SUB(CURRENT_DATE(), INTERVAL ", intervalDays, " DAY)"); | |
SET @dry_run_delete_batch_query = CONCAT("SELECT COUNT(*) FROM ", tableName, " where id >= @a AND id < @z AND ", columnCriteria, " < DATE_SUB(CURRENT_DATE(), I |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
users: | |
- name: core | |
passwd: $6fJRjBeFH.J. | |
write-files: | |
- path: /opt/bin/wupiao | |
permissions: '0755' | |
content: | | |
#!/bin/bash | |
# [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
coreos: | |
update: | |
reboot-strategy: best-effort | |
etcd: | |
discovery: https://discovery.etcd.io/5bd13a16d1852c1ef38726305ea7b0be | |
addr: $private_ipv4:4001 | |
peer-addr: $private_ipv4:7001 | |
fleet: |