How To - Starting Stopping censhare
Here you can find information's about start / stop scripts
- What are the differences between rc scripts, s2s and SMF (Solaris - Service Management Facility)
- Which command options are possible
- Where are the config files located
- start / stop services manually - database (Oracle)- as root user
- start / stop services manually - listener (Oracle) - as root user
- start / stop services manually - listener (Oracle) - as oracle user
- start / stop services manually - database (PostgreSQL)- as root user
- start / stop services manually - censhare - as root user
- start / stop services manually - censhare - as censhare user
- start / stop services manually - jetty - as root user
- start / stop services manually - jetty - as censhare user
General explanation about the command functions
We've three ways to start or stop censhare rc scripts, s2s and SMF
On rc every service need a own script.
s2s knows the configuration, which service have to run on each servers. With s2s you can also move services from one to a other server (failover).
start / stop scripts - default - without s2s
/usr/sbin/rccenshare
/usr/sbin/rccss_jetty
/usr/sbin/rcora_censhare
/usr/sbin/rcora_lsnr
start / stop scripts with s2s (mostly used)
/etc/s2s/init.d/censhare
/etc/s2s/init.d/rccss_jetty
/etc/s2s/init.d/rcora_censhare
/etc/init.d/rcora_lsnr
Solaris SMF (svcadm/svcs)
check service state: svcs censhare*
disable/stop censhare-server: svcadm disable /censhare/server
disable/stop css_jetty: svcadm disable /censhare/css_jetty
enable/start censhare: svcadm enable /censhare/server
enable/start css_jetty: svcadm enable /censhare/css_jetty
restart censhare: svcadm restart /censhare/server
rccss
rccss {start | stop | status | restart}
check etc. censhare relevant services (no s2s)
s2s
s2s {start | stop | status | restart}
check etc. censhare relevant services (s2s)
Further Script
cssinfo.sh
/opt/corpus/bin/cssinfo.sh
information about installation
Config Files
cssinfo.sh
start / stop services manually - database (Oracle) - as root user
without s2s
rcora_censhare {start | stop | restart | status}
with s2s
s2s {start | stop | restart | status} ora_censhare
start / stop services manually - listener (Oracle) - as root user
without s2s
rcora_lsnr {start | stop | restart | status}
with s2s
s2s {start | stop | restart | status} ora_lsnr
start / stop services manually - listener (Oracle) & OS (Solaris) - as root user
stop listener manually
svcadm disable censhare/ora_lsnr
start listener manually
svcadm enable censhare/ora_lsnr
start / stop services manually - database (Oracle) & OS (Solaris) - as root user
stop Oracle manually
svcadm disable censhare/ora_censhare
start Oracle manually
svcadm enable censhare/ora_censhare
start / stop services manually - listener (Oracle) - as oracle user
start listener manually
lsnrctl start
stop listener manually
lsnrctl stop
show status listener manually (good output for diagnosis)
lsnrctl status
Note: You can start any service first but mostly we can start database first and then listener.
And during the stop service, first we stop the listener and then database.
start / stop services manually - database (Oracle) - as oracle user
stop oracle database by connecting to "sqlplus" by Oracle user (su - oracle).
details are given below how?
sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Nov 10 06:03:20 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
start oracle database by connecting to "sqlplus" from Oracle user, if it is shutdown and connected to "idle instance".
details are given below how?
sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Nov 10 06:04:47 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup;
ORACLE instance started.
Total System Global Area 2466250752 bytes
Fixed Size 2927384 bytes
Variable Size 671089896 bytes
Database Buffers 1778384896 bytes
Redo Buffers 13848576 bytes
Database mounted.
Database opened.
SQL>
To check the correct Oracle user(schema) to use for "sqlplus"
To check the correct Oracle user/password to use it for "sqlplus" to connect with the Oracle database. Oracle user & password as defined on the censhare service database configuration file on censhare application server. It is recommended to check the config.xml so that we can be 100% sure that we are connecting to the correct Oracle user/password by "sqlplus" and connected to the actual user/schema.
Also, you can find Oracle sqlplus "corpus" user(schema) password from the "TPM".
For example go to the an application server and check below configuration file in the below location for example and cat config.xml
ssh <application_server_name> -l corpus
X11 forwarding request failed on channel 0
Last login: Thu Feb 11 09:52:09 2021
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
corpus@<application_server_name>
cd cscs/app/services/database/
cat config.xml
You will find below line in this config.xml file:
<connection name="corpus" connection-url="jdbc:oracle:thin:@<db-servername>:1521:corpus" user-name="<db_username>" user-password="<username_password>"
So now, you can use below command to connect with Oracle "corpus" schema with "sqlplus" like as below from the Database server, you can use "username" & "password" from the "config.xml".
sqlplus username/password
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 11 11:10:52 2021
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
SQL>
To check oracle logfile - database (Oracle) as oracle user
Switch root user to oracle user
su - oracle OR so
Connect to "sqlplus" and check the oracle alert file location
example is given below how? You will get the oracle alert log file location by the below command:
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 10 06:34:35 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
show parameter background;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_core_dump string partial
background_dump_dest string /u01/app/oracle/diag/rdbms/corpus/corpus/trace
Now, in the above mentioned directory, you will find "alert_corpus.log" file and "tail" it OR "cat" it OR "vi" it.
cd /u01/app/oracle/diag/rdbms/corpus/corpus/trace/
tail -f alert_corpus.log
start / stop services manually - database (PostgreSQL) - as root user
To check how many postgres services are running
pgstatus
To check postgres service running status
systemctl status postgresql-10.service
start postgres manually
systemctl start postgresql-10.service
stop postgres manually
systemctl stop postgresql-10.service
restart postgres manually
systemctl restart postgresql-10.service
start / stop pg_receivewal service manually - database (PostgreSQL) - as root user
To check pg_receivewal service running status
systemctl status postgresql_receivewal.service
start pg_receivewal manually
systemctl start postgresql_receivewal.service
stop pg_receivewal manually
systemctl stop postgresql_receivewal.service
restart pg_receivewal manually
systemctl restart postgresql_receivewal.service
Connect Postgres by "postgres" OS user
Connect PostgreSQL database by "postgres" OS user. Postgres OS user, Postgres DB User & Corpus DB user password you can find out from TPM, if needed.
ssh <db-server-name> -l postgres
Connect "postgres" database by psql:
psql
Connect "corpus" database by "corpus" user:
psql -U corpus -d corpus
Also, we have one KB doc in which we have some general commands of PostgreSQL:
https://confluence.censhare.com/display/CKB/Most+Useful+PostgreSQL+Commands
To check postgresql_basebackup service manually - database (PostgreSQL) as root user
To check postgresql_basebackup service running status
systemctl status postgresql_basebackup.service
start postgresql_basebackup service manually
systemctl start postgresql_basebackup.service
stop postgresql_basebackup service manually
systemctl stop postgresql_basebackup.service
To check postgres logfile - database (PostgreSQL) as postgres user
Switch root user to postgres user
su - postgres OR sp
cd /var/lib/pgsql/10/data/log
(Note: Change the directory as 10 to 11 or 12, if PostgreSQL version is 11 or 12).
vi postgresql-Wed.log
(Note: See any log according to the day-wise as per the requirement)
start / stop services manually - censhare - as root user
start / stop censhare manually without s2s
rccenshare {start | stop | restart | status}
start / stop censhare manually s2s
s2s {start | stop | restart | status} censhare
start / stop services manually - censhare - as censhare user
censhare.rc {start | stop | restart | status}
start / stop services manually - jetty - as root user
start / stop censhare manually without s2s
rccss_jetty {start | stop | restart | status}
start / stop censhare manually s2s
s2s {start | stop | restart | status} css_jetty
start / stop services manually - jetty - as censhare user
css_jetty.rc {start | stop | restart | status}