Posts

Showing posts from November, 2018

Cleanup Openstack Script

When I am working on the openstack, I found that my design is not a right design. So I have to restart it from a scratch. I wrote a script to clean up the openstack. Any comments are welcome! Another best way to do that is to take a snapshot before implementing the openstack if snapshot is an option. rebuild openstack: for i in `systemctl list-unit-files |grep openstack |grep enabled |awk '{print $1}'`; do systemctl stop $i; systemctl disable $i; done for i in `systemctl list-unit-files |grep neutron |grep enabled |awk '{print $1}'`; do systemctl stop $i; systemctl disable $i; done for i in `systemctl list-unit-files |grep rabbitmq |grep enabled |awk '{print $1}'`; do systemctl stop $i; systemctl disable $i; done for i in "openvswitch ip6tables ovsdb-server ovs-vswitchd neutron-server httpd libvirtd virtlockd iscsi redis memcached gssproxy ksmtuned tuned" do   systemctl stop $i   systemctl disable $i done cd /etc/openvswitch mv con

HA in Linux is pretty easy

NOTICE: -- Very important: Please do NOT FAT FINGER. Check your IP address/hostname correct first before configuring PCS. If any service(s) do(es) not startup correctly, please check the service log under /var/log/cluster or /var/log/pcsd. systemctl -xe does not help at all 1> Install PCS  yum isntall pcs -y 2>  Configure PCS. Please run the following commands on ALL nodes: systemctl start pcsd systemctl enable pcsd passwd hacluster 3> Configure PCS, Run he following commands on ONE node: pcs cluster auth <NODE-1> <NODE-2> <...> pcs cluster setup --name <CLUSTER_NAME> <NODE-1> <NODE-2> <...> pcs cluster start --all pcs cluster enable --all pcs resource create virtual_ip ocf:heartbeat:IPaddr2 ip=<IP_ADDR> cidr_netmask=32 op monitor interval=30s pcs resource create <APPLICATION_MON> ocf:heartbeat:nginx configfile=/etc/nginx/nginx.conf op monitor timeout="5s" interval="5s"   

MariaDB replicate

/etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd max_allowed_packet=32M max_connections=500 #innodb_log_buffer_size = 32M innodb_buffer_pool_size=6G key_buffer_size = 10M #innodb_log_file_size = 768M #Replication server_id       = 67 log-bin         = /var/lib/mysql/mysql-bin log-bin-index   = /var/lib/mysql/mysql-bin.index relay-log       = /var/lib/mysql/mysql-relay-bin relay-log-index = /var/lib/mysql/mysql-relay-bin.index binlog-format   = mixed expire_logs_days= 5 max_binlog_size = 100M auto_increment_increment = 5 auto_increment_offset = 2 replicate_wild_ignore_table = %.cache% slave-skip-