Labels
amazon
apache
apt
aptitude
automate docker image
awk
aws
awstat
backup
bandwidth
bash
binary log
bond
bridge
caching
centos
centos 7
cluster
concurrency
csv
digitalocean
disk
django
docker
docker images
dovecot
drop cache
enviroment
error
explain
free
fstab
ftp
git
gluster
go
gpg
grep
grub
header
header check
icinga2
imapsync
information
innodb
ip
iproute
isolation
ispconfig
java
jenkins
jump
kdump
keepalived
kvm
linux
locale
logbuffer
lookbehind
macos
mail
maillog
matplotlib
mcrypt
memory
modrewrite
monitoring
mount
msyql ndbcluster
mta
multipath
mutt
my.cnf
mysql
mysql error
mysql optimization
mysql permission
mysqlcluster
mysqldump
nethogs
network
nginx
node
nopasswd
ntp
nxlog
openssl
optimization
parsing
parted
password
pflogsumm
php
php-fpm
php5-mcrypt
phpmyadmin
pip
policyd
post
postfix
proxy
pycurl
python
query_cache
querydict
rdesktop
rds
recommender systems
recover mysql
redhat
redolog
regex
regularexpression
resilver
roundcube
route
rsync
scrapy
script
scrub
security
service
setfacl
sftp
slow
smtp
snnp
spamassassin
spotlight
sql
squirrelmail
ssc
ssh
ssh-copy-id
ssl
startup
syslog
syslog over tls
tar
telnet
tls
tomcat
transaction
troubleshoot
tuning
ubuntu
udev
ulimit
usb
vdev removal
virtualhost
virtualization
virtualmin
vrrp
watch
webscrape
wget
x11
zfs
zfs send
zfs recv
zpool
imapsync
This summary is not available. Please
click here to view the post.
linux, web, ispconfig3, python, bash, apache
imapsync
tar backup and restore
To Create the Backup Archive:
sudo tar -cvpzf yourbackupfilename.tar.gz --exclude=/path/to/backup/yourbackupfilename.tar.gz --one-file-system /
In the last part of the command a single forward slash will backup the entire root directory, or you can specify a certain directory to backup.
Restoring your backup:
sudo tar -xvpzf /path/to/yourbackupfilename.tar.gz -C /directory/to/restore/to --numeric-owner
If restoring a complete root directory backup the last section of this command would simply be a forward slash /
sudo tar -cvpzf yourbackupfilename.tar.gz --exclude=/path/to/backup/yourbackupfilename.tar.gz --one-file-system /
In the last part of the command a single forward slash will backup the entire root directory, or you can specify a certain directory to backup.
Restoring your backup:
sudo tar -xvpzf /path/to/yourbackupfilename.tar.gz -C /directory/to/restore/to --numeric-owner
If restoring a complete root directory backup the last section of this command would simply be a forward slash /
grep email address from file
grep -E -o "\b[_a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b"
E=extended regex
o=only print matching string
linux, web, ispconfig3, python, bash, apache
grep,
regularexpression
optimum mysql configuration
[mysql]
# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid
# MyISAM #
key-buffer-size = 32M
myisam-recover = FORCE,BACKUP
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000
sort_buffer_size = 1073741824
myisam_sort_buffer_size = 1073741824
# DATA STORAGE #
datadir = /var/lib/mysql/
# BINARY LOGGING #
#log-bin = /var/lib/mysql/mysql-bin
#expire-logs-days = 14
#sync-binlog = 1
# CACHES AND LIMITS #
#tmp-table-size = 32M
#max-heap-table-size = 32M
tmp-table-size = 1G
max-heap-table-size = 1G
query-cache-type = 0
query-cache-size = 0
max-connections = 500
thread-cache-size = 50
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 4096
join_buffer_size = 1048576
# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 256M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 12G
# LOGGING #
log-error = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
linux, web, ispconfig3, python, bash, apache
my.cnf,
mysql optimization
wget recursive ftp download folder
wget -m --ask-password --user="ftpuser@footballfan.com" ftp://11.18.99.4/
create network bridge in ubunut 14.04
sudo apt-get update sudo apt-get install bridge-utilsvim /etc/network/interfaces
auto lo
iface lo inet loopback
#10.0.2.193 Bcast:10.0.3.255 Mask:255.255.254.0
auto br0
iface br0 inet static
address 10.0.2.193
netmask 255.255.254.0
gateway 10.0.2.1
dns-nameservers 202.94.66.2 8.8.8.8
#set static route for LAN
post-up route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1 dev br0
bridge_ports eth1
bridge_stp off
bridge_fd 0
bridge_maxwait 0
#bridge_stp off is a setting for spanning tree. If you have a possibility for network looks, you may want to turn this on.
#bridge_fd 0 turns off all forwarding delay. If you do not know what this is, you probably do not need it.
#bridge_maxwait 0 is how long the system will wait for the Ethernet ports to come up. Zero is no wait.
auto br0 iface br0 inet static address 192.168.0.201 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 8.8.8.8 8.8.4.4 bridge_ports eth0 bridge_stp offsome more commands
ip addr flush dev <interface 1>
ip addr flush dev <interface 2>
brctl addbr <bridge name>
brctl addif <bridge name> <interface 1> <interface 2>
ip link set dev <bridge name> up
part 2 datanode and sql node
Configure Data Nodes
These steps must be performed on BOTH data nodes.
Configure the firewall.
iptables -A INPUT -p tcp --dport 2200 -j ACCEPT
Download the MySQL cluster packages
wget http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
Install MySQL cluster server package
yum remove -y mysql-libs
mv http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar /usr/local/src
cd /usr/local/src
tar xvf MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
rpm -Uvh MySQL-Cluster-server-gpl-7.3.6-2.el6.x86_64.rpm
Create data node config file.
nano /etc/my.cnf
[mysqld]
ndbcluster
ndb-connectstring=10.10.1.10
ndb-connectstring=10.10.1.11
[mysql_cluster]
ndb-connectstring=10.10.1.10
ndb-connectstring=10.10.1.11
#############################
Configure SQL Nodes
These steps must be performed on BOTH SQL nodes
Configure the firewall (If you're running a local webserver, this step isn't necessary)
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
Download the MySQL cluster packages
wget http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
Install MySQL cluster packages
yum remove -y mysql-libs
yum install libaio -y
mv http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar /usr/local/src
cd /usr/local/src
tar xvf MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
rpm -Uvh MySQL-Cluster-server-gpl-7.3.6-2.el6.x86_64.rpm MySQL-Cluster-shared-compat-gpl-7.3.6-2.el6.x86_64.rpm MySQL-Cluster-shared-gpl-7.3.6-2.el6.x86_64.rpm MySQL-Cluster-client-gpl-7.3.6-2.el6.x86_64.rpm
Create SQL node config file
nano /etc/my.cnf
[mysqld]
ndbcluster
ndb-connectstring=10.10.1.10
ndb-connectstring=10.10.1.11
default_storage_engine=ndbcluster
[mysql_cluster]
ndb-connectstring=10.10.1.10
ndb-connectstring=10.10.1.11
Start the Cluster
Start the management nodes - This must be done to both management nodes
ndb_mgmd -f /var/lib/mysql-cluster/config.ini
Start the data nodes - This must be done to both data nodes
ndbd
Start the SQL nodes - This must be done to both SQL nodes
service mysql start
Find the MySQL password on each SQL node
cat ~/.mysql_secret
Run MySQL secure installation on each SQL node
mysql_secure_installation
Show Cluster Status
Overall cluster status
ndb_mgm -e show
Check memory usage
ndb_mgm -e "all report memory"
Shutting Down / Restarting the Cluster
The cluster will need to be restarted in order for changes made to the configuration file to come into effect. The SQL nodes must be shutdown prior to shutting down the data and management nodes.
Shutdown the SQL nodes - Ths command should be performed on both SQL nodes
service mysql stop
Shutdown the remainder of the cluster - This command only needs to be performed on one of the management nodes
ndb_mgm -e shutdown
Now you can make your configuration changes and start up the cluster again. We will be using the --initial paramater to make sure that the cluster reads the updated configuration file
Make sure that the config files on both management servers are matching, then run the following command on both management nodes
ndbd_mgmd -f /var/lib/mysql-cluster/config.ini --initial
Start the SQL nodes
service mysql start
Import Existing Database
The SQL engine will need to be set to ndbcluster. If you are importing an existing database, export it using mysqldump, then perform the following commands.
vim YourDB.sql
:%s/engine=InnoDB/engine=ndbcluster/g
:%s/engine=MyISAM/engine=ndbcluster/g
:wq
Now import your edited database backup onto one of your SQL nodes
mysql -uroot -p [YourDB] < YourDB.sql
These steps must be performed on BOTH data nodes.
Configure the firewall.
iptables -A INPUT -p tcp --dport 2200 -j ACCEPT
Download the MySQL cluster packages
wget http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
Install MySQL cluster server package
yum remove -y mysql-libs
mv http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar /usr/local/src
cd /usr/local/src
tar xvf MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
rpm -Uvh MySQL-Cluster-server-gpl-7.3.6-2.el6.x86_64.rpm
Create data node config file.
nano /etc/my.cnf
[mysqld]
ndbcluster
ndb-connectstring=10.10.1.10
ndb-connectstring=10.10.1.11
[mysql_cluster]
ndb-connectstring=10.10.1.10
ndb-connectstring=10.10.1.11
#############################
Configure SQL Nodes
These steps must be performed on BOTH SQL nodes
Configure the firewall (If you're running a local webserver, this step isn't necessary)
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
Download the MySQL cluster packages
wget http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
Install MySQL cluster packages
yum remove -y mysql-libs
yum install libaio -y
mv http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar /usr/local/src
cd /usr/local/src
tar xvf MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
rpm -Uvh MySQL-Cluster-server-gpl-7.3.6-2.el6.x86_64.rpm MySQL-Cluster-shared-compat-gpl-7.3.6-2.el6.x86_64.rpm MySQL-Cluster-shared-gpl-7.3.6-2.el6.x86_64.rpm MySQL-Cluster-client-gpl-7.3.6-2.el6.x86_64.rpm
Create SQL node config file
nano /etc/my.cnf
[mysqld]
ndbcluster
ndb-connectstring=10.10.1.10
ndb-connectstring=10.10.1.11
default_storage_engine=ndbcluster
[mysql_cluster]
ndb-connectstring=10.10.1.10
ndb-connectstring=10.10.1.11
Start the Cluster
Start the management nodes - This must be done to both management nodes
ndb_mgmd -f /var/lib/mysql-cluster/config.ini
Start the data nodes - This must be done to both data nodes
ndbd
Start the SQL nodes - This must be done to both SQL nodes
service mysql start
Find the MySQL password on each SQL node
cat ~/.mysql_secret
Run MySQL secure installation on each SQL node
mysql_secure_installation
Show Cluster Status
Overall cluster status
ndb_mgm -e show
Check memory usage
ndb_mgm -e "all report memory"
Shutting Down / Restarting the Cluster
The cluster will need to be restarted in order for changes made to the configuration file to come into effect. The SQL nodes must be shutdown prior to shutting down the data and management nodes.
Shutdown the SQL nodes - Ths command should be performed on both SQL nodes
service mysql stop
Shutdown the remainder of the cluster - This command only needs to be performed on one of the management nodes
ndb_mgm -e shutdown
Now you can make your configuration changes and start up the cluster again. We will be using the --initial paramater to make sure that the cluster reads the updated configuration file
Make sure that the config files on both management servers are matching, then run the following command on both management nodes
ndbd_mgmd -f /var/lib/mysql-cluster/config.ini --initial
Start the SQL nodes
service mysql start
Import Existing Database
The SQL engine will need to be set to ndbcluster. If you are importing an existing database, export it using mysqldump, then perform the following commands.
vim YourDB.sql
:%s/engine=InnoDB/engine=ndbcluster/g
:%s/engine=MyISAM/engine=ndbcluster/g
:wq
Now import your edited database backup onto one of your SQL nodes
mysql -uroot -p [YourDB] < YourDB.sql
linux, web, ispconfig3, python, bash, apache
msyql ndbcluster,
mysql
part 1 mysqlcluster ndbcluster on centos 7
MySQL cluster provides massive scalibility and allows for high availability.
When migrating an existing database to MySQL cluster, be prepared to spend some time making database optimisation tweaks. Depending on the budget available to your project, you may want to take advantage of the MySQL Manager, which will show you exactly where your slowdowns are. AQL is also worth investigating.
The management node is used to control and push configs onto all of the other nodes. Once the cluster has been started, it can continue to run even after all of the management nodes have failed, however, you will be unable to manage the cluster until the management node(s) has/have been restored.
The data nodes store the database and replicate it between the other data nodes. The SQL node is the gateway between the MySQL client and the cluster.
Install MySQL Cluster 7.3 on CentOS 6
Posted by Knowledge Base on 01 April 2016 03:40 PM
MySQL cluster provides massive scalibility and allows for high availability.
When migrating an existing database to MySQL cluster, be prepared to spend some time making database optimisation tweaks. Depending on the budget available to your project, you may want to take advantage of the MySQL Manager, which will show you exactly where your slowdowns are. AQL is also worth investigating.
Node Types
There are three types of Nodes in a MySQL cluster - A management node, a data node and an SQL node.
The management node is used to control and push configs onto all of the other nodes. Once the cluster has been started, it can continue to run even after all of the management nodes have failed, however, you will be unable to manage the cluster until the management node(s) has/have been restored.
The data nodes store the database and replicate it between the other data nodes.
The SQL node is the gateway between the MySQL client and the cluster.
Node Configuration
In this example, we will have two of each kind of node, so that any single node failure shouldn't result in an emergency.
Management-Node1 - 10.10.1.10
Management-Node2 - 10.10.1.11
Data-Node1 - 10.10.1.20
Data-Node2 - 10.101.1.21
SQL-Node1 - 10.10.1.30
SQL-Node 2 - 10.10.1.31
Let's begin by disabling SELinux on all nodes. I highly recommend re-enabling and configuring SELinux correctly, once you've finished testing.
nano /etc/selinux/config
SELINUX=permissive
Configure Management Nodes
All of these steps must be performed on BOTH management nodes
Configure IPTables
iptables -A INPUT -p tcp --dport 1186 -j ACCEPT
Download the MySQL cluster packages
wget http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
install MySQL cluster server package
yum remove -y mysql-libs
mv http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar /usr/local/src
cd /usr/local/src
tar xvf MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
rpm -Uvh MySQL-Cluster-server-gpl-7.3.6-2.el6.x86_64.rpm
Create Management Config File
mkdir -p /var/lib/mysql-cluster/
nano /var/lib/mysql-cluster/config.ini
[tcp default]
SendBufferMemory=128M
ReceiveBufferMemory=128M
# Increasing the sizes of these 2 buffers beyond the default values
# helps prevent bottlenecks due to slow disk I/O.
# MANAGEMENT NODE PARAMETERS
[ndb_mgmd default]
DataDir=/var/lib/mysql-cluster
# It is possible to use a different data directory for each management
# server, but for ease of administration it is preferable to be
# consistent.
[ndb_mgmd]
HostName=10.10.1.10
[ndb_mgmd]
HostName=10.10.1.11
# DATA NODE PARAMETERS
[ndbd default]
NoOfReplicas=2
# Using 2 replicas is recommended to guarantee availability of data;
# using only 1 replica does not provide any redundancy, which means
# that the failure of a single data node causes the entire cluster to
# shut down. We do not recommend using more than 2 replicas, since 2 is
# sufficient to provide high availability, and we do not currently test
# with greater values for this parameter.
LockPagesInMainMemory=1
# On Linux and Solaris systems, setting this parameter locks data node
# processes into memory. Doing so prevents them from swapping to disk,
# which can severely degrade cluster performance.
DataMemory=10G
IndexMemory=2G
# The values provided for DataMemory and IndexMemory assume 4 GB RAM
# per data node. However, for best results, you should first calculate
# the memory that would be used based on the data you actually plan to
# store (you may find the ndb_size.pl utility helpful in estimating
# this), then allow an extra 20% over the calculated values. Naturally,
# you should ensure that each data node host has at least as much
# physical memory as the sum of these two values.
# ODirect=1
# Enabling this parameter causes NDBCLUSTER to try using O_DIRECT
# writes for local checkpoints and redo logs; this can reduce load on
# CPUs. We recommend doing so when using MySQL Cluster on systems running
# Linux kernel 2.6 or later.
NoOfFragmentLogFiles=300
DataDir=/var/lib/mysql-cluster
MaxNoOfConcurrentOperations=1000000
SchedulerSpinTimer=400
SchedulerExecutionTimer=100
RealTimeScheduler=1
# Setting these parameters allows you to take advantage of real-time scheduling
# of NDBCLUSTER threads to get higher throughput.
TimeBetweenGlobalCheckpoints=1000
TimeBetweenEpochs=200
DiskCheckpointSpeed=10M
DiskCheckpointSpeedInRestart=100M
RedoBuffer=32M
# CompressedLCP=1
# CompressedBackup=1
# Enabling CompressedLCP and CompressedBackup causes, respectively, local
#checkpoint files and backup files to be compressed, which can result in a space
#savings of up to 50% over noncompressed LCPs and backups.
# MaxNoOfLocalScans=64
MaxNoOfTables=1024
MaxNoOfOrderedIndexes=256
[ndbd]
HostName=10.10.1.20
LockExecuteThreadToCPU=1
LockMaintThreadsToCPU=0
# On systems with multiple CPUs, these parameters can be used to lock NDBCLUSTER
# threads to specific CPUs
[ndbd]
HostName=10.10.1.21
LockExecuteThreadToCPU=1
LockMaintThreadsToCPU=0
# SQL NODE / API NODE PARAMETERS
[mysqld]
HostName=10.10.1.30
[mysqld]
HostName=10.10.1.31
When migrating an existing database to MySQL cluster, be prepared to spend some time making database optimisation tweaks. Depending on the budget available to your project, you may want to take advantage of the MySQL Manager, which will show you exactly where your slowdowns are. AQL is also worth investigating.
The management node is used to control and push configs onto all of the other nodes. Once the cluster has been started, it can continue to run even after all of the management nodes have failed, however, you will be unable to manage the cluster until the management node(s) has/have been restored.
The data nodes store the database and replicate it between the other data nodes. The SQL node is the gateway between the MySQL client and the cluster.
Install MySQL Cluster 7.3 on CentOS 6
Posted by Knowledge Base on 01 April 2016 03:40 PM
MySQL cluster provides massive scalibility and allows for high availability.
When migrating an existing database to MySQL cluster, be prepared to spend some time making database optimisation tweaks. Depending on the budget available to your project, you may want to take advantage of the MySQL Manager, which will show you exactly where your slowdowns are. AQL is also worth investigating.
Node Types
There are three types of Nodes in a MySQL cluster - A management node, a data node and an SQL node.
The management node is used to control and push configs onto all of the other nodes. Once the cluster has been started, it can continue to run even after all of the management nodes have failed, however, you will be unable to manage the cluster until the management node(s) has/have been restored.
The data nodes store the database and replicate it between the other data nodes.
The SQL node is the gateway between the MySQL client and the cluster.
Node Configuration
In this example, we will have two of each kind of node, so that any single node failure shouldn't result in an emergency.
Management-Node1 - 10.10.1.10
Management-Node2 - 10.10.1.11
Data-Node1 - 10.10.1.20
Data-Node2 - 10.101.1.21
SQL-Node1 - 10.10.1.30
SQL-Node 2 - 10.10.1.31
Let's begin by disabling SELinux on all nodes. I highly recommend re-enabling and configuring SELinux correctly, once you've finished testing.
nano /etc/selinux/config
SELINUX=permissive
Configure Management Nodes
All of these steps must be performed on BOTH management nodes
Configure IPTables
iptables -A INPUT -p tcp --dport 1186 -j ACCEPT
Download the MySQL cluster packages
wget http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
install MySQL cluster server package
yum remove -y mysql-libs
mv http://cdn.mysql.com/Downloads/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar /usr/local/src
cd /usr/local/src
tar xvf MySQL-Cluster-gpl-7.3.6-2.el6.x86_64.rpm-bundle.tar
rpm -Uvh MySQL-Cluster-server-gpl-7.3.6-2.el6.x86_64.rpm
Create Management Config File
mkdir -p /var/lib/mysql-cluster/
nano /var/lib/mysql-cluster/config.ini
[tcp default]
SendBufferMemory=128M
ReceiveBufferMemory=128M
# Increasing the sizes of these 2 buffers beyond the default values
# helps prevent bottlenecks due to slow disk I/O.
# MANAGEMENT NODE PARAMETERS
[ndb_mgmd default]
DataDir=/var/lib/mysql-cluster
# It is possible to use a different data directory for each management
# server, but for ease of administration it is preferable to be
# consistent.
[ndb_mgmd]
HostName=10.10.1.10
[ndb_mgmd]
HostName=10.10.1.11
# DATA NODE PARAMETERS
[ndbd default]
NoOfReplicas=2
# Using 2 replicas is recommended to guarantee availability of data;
# using only 1 replica does not provide any redundancy, which means
# that the failure of a single data node causes the entire cluster to
# shut down. We do not recommend using more than 2 replicas, since 2 is
# sufficient to provide high availability, and we do not currently test
# with greater values for this parameter.
LockPagesInMainMemory=1
# On Linux and Solaris systems, setting this parameter locks data node
# processes into memory. Doing so prevents them from swapping to disk,
# which can severely degrade cluster performance.
DataMemory=10G
IndexMemory=2G
# The values provided for DataMemory and IndexMemory assume 4 GB RAM
# per data node. However, for best results, you should first calculate
# the memory that would be used based on the data you actually plan to
# store (you may find the ndb_size.pl utility helpful in estimating
# this), then allow an extra 20% over the calculated values. Naturally,
# you should ensure that each data node host has at least as much
# physical memory as the sum of these two values.
# ODirect=1
# Enabling this parameter causes NDBCLUSTER to try using O_DIRECT
# writes for local checkpoints and redo logs; this can reduce load on
# CPUs. We recommend doing so when using MySQL Cluster on systems running
# Linux kernel 2.6 or later.
NoOfFragmentLogFiles=300
DataDir=/var/lib/mysql-cluster
MaxNoOfConcurrentOperations=1000000
SchedulerSpinTimer=400
SchedulerExecutionTimer=100
RealTimeScheduler=1
# Setting these parameters allows you to take advantage of real-time scheduling
# of NDBCLUSTER threads to get higher throughput.
TimeBetweenGlobalCheckpoints=1000
TimeBetweenEpochs=200
DiskCheckpointSpeed=10M
DiskCheckpointSpeedInRestart=100M
RedoBuffer=32M
# CompressedLCP=1
# CompressedBackup=1
# Enabling CompressedLCP and CompressedBackup causes, respectively, local
#checkpoint files and backup files to be compressed, which can result in a space
#savings of up to 50% over noncompressed LCPs and backups.
# MaxNoOfLocalScans=64
MaxNoOfTables=1024
MaxNoOfOrderedIndexes=256
[ndbd]
HostName=10.10.1.20
LockExecuteThreadToCPU=1
LockMaintThreadsToCPU=0
# On systems with multiple CPUs, these parameters can be used to lock NDBCLUSTER
# threads to specific CPUs
[ndbd]
HostName=10.10.1.21
LockExecuteThreadToCPU=1
LockMaintThreadsToCPU=0
# SQL NODE / API NODE PARAMETERS
[mysqld]
HostName=10.10.1.30
[mysqld]
HostName=10.10.1.31
linux, web, ispconfig3, python, bash, apache
msyql ndbcluster,
mysql
Linux route add
Adding static routes in Linux can be troublesome, but also absolutely necessary depending on your network configuration. I call static routes troublesome because they can often be the cause of long troubleshooting sessions wondering why one server can't connect to another.
This is especially true when dealing with teams that may not fully understand or know the remote servers IP configuration.
The Default Route
Linux, like any other OS has a routing table that determines what is the next hop for every packet.
Print the routing table contents
There are numerous commands that show the routing table but today we will use the
ip command as this command will be replacing the route command in future releases.# ip route show
10.1.6.0/26 dev eth0 proto kernel scope link src 10.1.6.21
10.1.7.0/24 dev eth1 proto kernel scope link src 10.1.7.41
default via 10.1.6.1 dev eth0
As you can see in the example routing table there are numerous routes however 1 route shows as the default route. This routing table tells the system that if the IP that is being communicated to does not fall into any of the other routes than send the packets to the default route defined as 10.1.6.1. The default route basically acts as a catchall for any packet that isn't being told what to do in the above routes.
Our Example System
In today's article I will be referencing an example network configuration in order to show how static routes are added, why to add them and some basic troubleshooting.
Example Interface Configuration
eth0:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.1.6.21
NETMASK=255.255.255.192
ONBOOT=yes
eth1:
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
IPADDR=10.1.7.41
NETMASK=255.255.255.0
ONBOOT=yes
Example Default Route Configuration
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=testing.example.com
GATEWAY=10.1.6.1
The
GATEWAY configuration in /etc/sysconfig/network tells the system that10.1.6.1 is the default route. This configuration could also be added to/etc/sysconfig/network-scripts/ifcfg-eth0 file; However if multipleifcfg-<interface> files have a GATEWAY this may provide unexpected results as there can only be one default route.Example Why we need a static route
For our example network configuration we have two interfaces; eth0 (10.1.6.21)for the internet, and eth1 (10.1.7.41) for the internal network. If we were to hook up to a backup server such as 10.1.5.202 we would want the connectivity to go through eth1 the internal network, rather than eth0 which is the internet network.
Since 10.1.5.202 is not in the same subnet at eth1 (10.1.7.0/24) the routing table does not automatically route the packet through eth1 and would then hit the "catchall" default route out eth0. To force all of our packets destined for10.1.5.202 out eth1 we will need to set up a static route.
Adding a Static Route
Adding the route to the current routing table
Adding the static route is a fairly simple task however before we start we must first know the gateway for the internal network; for our example the gateway is10.1.7.1.
Adding a single IP
# ip route add 10.1.5.202/32 via 10.1.7.1 dev eth1
The above command adds a route that tells the system to send all packets for10.1.5.202 and only that IP to 10.1.7.1 from device eth1.
Adding a subnet of IP's
In order to add a whole subnet than you will need to change the CIDR on the end of the IP. In this case I want to add anything in the 10.1.5.0 - 10.1.5.255 IP range. To do that I can specify the netmask of 255.255.255.0 in CIDR format(/24)at the end of the IP itself.
If a CIDR (or netmask) is not specified the route will default to a /32 (single ip) route.
# ip route add 10.1.5.0/24 via 10.1.7.1 dev eth1
The difference between these two routes is that the second will route anything between 10.1.5.0 and 10.1.5.255 out eth1 with 1 route command. This is useful if you need to communicate with multiple servers in a network and don't want to manage lengthy routing tables.
Adding the route even after a network restart
While the commands above added the static route they are only in the routing table until either the server or network service is restarted. In order to add the route permanently, the route can be added to the
route-<interface> file.# vi /etc/sysconfig/network-scripts/route-eth1
Append:
10.1.5.0/24 via 10.1.7.1 dev eth1
If the above configuration file does not already exist than simply create it and put only the route itself in the file (# comments are ok). When the interface is restarted next the system will add any valid route in the
route-eth1 file to the routing table.
I highly suggest that when possible anytime you add a route to the
route-<interface> files that the interface itself is restarted to validate whether the route is actually in place correctly or not. I have been on many late night calls where a static route was not added correctly to the configuration files and was removed on the next reboot, which is also long after everyone has forgotten that a static route was required.Troubleshooting a Static Route
Check if the route is in the routing table
Before performing any deep down troubleshooting steps the easiest and first step should be to check if the routing table actually has the route you expect it to have.
# ip route show
10.1.5.0/24 via 10.1.7.1 dev eth1
10.1.6.0/26 dev eth0 proto kernel scope link src 10.1.6.21
10.1.7.0/24 dev eth1 proto kernel scope link src 10.1.7.41
default via 10.1.6.1 dev eth0
Use tcpdump to see tcp/ip communication
The easiest way that I have found to find out whether a static route is working correctly or not is to use
tcpdump to look at the network communication. In our example above we were attempting to communicate to 10.1.5.202 through deviceeth1.# tcpdump -qnnvvv -i eth1 host 10.1.5.202
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
16:50:35.880941 IP (tos 0x10, ttl 64, id 59563, offset 0, flags [DF], proto: TCP (6), length: 60) 10.1.7.41.41403 > 10.1.5.202.22: tcp 0
16:50:35.881266 IP (tos 0x0, ttl 59, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.1.5.202.22 > 10.1.7.41.41403: tcp 0
The above
tcpdump command will only listen on eth1 and output only results that to or from 10.1.5.202.
TCP connections require communication from both the source and the destination, to validate a static route you can simply initiate a tcp connection (telnet to port 22 in this case) from the server with the static route to the destination server. In the output above you can see communication from 10.1.7.41to 10.1.5.202 from the eth1 interface, this line alone shows that the static route is working correctly.
If the static route was incorrect or missing the tcpdump output would look similar to the following.
# tcpdump -qnnvvv -i eth1 host 10.1.5.202
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
16:50:35.881266 IP (tos 0x0, ttl 59, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.1.5.202.22500 > 10.1.7.41.22: tcp 0
In the above, only the target server is communicating over eth1.
undo revert git push
http://stackoverflow.com/questions/1270514/undoing-a-git-push
You need to make sure that no other users of this repository are fetching the incorrect changes or trying to build on top of the commits that you want removed because you are about to rewind history.
Then you need to 'force' push the old reference.
git push -f origin last_known_good_commit:branch_name
or in your case
git push -f origin cc4b63bebb6:alpha-0.3.0
You may have
receive.denyNonFastForwards set on the remote repository. If this is the case, then you will get an error which includes the phrase [remote rejected].
In this scenario, you will have to delete and recreate the branch.
git push origin :alpha-0.3.0
git push origin cc4b63bebb6:refs/heads/alpha-0.3.0
If this doesn't work - perhaps because you have
receive.denyDeletes set, then you have to have direct access to the repository. In the remote repository, you then have to do something like the following plumbing command.git update-ref refs/heads/alpha-0.3.0 cc4b63bebb6 83c9191dea8
Subscribe to:
Posts (Atom)