天天看點

Aerospike資料庫實戰(四) -- Aerospike 安裝部署

本人原創文章,轉載請注明出處:http://blog.csdn.net/yanshu2012/article/details/54288747

1 Aerospike Databases部署前準備工作

  • 盡量不要對ssd做RAID,RAID控制器會帶來不必要的延遲
  • 如果必須做RAID,建議每塊盤單獨做RAID0。如果做了RAID,需要利用 LSI Mega CL 進行一些優化設定。參考:LSI Mega CLI: [[http://www.aerospike.com/docs/operations/plan/ssd/lsi_megacli.html]]
  • SSD硬碟不需要格式化,不需要挂載,直接attach到伺服器主機闆上,Aerospike把SSD當raw disk使用。
  • 有些SSD需要預留部分空間給驅動控制器使用,這樣能帶來更好的性能。
    對于intel CD S3500的SSD,Aerospike強烈建議進行分區,第一個分區79%,第二個分區21%。
    使用第一個分區進行後面的ACT測試
          
  • SSD硬碟在第一次使用之前需要做清零操作,清零操作會清除SSD硬碟硬碟中的資料。新添加SSD硬碟對資料庫存儲容量進行擴容時,隻需要對新添加的SSD硬碟做清零操作(參照下面資訊進行清零操作)。
    sudo dd if=/dev/zero of=/dev/<deviceID> bs=1M&
          
出現提示:No space left on device or an out of space error 說明硬碟清零操作完畢。
Aerospike資料庫實戰(四) -- Aerospike 安裝部署

2 Aerospike Databases部署步驟

  • 依賴環境安裝
    sudo yum install openssl-devel
    sudo yum install gcc gcc-c++
          
  • server端安裝步驟
    wget -O aerospike.tgz 'http://aerospike.com/download/server/latest/artifact/el6'
    tar -xvf aerospike.tgz
    cd aerospike-server-community-*-el6
    sudo ./asinstall # will install the .rpm packages
    sudo service aerospike start 
    sudo tail -f /var/log/aerospike/aerospike.log | grep cake
          
wait for it. "service ready: soon there will be cake!"
  • 關閉Aerospike Databases節點機器之間的防火牆
  • 參考下面配置,修改Aerospike Server端conf檔案。
    service {
            user root
            group root
            paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
            pidfile /var/run/aerospike/asd.pid
            service-threads 32
            transaction-queues 32
            transaction-threads-per-queue 3
            proto-fd-max 100000
            fabric-workers 96
            microbenchmarks  true
    }
    
    logging {
            # Log file must be an absolute path.
            file /var/log/aerospike/aerospike.log {
                    context any info
            }
    }
    
    network {
            service {
                    address any
                    port 3000
            }
    
            heartbeat {
                    mode multicast
                    address 239.1.99.222
                    port 9918
                    #interface-address 192.168.1.116
    
                    # To use unicast-mesh heartbeats, remove the 3 lines above, and see
                    # aerospike_mesh.conf for alternative.
                    #
                    #mode mesh
                    #port 3002
    
                    #mesh-seed-address-port 192.168.1.116 3002
    
                    #mesh-seed-address-port 192.168.1.117 3002
    
                    interval 150
                    timeout 20
            }
    
            fabric {
                    port 3001
            }
    
            info {
                    port 3003
            }
    }
    
    namespace test {
            replication-factor 2
            memory-size 75G
            default-ttl 30d # 30 days, use 0 to never expire/evict.
            high-water-memory-pct 90        
            high-water-disk-pct   90
            # Warning - legacy data in defined raw partition devices will be erased.
            # These partitions must not be mounted by the file system.
            storage-engine device {
                    # Use one or more lines like those below with actual device paths.
                    device /dev/sdb1
                    #device /dev/sdc1
    
                    #device  /dev/fioa
                    # The 2 lines below optimize for SSD.
                    scheduler-mode noop
                    write-block-size 128K
    
                    # Use the line below to store data in memory in addition to devices.
    #               data-in-memory true
            }
    }
               
  • 啟動Aerospike Databases
    sudo service aerospike start 或者 sudo  /etc/init.d/aerospike  start