Percona XtraDB Cluster with python3 mysql

Percona XtraDB Cluster

# aptitude install curl rsync
# curl http://www.percona.com/downloads/RPM-GPG-KEY-percona | apt-key add -

insert /etc/apt/sources.list

deb http://repo.percona.com/apt squeeze main

# aptitude update
# aptitude install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup

insert /etc/mysql/my.cnf

[mysqld]
binlog_format=ROW
wsrep_provider=/usr/lib64/libgalera_smm.so
wsrep_cluster_address=gcomm://
wsrep_slave_threads=2
wsrep_cluster_name=xtradbClusterTest
wsrep_sst_method=rsync
wsrep_node_name=node1
innodb_locks_unsafe_for_binlog=1
innodb_autoinc_lock_mode=2

/etc/init.d/mysql restart

ADD a new mysql cluster node

1. Change “wsrep_node_name” to be unique for every new node
2. Change “wsrep_cluster_address=gcomm://” to “wsrep_cluster_address=gcomm://[ip of a running node]”

copy /etc/mysql/debian.cnf from master node to new node

python3 and MySQL-python

insert /etc/apt/sources.list

# Backports repository
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free

# aptitude update
# aptitude install python3 python3-pip libmysqlclient-dev python-dev libevent-dev
# easy_install -U distribute
# pip install MySQL-python

LC_ALL = (unset),

จาก blog เก่า perl-warning-setting-locale-failed

ตอนนี้มี parameter เพิ่มมาครับ

Traceback (most recent call last):       
  File "/usr/bin/apt-listchanges", line 33, in <module>
    from ALChacks import *
  File "/usr/share/apt-listchanges/ALChacks.py", line 32, in <module>
    sys.stderr.write(_("Can't set locale; make sure $LC_* and $LANG are correct!\n"))
NameError: name '_' is not defined
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = "en_US:en",
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

แก้โดย

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8

แล้วทำการ

dpkg-reconfigure locales