hpacucli ctrl slot=1 show config

Smart Array P410 in Slot 1 (sn: PACCRID11510NCV)

array A (SAS, Unused Space: 0 MB)

logicaldrive 1 (838.3 GB, RAID 1+0, Recovering, 13% complete)

physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 450 GB, OK)
physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 450 GB, OK)
physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 450 GB, Rebuilding)
physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 450 GB, OK)

SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 (WWID: 500143801887352F)


3.2. hpacucli

This tool is a proprietary one created by HP. It can do both reporting and management.
3.2.1. Quickstart guide

List all controllers:

server:~# hpacucli controller all show

Smart Array 6i in Slot 0 ()

List arrays on controller in slot 0:

server:~# hpacucli ctrl slot=0 logicaldrive all show status

logicaldrive 1 (33.9 GB, RAID RAID 1+0): OK
logicaldrive 2 (136.7 GB, RAID RAID 1+0): OK

I don’t know why it reports RAID 1+0. This is regular RAID1 arrays.

List physical drives on controller in slot 0:

server:~# hpacucli ctrl slot=0 pd all show status

physicaldrive 1:0 (port 1:id 0, 36.4 GB): OK
physicaldrive 1:1 (port 1:id 1, 36.4 GB): OK
physicaldrive 1:2 (port 1:id 2, 146.8 GB): OK
physicaldrive 1:3 (port 1:id 3, 146.8 GB): OK

Summarized status:

server:~# hpacucli ctrl slot=0 show config

Smart Array 6i in Slot 0 ()

array A (Parallel SCSI, Unused Space: 0 MB)

logicaldrive 1 (33.9 GB, RAID 1+0, OK)

physicaldrive 2:0 (port 2:id 0 , Parallel SCSI, 36.4 GB, OK)
physicaldrive 2:1 (port 2:id 1 , Parallel SCSI, 36.4 GB, OK)

array B (Parallel SCSI, Unused Space: 0 MB)

logicaldrive 2 (136.7 GB, RAID 1+0, OK)

physicaldrive 2:2 (port 2:id 2 , Parallel SCSI, 146.8 GB, OK)
physicaldrive 2:3 (port 2:id 3 , Parallel SCSI, 146.8 GB, OK)

Controller policies (write cache, disk cache, battery), only interesting lines kept:

root@server:~# hpacucli ctrl slot=0 show

Smart Array P420i in Slot 0 (Embedded)
Serial Number: *SERIAL*
Controller Status: OK
Firmware Version: 3.54
Cache Board Present: True
Cache Status: OK
Cache Ratio: 25% Read / 75% Write
Drive Write Cache: Disabled
Total Cache Size: 512 MB
No-Battery Write Cache: Disabled
Cache Backup Power Source: Capacitors
Battery/Capacitor Count: 1
Battery/Capacitor Status: OK

Cache is ok, Battery is too. Write cache disabled if battery back isn’t enabled, that’s ok.

Check and enable cache for all arrays:

Check current state:

root@server:~# hpacucli ctrl slot=0 ld all show detail

Smart Array P420i in Slot 0 (Embedded)

array A

Logical Drive: 1
Size: 136.7 GB
Fault Tolerance: RAID 1
Status: OK
Caching: Disabled

Enable caching:

root@server:~# hpacucli ctrl slot=0 ld all modify arrayaccelerator=enable

Enable disks’ write cache:

root@server:~# hpacucli ctrl slot=0 modify dwc=enable

Warning: Without the proper safety precautions, use of write cache on physical
drives could cause data loss in the event of power failure. To ensure
data is properly protected, use redundant power supplies and
Uninterruptible Power Supplies. Also, if you have multiple storage
enclosures, all data should be mirrored across them. Use of this
feature is not recommended unless these precautions are followed.
Continue? (y/n) y

Warning is self-explaining I guess. Disks’s cache aren’t protected by controller’s battery. It’s up to you but I wouldn’t enable such features if your power supply isn’t protected.

Modify cache ratio between read and write:

root@server:~# hpacucli ctrl slot=0 modify cacheratio=50/50

 

http://hwraid.le-vert.net/wiki/SmartArray

MySQL de views diye bir sey varmis.

ilgili bir zamanda belli bir query nin cevabini virtual olarak tutmasina yariyormus MySQL in.

MySQL ci olmayinca neyin ne oldugunu detaylica bilmiyorum.

bu view denen boklari dump etmiyor default mysqldump

1 kac kez sorun yasadim, programcilar tiri viri yapiyor

su sekilde dump edilebilir ozel durumlarda:

1. mysql.view.dump.sh diye bir text dosyasi icine yaz

#!/bin/bash -e
mysql --skip-column-names --batch -e \
"select table_name from information_schema.views \
 where table_schema = database()" $* |
xargs --max-args 1 mysqldump $*

2- su sekilde calistir

sh mysql.view.dump.sh -u user -ppassword databasename > dumpfile.sql

yum install php-devel ImageMagick ImageMagick-devel
pecl install Imagick

*locate pecl*

don’t forget to add this to php.ini
extension=imagick.so

and then

service httpd restart

Basitce sunucuda bulunan bir dizini nginix ile paylasmam gerekti.

ancak guzelde olsun istedim.

cokbasit nginix configi


# Default server configuration
#
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name besdokuz.ee.pe;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

  location /TOPGEAR {
        autoindex on;
        fancyindex on;
        fancyindex_exact_size off;
    alias /home/shukko/Downloads/TOPGEAR;
  }

https://wiki.quagga.net/wiki/index.php/TipsNTricks


cat /etc/quagga/bgpd.conf

password blablabla

router bgp 203555
 network 37.24.11.0/24
 bgp router-id 103.38.19.185
 neighbor 169.254.169.254 remote-as 64515
 neighbor 169.254.169.254 password rdjh&hjgsbjd3
 neighbor 169.254.169.254 ebgp-multihop 2
 neighbor 169.254.169.254 soft-reconfiguration inbound
!

bu asagidaki openbgpd.conf – freebsd uzerinde , hatta yetmedi pfsense uzerinde..
neden diye sorma… routing bilmiyoz diye kimseye caktirmiyoz. denedik yanildik
o denemelerin hatirasi icin

# This file was created by the package manager. Do not edit!

AS 203555
fib-update yes
listen on 104.238.191.198
router-id 104.238.191.198
network 37.27.18.0/24
group "vultr" {
	remote-as 64515
	neighbor 169.254.169.254 {
		descr "vultr"
		tcp md5sig password rdfdf3efdf9C
		announce all  
		multihop 2 
		softreconfig in yes  
		local-address 104.238.191.198
}
}
deny from any
deny to any
allow from 169.254.169.254
allow to 169.254.169.254

orjinal link: https://blog.laimbock.com/2013/10/31/how-to-convert-a-non-sparse-image-to-sparse/

Below are the steps how to convert a raw or qcow2 non-sparse image to a sparse image. Basically there are two ways to do the conversion:
1) use virt-sparsify
2) use dd and cp –sparse

Convert a non-sparse image to a sparse image with virt-sparsify

IMPORTANT: make sure the VM is not running/live! It must be shut down or else you will destroy the data in your image.

Make sure virt-sparsify is installed:

Check current image:

The first 10737418240 value is the allocated size and the second 10737418240 value is the file size. Since they are both the same value it means that this image is non-sparse (or 100% full in which case the sparse attempt is irrelevant).

Check again using qemu-img info:

Both the virtual size and the disk size are 10G so this image is not a sparse image.

Now convert the non-sparse image to a sparse image using virt-sparsify:

Check the new image:

The allocated size of 1425852 is much smaller than the file size of 10737418240 which means this is now a sparse image.

Check again using qemu-img info:

The disk size is much smaller than the virtual disk size so the image has indeed been successfully converted to a sparse image.

Convert a non-sparse image to a sparse image with dd and cp

Start the VM/image which you want to make sparse and login to it. Next fill the free space in the VM with zeros using the following command and then shut it down again:

Now convert the non-sparse image to a sparse image using cp:

Check the new image:

The allocated size of 1425852 is much smaller than the file/image size of 10737418240 which means this is now a sparse image.

Check again using qemu-img info:

Again this shows that the image is now a sparse image.

Which method to use?

Both methods work equally well. In terms of options the virt-sparsify method may be preferred as it can for example also convert the image from raw to qcow2 and it needs less steps. See man virt-sparsify for more information. If you just want to make the image sparse than choose the method which you like best.

Tip

If you use rsync to make backups of your images then do not forget to use the –sparse option and realize that –sparse conflicts with –inplace (see man rsync).

MySQL INNODB Crash etti. Napicaz?

1- nano /etc/my.cnf

innodb_force_recovery = 2

2den basla 6ya kadar yolu var

GUNCELLEME: Agustos 2018

Be sure to check your MySQL logs, and if it loops with something like:

InnoDB: Waiting for the background threads to start

You should also add innodb_purge_threads=0 to your my.cnf.

So all together to bring back database, I had to add these 3 parameters in my.cnf:

port = 8881
innodb_force_recovery=3
innodb_purge_threads=0

2- killall -9 mysqld

calisan bir mysql processi kalmasin

3- innodb recovery ile calistiktan sonra read only olarak.

herseyi dump et tek buyuk bir dosyaya

cat /usr/local/directadmin/conf/mysql.conf

mysqldump -u da_admin -p --opt --all-databases > alldb.sql

4- /var/lib/mysql altindaki

ibdata1
ib_logfile0
ib_logfile1

sil, veya sen en iyisi tum /mysql dizinini yedekle sonra sil

5- herseyi restore et buyuk dosya yedeginden.

mysql -u da_admin -p < alldb.sql

server.err logu tail le duruma bak

gule gule kullan.

NOT: 2021 mart::

Use the --force (-f) flag on your mysql import. Rather than stopping on the offending statement, MySQL will continue and just log the errors to the console.

For example:

mysql -u userName -p -f -D dbName < script.sql

ek:

aynisi oldu 1 serverda db leri dump ederken 1 table hata veriyordu.

inatla hangi table hangi db icinde onuda bulamadim crash diyip duruyodu

ne yaptim

updatedb

locate crashedentable.frm

frm ler cikinca tek tek hepsini (1den cok vardi ) 12 tane toplam

el ile fix ettim. aslinda otomatik auto-repair calismasi gerekirdi.

calismadi pust nedense ..

mysqlcheck -u da_admin -p --auto-repair --optimize --all-databases

bu yukairdaki otomatik olan hepsini fixleyen. neden calismadiki acep. bilinmez..

ben naptim:

mysqlcheck -u da_admin -p --auto-repair --databases esila_shop eticaret2_shop

bu ise yaradi.

bilgim olsun :)

artik kod modundanda cikalim..

evet/./

Hizmetlerimize gosterdiginiz ilgi icin tesekkur ederiz.
3 farkli hizmet seklimiz bulunmaktadir.
IYI – UCUZ – HIZLI
Yukaridaki Herhangi iki adet hizmet seklini secebilirsiniz.
Ancak Unutmayiniz ki:
IYI ve UCUZ hizmet HIZLI olmayacaktir,
IYI ve HIZLI hizmet UCUZ olmayacaktir,
HIZLI ve UCUZ hizmet IYI olmayacaktir.

1- online.net console gir > makinayi sec > proxmox kur
2- online.net console dan 1 tane failover ip siparis et
3- failover ipi proxmox kurdugun makinaya ata
4- failover ip icin virtual mac olustur – virtual maci kopyala
5- proxmoxuna git su sekilde vm olustur
linux 2.6 KVM
256 MB RAM
1 CPU
Sata Disk 8 GB yeterli
Virtio ethernet > mac adresi kopyaladigin virtual mac > yapistir.
numa secebilirsin
makinada kvm default olsun , host secme boot etmez.
6- proxmox html5 novnc konsol ile makinayi boot et
7- mikrotik tum modulleri sec yukle de
8- mikrotik acildiginda su komutlari calistir

ip address add interface=ether1 address=212.129.22.22 netmask=255.255.255.255 broadcast=212.129.22.22 network=195.154.171.1
ip route add dst-address=0.0.0.0/0 gateway=195.154.171.1

not: 212.129.22.22 > sana verilmis olan virtual mac olusturdugun failover ip
195.154.171.1 > proxmox makinandaki ana ipin gateway ipi

9- su an failover ipine pingleyebiliyor ve winbox ile baglanabiliyor olmalisin.

gule gule kullan.