How-to on owncloud services

How-to on owncloud services

 

GLUSTERFS ON OWNCLOUD NODES:

 

Alert Type and  info : PROBLEM Service Alert: zedostorage1.juhu.zedo.com/Glusterfs_server is CRITICAL

Additional info:

PROCS CRITICAL: 0 processes with command name glusterfsd

 

Steps:

  1. Check if glusterfsd server process is running. If not start the process with below command.
  1. If glusterfsd server running you can see below process.

root@owncloud1:~# ps -ef | grep glusterfsd

root      6131     1  0 01:18 ?        00:00:00 /home/glusterfs/sbin/glusterfsd -p /var/run/glusterfsd.pid -f /home/glusterfs/etc/glusterfs/glusterfs_server_owncloud.vol -l /home/glusterfs/var/log/glusterfs/glusterfs-server.log

  1.       b) Start the glusterfsd server process ( startup script can find under /etc/init.d ).

          /etc/init.d/glusterfsd start

     

Alert Type and  info : PROBLEM Service Alert: zedostorage1.juhu.zedo.com/Glusterfs_client is CRITICAL

Addition info:  

PROCS CRITICAL: 0 processes with command name glusterfs

 

Steps:

  1. Check if glusterfs client process is running. If not running start the process.
  1. If glusterfs client running you can see below process.

 root@owncloud1:~# ps -ef | grep glusterfs

root      1290     1  0 Apr05 ?        00:01:25 /home/glusterfs/sbin/glusterfs -f /home/glusterfs/etc/glusterfs/glusterfs_client_owncloud.vol /home/owncloud/gluster-mount-data -l /home/glusterfs/var/log/glusterfs/gluster-client.log

   

    b ) If not running start the process from the script placed in init.d

          sh /etc/init.d/glusterfs-client.sh

 

If both the glusterfs server and  client process are running you can see the mount points, verify the same.

root@owncloud1:~# df -h

/home/glusterfs/etc/glusterfs/glusterfs_client_owncloud.vol    844G   14G  787G   2% /home/owncloud/gluster-mount-data

 

  

 

PGPOOL ON OWNCLOUD NODES:

 

Alert Type and info:

PROBLEM Service Alert: zedostorage1.juhu.zedo.com/check_pgpool_connection_node1 is UNKNOWN **

Additional Info:

Critical

 

Steps:

  1. Check if pgpool is running if not running start the process.
  1. If  pgpool is running you can see below process.

root@owncloud1:~# ps -ef | grep pgpool.conf

root      7072  4368  0 01:47 pts/2    00:00:00 grep –color=auto pgpool.conf

postgres 14218     1  0 Apr05 ?        00:00:20 /home/postgres/pgpool/bin/pgpool -n -f /home/postgres/pgpool/etc/pgpool.conf -F /home/postgres/pgpool/etc/pcp.conf

 

  1.     b) If pgpool is not running start the process from the startup script.

       root@owncloud1:~# sh /etc/init.d/start_pgpool

 

Alert Type and info:

PROBLEM Service Alert: zedostorage1.juhu.zedo.com/check_pgpool_connection_node1 is CRITICAL

Additional Info:

Critical

 

Steps:

  1. Check if the postgres database running on both nodes node1 ( 172.16.1.90 ) and node2 (172.16.1.91 ) ( Steps to check is mentioned in POSTGRESQL ON OWNCLOUD NODES: section )

           Verify with below command if both database slave and master are up.

             postgres@owncloud1:~$ /home/postgres/pgsql-9.3.6/bin/repmgr -f /home/postgres/pgsql-9.3.6/repmgr/repmgr.conf cluster show

Role      | Name                    | Upstream                | Connection String

———-+————————-|————————-|———————————————————

* master  | owncloud2.juhu.zedo.com |                         | host=172.16.1.91 port=5432  dbname=postgres

 standby | owncloud1.juhu.zedo.com | owncloud2.juhu.zedo.com | host=172.16.1.90 port=5432 user=postgres dbname=postgres

          

 

  1. Check if postgresql  master and slave ( 172.16.1.91 or 172.16.1.90 ) nodes are attached to pgpool, if not attached the nodes to pgpool.

 

How to check:

Syntax:

/home/postgres/pgpool/bin/pcp_node_info timeout-value localhost port user password node-value | awk ‘{print$3}’

Here: node-value 0 means node1 ( 172.16.1.90 )

        Node-value 1 means node2 ( 172.16.1.91 )

 

root@owncloud1:~#  /home/postgres/pgpool/bin/pcp_node_info 10 localhost 9898 postgres postgres 0 | awk ‘{print$3}’

3

 

3 means postgresql is not attached to pgpool so attach the node to pgpool. If the output is 1 or 2 then its fine.

 

Attach the particular node to pgpool.

root@owncloud1:~#  /home/postgres/pgpool/bin/pcp_attach_node 10 localhost 9898 postgres postgres 0

Verify:

root@owncloud1:~# /home/postgres/pgpool/bin/pcp_node_info 10 localhost 9898 postgres postgres 0 | awk ‘{print$3}’

1

 

ON MASTER PGPOOL the output should be 2 like below.

root@owncloud2:~# /home/postgres/pgpool/bin/pcp_node_info 10 localhost 9898 postgres postgres 0 | awk ‘{print$3}’

2

root@owncloud2:~# /home/postgres/pgpool/bin/pcp_node_info 10 localhost 9898 postgres postgres 1 | awk ‘{print$3}’

2

 

How to find current node is master pgpool or not?

 

Virtual  interface/ip(172.16.1.88)  is assigned to master pgpool as below:

root@owncloud2:~# ifconfig | grep 0:0

eth0:0    Link encap:Ethernet  HWaddr 38:60:77:1a:b3:fd  

 

If the master pgpool goes down slave pgpool becomes master with auto failover methord, earlier one master pgpool will becomes slave when it comes up.

 

==================================================================

 

POSTGRESQL ON OWNCLOUD NODES:

 

Alert Type and info:

PROBLEM Service Alert: zedostorage1.juhu.zedo.com/Check_postgresdb_up is UNKNOWN

Additional Info:

UNKNOWN = failed to connect

 

Steps:

  1. Check if postgresql server process  is running. If not please start the postgres server.

How to verify if its running or not.

  1. Do netstat for port 5432 if not output for this port it means its not running.

          netstat -tulnp | grep 5432

  1.      b) postgres@owncloud4:~$ ps fU postgres | grep data

9092 pts/2    S+     0:00  \_ grep data

1458 ?        S      0:52 /home/postgres/pgsql-9.3.6/bin/postgres -D /home/postgres/data-9.3.6

 

  1. If not running start the process from postgres user with below command and verify as mentioned above.

postgres@owncloud1:~$ /home/postgres/pgsql-9.3.6/bin/pg_ctl -D /home/postgres/data-9.3.6 -l /home/postgres/data_log start

 

You can also find if anyone of the database down with below command. Also can find if master or slave is down.

root@owncloud1:~# su – postgres

postgres@owncloud1:~$ /home/postgres/pgsql-9.3.6/bin/repmgr -f /home/postgres/pgsql-9.3.6/repmgr/repmgr.conf cluster show

Role      | Name                    | Upstream                | Connection String

———-+————————-|————————-|———————————————————

* master  | owncloud2.juhu.zedo.com |                         | host=172.16.1.91 port=5432  dbname=postgres

 standby | owncloud1.juhu.zedo.com | owncloud2.juhu.zedo.com | host=172.16.1.90 port=5432 user=postgres dbname=postgres

 

 

  • What to do if slave or standby postgresql is down ?

 

When the slave or standby postgres database comes up perform below steps to have identical data on both nodes master and slave.

 

  1. Stop the database on slave node.

    postgres@owncloud1:~$ /home/postgres/pgsql-9.3.6/bin/pg_ctl -D /home/postgres/data-9.3.6 -l /home/postgres/data_log stop

 

  1. Perform below steps on master postgres node.

Copy the master server’s data to standby server

 

postgres@owncloud1:~$ /home/postgres/pgsql-9.3.6/bin/psql -c “SELECT pg_start_backup(‘label’, true)”

Pg_start_backup

 

0/4000020

(1 row)

 

postgres@owncloud1:~$  rsync -a /home/postgres/data-9.3.6/* postgres@slavenodeip:/home/postgres/data-9.3.6/ –exclude postmaster.pid

 

postgres@owncloud1:~$ /home/postgres/pgsql-9.3.6/bin/psql -c “SELECT pg_stop_backup()”

NOTICE:  pg_stop_backup complete, all required WAL segments have been archived

pg_stop_backup

—————-

0/40000D8

(1 row)

 

This will  copy all the configuration parameters and authentication related stuff from primary to standby slave.

Ensuring that the slave can be converted to a master/primary in case of a failover.

 

  1. Copy recovery.conf- to recovery.conf on slave

:~$ cp data-9.3.6/recovery.conf-    data-9.3.6/recovery.conf

 

  1. What to do if master postgresql server goes down?
  1. If master postgresql server goes down touch the below file on slave to make slave to master.

:~$ touch /home/postgres/archive_xlogs/trigger_file

      

       Verify:

     postgres@owncloud4:~$ ps fU postgres | grep ” wal writer “

26810 pts/2    S+     0:00  \_ grep  wal writer

25853 ?        Ss     0:00  \_ postgres: wal writer process

 

      

 

      2) When the previous  master server comes up it will be  salve and Do

Copy the master server’s data to standby server  as mentioned above and stop start the slave server.

 

 

 

Advertisements