Announcement

Announcement Module
Collapse
No announcement yet.

Percona Cluster my.cnf with just one node

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Percona Cluster my.cnf with just one node

    I want to create a Percona XtraDB cluster with just one node (it's my dev machine, I need to have the same version as production (so it has to be XtraDB Cluster) but I don't need more than one node) but I can't get the my.cnf working.
    If I put the same as prod but taking out the information about the other nodes, it just doesn't start up.
    Can someone help me to create the minimum my.cnf file for a XtraB cluster with just one node?

    Thank you!

  • #2
    Do you get any errors on the error log? I suspect you are copying the value of wsrep_cluster_address, if you are starting just a single node, I suggest just putting gcom:// as its value. Show us your my.cnf :-)
    Our documentation has a lot of answers about common questions on Percona software, have you checked there before posting that question here? http://www.percona.com/forums/core/i...lies/smile.png

    Join us at the annual Percona Live MySQL Users Conference - http://www.percona.com/live/mysql-conference-2014/

    Comment


    • #3
      Hi revin, thanks for your reply.

      I do not get any error on the logs, here is what actually happens:
      Code:
      [root@FraDevDb ~]# /etc/init.d/mysql start --wsrep-cluster-address="gcomm://"
      Starting MySQL (Percona XtraDB Cluster). ERROR! The server quit without updating PID file (/data/mysql/mysql.pid).
       ERROR! MySQL (Percona XtraDB Cluster) server startup failed!
      I don't know where to look at

      Here is my.cnf file:

      Code:
      # Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208
      # Configuration name cube19-auth generated for jon@cube19.com at 2013-06-26 20:49:00
      
      [mysql]
      
      # CLIENT #
      port                            = 3306
      socket                          = /data/mysql/mysql.sock
      default-character-set=utf8
      
      [client]
      
      socket                          = /data/mysql/mysql.sock
      default-character-set=utf8
      
      [mysqld]
      
      # GENERAL #
      user                            = mysql
      default_storage_engine          = InnoDB
      socket                          = /data/mysql/mysql.sock
      pid_file                        = /data/mysql/mysql.pid
      
      # MyISAM #
      key_buffer_size                 = 32M
      myisam_recover                  = FORCE,BACKUP
      
      # SAFETY #
      max_allowed_packet              = 16M
      max_connect_errors              = 1000000
      skip_name_resolve
      sql_mode                        = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY
      sysdate_is_now                  = 1
      innodb                          = FORCE
      innodb_strict_mode              = 1
      
      # DATA STORAGE #
      datadir                         = /data/mysql/
      
      # BINARY LOGGING #
      log_bin                         = /data/mysql/mysql-bin
      expire_logs_days                = 7
      sync_binlog                     = 1
      
      # CACHES AND LIMITS #
      tmp_table_size                  = 32M
      max_heap_table_size             = 32M
      query_cache_type                = 0
      query_cache_size                = 0
      max_connections                 = 500
      thread_cache_size               = 50
      open_files_limit                = 65535
      table_definition_cache          = 1024
      table_open_cache                = 100
      
      # INNODB #
      innodb_flush_method             = O_DIRECT
      innodb_log_files_in_group       = 2
      innodb_log_file_size            = 64M
      innodb_flush_log_at_trx_commit  = 1
      innodb_file_per_table           = 1
      innodb_buffer_pool_size         = 512M
      
      # LOGGING #
      log_error                       = /data/mysql/mysql-error.log
      log_queries_not_using_indexes   = 1
      slow_query_log                  = 1
      slow_query_log_file             = /data/mysql/mysql-slow.log
      
      # UTF8 #
      collation-server = utf8_unicode_ci
      init-connect='SET NAMES utf8'
      character-set-server = utf8
      
      #### Cluster config ####
      # Path to Galera library
      wsrep_provider                                  = /usr/lib64/libgalera_smm.so
      
      # Cluster connection URL contains the IPs of all the nodes
      wsrep_cluster_address                   = gcomm://
      
      # In order for Galera to work correctly binlog format should be ROW
      binlog_format                                   = ROW
      
      # This is a recommended tuning variable for performance
      innodb_locks_unsafe_for_binlog  = 1
      
      # This changes how InnoDB auto-increment locks are managed and is a requirement for Galera
      innodb_autoinc_lock_mode                = 2
      
      # IP address of this node
      wsrep_node_address                              = 192.168.10.99
      
      # SST method
      wsrep_sst_method                                = xtrabackup
      
      # Cluster name
      wsrep_cluster_name                              = cluster
      
      # Authentication for SST method
      wsrep_sst_auth                                  = "sstuser:hello"

      Comment


      • #4
        Hi, francesco19

        As per u r my.cnf settings the error logs are stored in /data/mysql/mysql-error.log, for finding errors easily open 2 terminals and do tail -f /data/mysql/mysql-error.log in one terminal while u start mysql in another,and no need to start mysql with --wsrep-cluster-address="gcomm://" if u had already specified in my.cnf file.

        Comment


        • #5
          Hi madhusudan, thank for your reply.

          When I said "i get no error message" I meant in /data/mysql/mysql-error.log. When I try to start mysql nothing is written in that file.

          I'm thinking there is something
          syntactically wrong in my cnf file, since I've realised I've copied it from a 5.5.33 working instance to my 5.5.34, can be this?

          Comment


          • #6
            Sometimes when I face this problem, I try to start mysqld directly to see what errors come out. If you aren't seeing anything in the error log from mysqld, it's possible the problem is happening earlier in mysqld_safe

            Comment


            • #7
              @francesco19,

              well there are some other ways to find the root cause, did u try --verbose mode while starting mysql..?, also check whether mysql has permission to write to the error log file!, sometimes we forget to check that.!

              Comment


              • #8
                Ok, now I am confused. If I run mysqld it starts up! Even with mysqld_safe I see no errors.
                If I start it as usual (/etc/init.d/mysql start) it doesn't work (see post #3).
                mysql-error.log has the right permissions, and when I start it with mysqld it writes something in it so it definitely works.
                --verbose does not print anything unfortunately
                Last check I did was starting it up using "/etc/init.d/mysql start" but without any my.cnf and... it starts up! but with all the default configs of course.
                Cannot make it work with the config file!
                Last edited by francesco19; 01-21-2014, 03:36 PM.

                Comment


                • #9
                  found the problem:

                  Code:
                  echo 0 > /selinux/enforce
                  did the job.
                  Thanks everybody for helping anyway!

                  Comment


                  • #10
                    now that's good news... :-)

                    Comment

                    Working...
                    X