zum archivieren bestimmter Prozeduren...
wie etwa das Upgrade von Splunk Standalone wenn man die vorherige Version noch behalten will.
Also pack ich solche Sachen mal hier hin.
download_path="$(curl -s https://www.splunk.com/en_us/download/splunk-enterprise.html | grep -o "data-link[^ ]* " | grep "Linux" | sed "s/data-link=\"//;s/\"//")"
file=${download_path##*/}
wget -4 ${download_path}
mkdir ${file%.tgz}
splunk stop
for i in $(ls current | grep -v "var\|manifest"); do cp -r current/$i ${file%.tgz}; done
tar xvzf ${file} --strip-components 1 -C ${file%.tgz}
rm current
ln -s ${file%.tgz} current
splunk start --accept-license --answer-yesdownload_path="$(curl -s https://www.splunk.com/en_us/download/splunk-enterprise.html | grep -o "data-link[^ ]* " | grep "Linux" | sed "s/data-link=\"//;s/\"//")"
file=${download_path##*/}
wget -4 ${download_path}
mkdir ${file%.tgz}
splunk stop
for i in $(ls current | grep -v "var\|manifest"); do cp -r current/$i ${file%.tgz}; done
tar xvzf ${file} --strip-components 1 -C ${file%.tgz}
rm current
ln -s ${file%.tgz} current
splunk start --accept-license --answer-yesAls ich o.a. Upgrade durchgeführt habe,
Weigerte sich der KV-Store hartnäckig zu starten.
~$ splunk show kvstore-status
This member:
backupRestoreStatus : Ready
.
.
.
standalone : 1
status : failed
storageEngine : wiredTiger~$ splunk show kvstore-status
This member:
backupRestoreStatus : Ready
.
.
.
standalone : 1
status : failed
storageEngine : wiredTigersplunk migrate migrate-kvstore schlug allerdings auch fehl
~$ splunk migrate migrate-kvstore [App Key Value Store migration] Starting migrate-kvstore. [App Key Value Store migration] NOTE: Lock file is not empty. If migration fails, stop the service (if it is running), delete the lock file, and run the migration again. Started standalone KVStore update, start_time="2023-08-09 17:05:23". [App Key Value Store migration] Checking if migration is needed. Upgrade type 1. This can take up to 600seconds. WARN: [App Key Value Store migration] Service(40) terminated before the service availability check could complete. Exit code 14, waited for 0 seconds. App Key Value Store migration failed, check the migration log for details. After you have addressed the cause of the service failure, run the migration again, otherwise App Key Value Store won’t function.
~$ splunk migrate migrate-kvstore
[App Key Value Store migration] Starting migrate-kvstore.
[App Key Value Store migration] NOTE: Lock file is not empty. If migration fails, stop the service (if it is running), delete the lock file, and run the migration again.
Started standalone KVStore update, start_time="2023-08-09 17:05:23".
[App Key Value Store migration] Checking if migration is needed. Upgrade type 1. This can take up to 600seconds.
WARN: [App Key Value Store migration] Service(40) terminated before the service availability check could complete. Exit code 14, waited for 0 seconds.
App Key Value Store migration failed, check the migration log for details. After you have addressed the cause of the service failure, run the migration again, otherwise App Key Value Store won’t function.Ich versuchte einem Hinweis zu folgen, das man alle mongod-3.6 files aus $SPLUNKHOME/bin entfernen sollte.
~/current/bin$ ls mongo* mongod mongod-3.4 mongod-3.6 mongod-4.0 mongodump mongodump-3.6 mongorestore mongorestore-3.6 ~/current/bin$ mv mongod-3.4 mongod-3.6 mongodump-3.6 mongorestore-3.6 ~/
~/current/bin$ ls mongo*
mongod mongod-3.4 mongod-3.6 mongod-4.0 mongodump mongodump-3.6 mongorestore mongorestore-3.6
~/current/bin$ mv mongod-3.4 mongod-3.6 mongodump-3.6 mongorestore-3.6 ~/Ein splunk start und ein darauf folgendes splunk show kvstore-status zeigte ein status : starting was nach einem langen timeout einem status : failed endete.
Alles was anders ist als bei den Versuchen davor ist gut.
Also noch einmal eine Migration probiert.
~/current/bin$ splunk migrate migrate-kvstore [App Key Value Store migration] Starting migrate-kvstore. [App Key Value Store migration] NOTE: Lock file is not empty. If migration fails, stop the service (if it is running), delete the lock file, and run the migration again. Created version file path=/opt/splunk/current/var/run/splunk/kvstore_upgrade/versionFile40 [App Key Value Store migration] Binary for service(36) is missing. ~/current/bin$ mv ~/mongod-3.6 . ~/current/bin$ splunk migrate migrate-kvstore [App Key Value Store migration] Starting migrate-kvstore. [App Key Value Store migration] NOTE: Lock file is not empty. If migration fails, stop the service (if it is running), delete the lock file, and run the migration again. [App Key Value Store migration] Checking if migration is needed. Upgrade type 2. This can take up to 600seconds. [App Key Value Store migration] Migration is not required. Created version file path=/opt/splunk/current/var/run/splunk/kvstore_upgrade/versionFile42 Finished standalone KVStore update, stop_time="2023-08-10 08:32:48".
~/current/bin$ splunk migrate migrate-kvstore
[App Key Value Store migration] Starting migrate-kvstore.
[App Key Value Store migration] NOTE: Lock file is not empty. If migration fails, stop the service (if it is running), delete the lock file, and run the migration again.
Created version file path=/opt/splunk/current/var/run/splunk/kvstore_upgrade/versionFile40
[App Key Value Store migration] Binary for service(36) is missing.
~/current/bin$ mv ~/mongod-3.6 .
~/current/bin$ splunk migrate migrate-kvstore
[App Key Value Store migration] Starting migrate-kvstore.
[App Key Value Store migration] NOTE: Lock file is not empty. If migration fails, stop the service (if it is running), delete the lock file, and run the migration again.
[App Key Value Store migration] Checking if migration is needed. Upgrade type 2. This can take up to 600seconds.
[App Key Value Store migration] Migration is not required.
Created version file path=/opt/splunk/current/var/run/splunk/kvstore_upgrade/versionFile42
Finished standalone KVStore update, stop_time="2023-08-10 08:32:48".Ein nach dem splunk start und splunk show kvstore-status --verbose zeigte er ein status : ready und serverVersion : 4.2.17 an.
Im nachhinein betrachtet, nehme ich an, dass die vorherigen Migrationsversuche durch das file mongod-3.4 in $SPLUNKHOME/bin behindert wurden.