CRS-4563: Insufficient user privileges.

For Oracle Clusterware some operations need root privileges like stopping cluster.

Here you can see :

-bash-3.2$ id
uid=500(oracle) gid=501(oinstall) groups=500(dba),501(oinstall)
-bash-3.2$ crsctl stop cluster -n ora1
CRS-4563: Insufficient user privileges.
CRS-4000: Command Stop failed, or completed with errors.

As you can see there is a problem with the privileges for that operation. Lets switch root user and retry operation.
-bash-3.2$ su -
Password:
[root@ora2 ~]# export GRID_HOME=/u01/app/11.2.0/grid
[root@ora2 ~]# export PATH=$GRID_HOME/bin:$PATH
[root@ora2 ~]# crsctl stop cluster -n ora1
CRS-2673: Attempting to stop 'ora.crsd' on 'ora1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'ora1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ora1'
CRS-2673: Attempting to stop 'ora.LISTENER_DB.lsnr' on 'ora1'
CRS-2673: Attempting to stop 'ora.rac.db' on 'ora1'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'ora1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'ora1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ora1' succeeded
CRS-2677: Stop of 'ora.LISTENER_DB.lsnr' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.ora1.vip' on 'ora1'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'ora1'
CRS-2677: Stop of 'ora.ora1.vip' on 'ora1' succeeded
CRS-2672: Attempting to start 'ora.ora1.vip' on 'ora2'
CRS-2677: Stop of 'ora.scan1.vip' on 'ora1' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'ora2'
CRS-2677: Stop of 'ora.registry.acfs' on 'ora1' succeeded
CRS-2676: Start of 'ora.ora1.vip' on 'ora2' succeeded
CRS-2676: Start of 'ora.scan1.vip' on 'ora2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'ora2'
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'ora2' succeeded
CRS-2677: Stop of 'ora.rac.db' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'ora1'
CRS-2677: Stop of 'ora.DATA.dg' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'ora1'
CRS-2677: Stop of 'ora.asm' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'ora1'
CRS-2673: Attempting to stop 'ora.eons' on 'ora1'
CRS-2677: Stop of 'ora.ons' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'ora1'
CRS-2677: Stop of 'ora.net1.network' on 'ora1' succeeded
CRS-2677: Stop of 'ora.eons' on 'ora1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'ora1' has completed
CRS-2677: Stop of 'ora.crsd' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'ora1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'ora1'
CRS-2673: Attempting to stop 'ora.evmd' on 'ora1'
CRS-2673: Attempting to stop 'ora.asm' on 'ora1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'ora1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'ora1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'ora1' succeeded
CRS-2677: Stop of 'ora.asm' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'ora1'
CRS-2677: Stop of 'ora.cssd' on 'ora1' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'ora1'
CRS-2677: Stop of 'ora.diskmon' on 'ora1' succeeded

Now it is succeeded.

Setting up Master – Slave and Master – Master MySQL Replication

If you are using MySQL as a database, one of the best solution is using MySQL Replication for High Availability.

Here is a short procedure for setting up replication :

  • Set one of server’s “server-id” parameter to any integer value different from the slave one.

For master mysql database :

# vi /etc/my.cnf

….

server-id     = 5   # This server’s id is 5

….

For slave mysql database

# vi /etc/my.cnf

….

server-id     = 6   # This server’s id is 6

….

  • Restart both MySQL servers for reload my.cnf files.

If you have mysql script under /etc/init.d/ , you can start and stop db servers running “service mysql stop” and “service mysql start” commands.

  • Login slave MySQL database server and run “fake” change master command. Please fill the MASTER_HOST information with the master host’s hostname.

mysql> CHANGE MASTER TO MASTER_HOST=’hostname’, MASTER_USER=’rep_user’,
-> MASTER_PASSWORD=’rep_pass’, MASTER_PORT=3306;

  • Now we will migrate the data from the master host to the slave one. First export full master database to alldb.sql using below command.

# mysqldump -uroot -p –all-databases –single-transaction  –master-data=1  > alldb.sql

  • scp the dump file (alldb.sql) to the slave node from the master node.

# scp alldb.sql slave_node:

  • Import this file to the slave mysql database.

# mysql -uroot -p < alldb.sql

  • When import operation finishes, you can logon the slave database and enable slave mode running :

mysql> start slave;

  • You can check running “show slave status \G” on the slave server. Both Slave_IO_Running and Slave_SQL_Running must be run. (“Yes” indicates that it is running)

mysql> show slave status \G

…..

Slave_IO_Running: Yes
Slave_SQL_Running: Yes

….

  • Now test time !!

create a table to the master database under test schema and see that it comes to slave database..

If you want to set up Master-Master Replication , you perform a CHANGE MASTER command on the first host taking MASTER_LOG_FILE and MASTER_LOG_POS values from the slave.

On Slave:

mysql> show master status \G
*************************** 1. row ***************************
File: db2-bin.000004
Position: 588484588
Binlog_Do_DB:
Binlog_Ignore_DB:

On Master:

CHANGE MASTER TO
MASTER_HOST=’db2′,
MASTER_USER=rep_user’,
MASTER_PASSWORD=’rep_pass’,
MASTER_PORT=3306,
MASTER_LOG_FILE=’db2-bin.000004′,
MASTER_LOG_POS=588484588;

Good Luck 🙂