Prepare for upgrading SENTIENT
Stop SENTIENT
Check if SENTIENT and database services are running
Initially SENTIENT, check status to ensure it is stopped and then databases.
1
| sudo systemctl stop sentient
|
1
| sudo systemctl status sentient
|
Backup Database
Make a backup of the database before upgrading.
PostgreSQL
Check PostgreSQL status. It is unnecessary to stop PostgreSQL for the backup.
1
| sudo systemctl status postgresql
|
Make sure you have enough space to place a backup of the database
Check database size
1
| sudo -u postgres psql -c "SELECT pg_size_pretty( pg_database_size('sentient') );"
|
Check free space
If there is enough free space - make a backup.
1
| sudo -Hiu postgres pg_dump sentient > sentient.sql.bak
|
Check backup file being created.
Cassandra
Check Cassandra status. It is necessary to stop Cassandra for the backup.
1
| sudo systemctl status cassandra
|
Flush all memtables from the node to SSTables on disk.
Stop Cassandra.
1
| sudo systemctl stop cassandra
|
And you have to check the status again to ensure they are surely stopped.
1
| sudo systemctl status cassandra
|
Make sure you have enough space to place a backup of the database
Check database size.
1
| du -h /var/lib/cassandra/ | tail -1
|
Check free space.
Make a backup of Cassandra database.
1
2
| mkdir backup
sudo tar -cvf backup/cassandra.tar /var/lib/cassandra
|
Check archive being created
Start Database
Cassandra
1
| sudo systemctl start cassandra
|
PostgreSQL
Do nothing, postgresql is already running.
Upgrading SENTIENT Professional Edition to 3.1.1
NOTE: These upgrade steps are applicable for SENTIENT version 3.1PE. In order to upgrade to 3.1.1PE you need to upgrade to 3.1PE first.
Prepare for upgrading SENTIENT.
SENTIENT Professional Edition package download
1
| wget https://dist.sentient.invenia.in/sentient-3.1.1pe.rpm
|
SENTIENT Professional Edition service upgrade
- Stop SENTIENT service if it is running.
1
| sudo service sentient stop
|
- Install Sentient Web Report component as described here.
1
| sudo rpm -Uvh sentient-3.1.1pe.rpm
|
NOTE: Package installer will ask you to merge your sentient configuration. It is preferred to use merge option to make sure that all your previous parameters will not be overwritten.
Please make sure that you set database.ts.type parameter value (in the file /etc/sentient/conf/sentient.yml) to “cassandra” instead of “sql” if you are using Cassandra database for timeseries data:
1
2
3
4
| database:
ts_max_intervals: "${DATABASE_TS_MAX_INTERVALS:700}" # Max number of DB queries generated by single API call to fetch telemetry records
ts:
type: "${DATABASE_TS_TYPE:sql}" # cassandra, sql, or timescale (for hybrid mode, DATABASE_TS_TYPE value should be cassandra, or timescale)
|
Execute regular upgrade script:
1
| sudo /usr/share/sentient/bin/install/upgrade.sh --fromVersion=3.1.0
|
Start the service
If you use Redis for caching, you need to flush all stored keys before starting the SENTIENT.
Connect to your Redis instance (or container/pod, depending on your setup) and run the command:
redis-cli flushall
Please note that this command is applicable only if you use Redis exclusively for SENTIENT. If other applications use Redis, you need to locate the SENTIENT database and flush only that. The default database index is 0, configurable with REDIS_DB SENTIENT environment value.
redis-cli
select 0
flushdb
1
| sudo service sentient start
|
Upgrading SENTIENT Professional Edition to 3.1
NOTE: These upgrade steps are applicable for SENTIENT version 3.0.1PE. In order to upgrade to 3.1PE you need to upgrade to 3.0.1PE first.
Prepare for upgrading SENTIENT.
SENTIENT Professional Edition package download
1
| wget https://dist.sentient.invenia.in/sentient-3.1pe.rpm
|
SENTIENT Professional Edition service upgrade
- Stop SENTIENT service if it is running.
1
| sudo service sentient stop
|
- Install Sentient Web Report component as described here.
1
| sudo rpm -Uvh sentient-3.1pe.rpm
|
NOTE: Package installer will ask you to merge your sentient configuration. It is preferred to use merge option to make sure that all your previous parameters will not be overwritten.
Please make sure that you set database.ts.type parameter value (in the file /etc/sentient/conf/sentient.yml) to “cassandra” instead of “sql” if you are using Cassandra database for timeseries data:
1
2
3
4
| database:
ts_max_intervals: "${DATABASE_TS_MAX_INTERVALS:700}" # Max number of DB queries generated by single API call to fetch telemetry records
ts:
type: "${DATABASE_TS_TYPE:sql}" # cassandra, sql, or timescale (for hybrid mode, DATABASE_TS_TYPE value should be cassandra, or timescale)
|
NOTE: Cassandra database does not support advanced filters. If you were using Cassandra database for timeseries data please make sure that database.ts_latest.type parameter value (in the file /etc/sentient/conf/sentient.yml) is “sql”:
1
2
3
4
| database:
...
ts_latest:
type: "${DATABASE_TS_LATEST_TYPE:sql}" # cassandra, sql, or timescale (for hybrid mode, DATABASE_TS_TYPE value should be cassandra, or timescale)
|
and execute the following migration script:
1
2
| # Execute script to migrate latest timeseries data from Cassandra to PostgreSQL
sudo /usr/share/sentient/bin/install/upgrade.sh --fromVersion=cassandra-latest-to-postgres
|
Execute regular upgrade script:
1
| sudo /usr/share/sentient/bin/install/upgrade.sh --fromVersion=3.0.1
|
Start the service
If you use Redis for caching, you need to flush all stored keys before starting the SENTIENT.
Connect to your Redis instance (or container/pod, depending on your setup) and run the command:
redis-cli flushall
Please note that this command is applicable only if you use Redis exclusively for SENTIENT. If other applications use Redis, you need to locate the SENTIENT database and flush only that. The default database index is 0, configurable with REDIS_DB SENTIENT environment value.
redis-cli
select 0
flushdb
1
| sudo service sentient start
|