1. Jiffy application server restart - activities to be performed in sequence


Start nginx: ( Manual start)

Command to start, reload, stop nginx

      

   sudo nginx


   sudo nginx -s reload

   sudo nginx -s quit


Start Rabbitmq: ( Autostart )

By default rabbitmq will start on system boot.

      Command to start, restart, stop and status

      sudo rabbitmq-server start

      sudo rabbitmq-server stop

      sudo rabbitmq-server restart

      sudo rabbitmq-server status


Jiffy DB server - Postgres: ( Autostart )

       The DBA needs to manage the Jiffy DB and associated activities. Please see the DB backup/cleanup section below for specific commands.


The database configuration for jiffy can be found in the DATABASES section in local_settings.py file located in /<mountpoint>/jiffy/deploy/jiffy/src/SterlingTester/local_settings.py

You can use either pgAdmin or sqldeveloper to connect with these credentials.


Jiffy Admin Module ( Manual start )

      Steps to start JAM

  1. Login to Jiffy application server

  2. Start nginx

  3. Switch to jiffy application user

  4. cd /<mount point>/JAM/conf

  5. Run below command

  6. nohup ./gunicorn.sh &

  7. cd /<mount point>/JAM/JAM

  8. nohup python jiffy_start.py &


Command to check JAM process.


ps -ef | grep jam

ps -ef | grep jiffy_start.py



Jiffy Application Start ( Manual start )

   

 Login to JAM (as admin user)

Stop

→ Jiffy Admin→ jiffy Server → stop jiffy

Start

→ Jiffy Admin→ jiffy Server → Start jiffy


For more information, please ref support portal link for JAM :

https://support.runjiffy.com/support/solutions/articles/8000062308-jiffy-admin-module-jam-


Jiffy expression node start  (Manual start)

  1. Login to jiffy app server using putty.

  2. Switch to jiffy expression user

    1. su jiffyexp-usr

    2. Step to start

      1. cd /<mount point>/jiffy/expression

      2. Activate expression environment

      3. source /<Mount point>/jiffy/expression/jiffyexpenv/bin/activate

      4. Run below to start jiffy expression

      5. ./start_expression.sh

    3.  Step to stop

                           Search for jiffy expression process

                            ps -ef | grep jiffy-service

                            kill -9 <jiffy-service pid>



2. Database backup: 


Database backups need to be preformed regularly to a separate disk out of the app server environment. This can be configured in a crontab and frequency set.


The command to backup a postgres DB schema is given below :

pg_dump -h <db_server_IP> -p 5432 -U <db_username> <db_name> | gzip > /path/dbbackup_filename.gz



The command to backup a oracle DB schema is given below :

expdp db_username/db_passwd@SID dumpfile="dbbackup_filename.dmp"


Eg : /usr/oracle/app/product/11.2.0/dbhome_1/bin/expdp user1/passwd1@o3_DB dumpfile="jiffy_ora_backup.dmp"


3. Jiffy DB Cleanup + Disk cleanup:


Jiffy DB size can be reduced by cleaning up old execution history data. What gets deleted is the execution history prior to the date that you provide to the script. Testcases/tasks are not deleted.


Sql script below which deletes all history prior to 21-Nov-2017:


-- JIFFY_EXECITERATIONINFO
delete  from JIFFY_EXECITERATIONINFO where EXECUTION_ITERATION_ID in (
select ID from jiffy_executioniteration where execution_step_id in
(select ID from JIFFY_EXECUTIONSTEP where TEST_EXECUTION_ID in
(select ID from JIFFY_TESTEXECUTION where EXECUTED_ON < to_timestamp('2017-11-21', 'YYYY-MM-DD') )))

-- JIFFY_EXECUTIONSTEPINFO
delete  from JIFFY_EXECUTIONSTEPINFO where EXECUTION_STEP_ID  in (
select ID from JIFFY_EXECUTIONSTEP where TEST_EXECUTION_ID in
(select ID from JIFFY_TESTEXECUTION where EXECUTED_ON < to_timestamp('2017-11-21', 'YYYY-MM-DD') ))

--  jiffy_executioniteration
delete  from jiffy_executioniteration where execution_step_id in
(select ID from JIFFY_EXECUTIONSTEP where TEST_EXECUTION_ID in
(select ID from JIFFY_TESTEXECUTION where EXECUTED_ON < to_timestamp('2017-11-21', 'YYYY-MM-DD')))

-- JIFFY_EXECUTIONSTEP
delete  from JIFFY_EXECUTIONSTEP where TEST_EXECUTION_ID in
(select ID from JIFFY_TESTEXECUTION where EXECUTED_ON < to_timestamp('2017-11-21', 'YYYY-MM-DD'))

--JIFFY_TESTEXECUTION
delete from JIFFY_TESTEXECUTION where EXECUTED_ON < to_timestamp('2017-11-21', 'YYYY-MM-DD');


Along with the Jiffy DB cleanup the corresponding files in the app server needs to be cleaned up - primarily screenshots and email attachments. For the same date above the files in the following folders should be deleted.


1) /<mount point>/jiffy/data/execution/screenshots

2) /<mount point>/jiffy/data/email


Eg : find  /opt/jiffy/data/execution/screenshots/* -mtime +10 -exec rm {} \;


This command above will delete all files under the screenshots folder older than 10 days.



For more details on trouble shooting and FAQs please see the link below :

https://support.runjiffy.com/solution/articles/8000041136-trouble-shooting-and-monitoring