2018년 1월 15일 월요일

mycroft picroft usb audio 장치 사용하기

다음의 두가지 설정을 하여 USB audio 를 기본output 장치로 사용할 수 있다.

pi@picroft:~/skills $ cat /etc/asound.conf
pcm.!default {
        type hw
        card 0
}

ctl.!default {
        type hw
        card 0
}

pi@picroft:~/skills $ cat /etc/mycroft/mycroft.conf
{
   "play_wav_cmdline": "aplay -Dplughw:1,0 %1",
   "play_mp3_cmdline": "mpg123 -a hw:0,0 %1",
   "enclosure": {
      "platform": "picroft",
      "update": true,
      "test": false
   },
   "tts": {
      "module": "mimic",
      "mimic": {
         "voice": "ap",
         "path": "/usr/local/bin/mimic"
      }
   },
   "ipc_path": "/ramdisk/mycroft/ipc/"
 }

2017년 11월 8일 수요일

Raspberry Pi B+ rtl8188eu 사용.

raspberry pi  B+ 에 wifi usb dongle rtl8188eu 를 사용하는 환경에서 wifi가 접속되지 않는 상태

lsusb 에서도 잘 잡히고
root@dpi:/home/pi# lsusb
Bus 001 Device 007: ID 15d9:0a4e Trust International B.V. 
Bus 001 Device 006: ID 413c:2106 Dell Computer Corp. Dell QuietKey Keyboard
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 004: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. SMC9512/9514 USB Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsmod 에서도 잘 잡힌다.
root@dpi:/home/pi# lsmod
Module                  Size  Used by
evdev                  11746  0
r8188eu               425640  0
cfg80211              527100  0 r8188eu   <<<<< used 가 0 임.
rfkill                 21373  3 cfg80211
snd_bcm2835            23131  0
snd_pcm                97825  1 snd_bcm2835
snd_timer              22706  1 snd_pcm
snd                    68784  3 snd_timer,snd_bcm2835,snd_pcm
bcm2835_gpiomem         3791  0
uio_pdrv_genirq         3718  0
uio                    10166  1 uio_pdrv_genirq
fixed                   3029  0
ip_tables              12512  0
x_tables               20921  1 ip_tables
ipv6                  384613  0



blacklist 등록도 하고
root@dpi:/home/pi# cat /etc/modprobe.d/8188eu.conf 
# r8188eu is staging, 8188eu is off-kernel
#blacklist brcmfmac
blacklist rtl8188eu
options rtl8188eu rtw_power_mgnt=0 rtw_enusbss=0





여러 방법을 써 봤지만, 아래의 방법이 최후의 성공 방법.

root@dpi:/home/pi# cd /lib/systemd/system/
root@dpi:/home/pi# cp wpa_supplicant@.service wpa_supplicant_wlan0.service
root@dpi:/home/pi# systemctl enable wpa_supplicant_wlan0.service
root@dpi:/home/pi# reboot


재부팅 후 

[  OK  ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
[  OK  ] Started Hostname Service.
[  OK  ] Found device RTL8188EUS 802.11n Wireless Network Adapter.
[  OK  ] Started ifup for wlan0.
[  OK  ] Started dhcpcd on all interfaces.
[  OK  ] Reached target Network.
         Starting Permit User Sessions...
         Starting The Apache HTTP Server...
         Starting OpenBSD Secure Shell server...
         Starting /etc/rc.local Compatibility...
[  OK  ] Started Permit User Sessions.
My IP address is 192.192.1.19              <<< IP주소를 가져왔다.
[  OK  ] Started /etc/rc.local Compatibility.
         Starting Terminate Plymouth Boot Screen...

         Starting Hold until boot process finishes up...




root@dpi:/home/pi# lsmod
Module                  Size  Used by
evdev                  11746  0
r8188eu               425640  0
cfg80211              527100  1 r8188eu   <<<<< used 가 1 임.
rfkill                 21373  3 cfg80211
snd_bcm2835            23131  0
snd_pcm                97825  1 snd_bcm2835
snd_timer              22706  1 snd_pcm
snd                    68784  3 snd_timer,snd_bcm2835,snd_pcm
bcm2835_gpiomem         3791  0
uio_pdrv_genirq         3718  0
uio                    10166  1 uio_pdrv_genirq
fixed                   3029  0
ip_tables              12512  0
x_tables               20921  1 ip_tables

ipv6                  384613  0

2017년 10월 27일 금요일

Raspberry Pi WiFi power mode 변경

WiFi USB 동글을 사용중 Power saving 모드 때문에 일정시간이 지나면 WiFi 통신이 되지 않는경우. 
Power saving 모드를 비활성화 시켜 통신이 지속되도록 만드는 절차.

USB dongle : RealTek 8188CUS

root@doorpi:/etc/network# lsusb
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. SMC9512/9514 USB Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@doorpi:/home/pi# cat /sys/module/8192cu/parameters/rtw_power_mgnt
1

1은 Power saving 모드가 활성화 된 상태, 0으로 바꾼다.

root@doorpi:/home/pi# vi /etc/modprobe.d/brtl8192cu.conf 

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0


root@doorpi:/home/pi# reboot


root@doorpi:/home/pi# cat /sys/module/8192cu/parameters/rtw_power_mgnt
0

2017년 2월 6일 월요일

rabbitmq esp8266 mqtt -> amqp

ESP8266 을 사용하여 수집된 데이터를 rabbitmq 에 전송하고, 
AQMP 를 사용하여 데이터를 수집하는 코드 샘플.






receive.py

#!/usr/bin/env python
import pika

credentials = pika.PlainCredentials('test', 'testpass')

parameters = pika.ConnectionParameters('192.168.1.28',
                                   5672,
                                   '/energy',
                                   credentials)

connection = pika.BlockingConnection(parameters)
channel = connection.channel()

channel.exchange_declare(exchange='amq.topic', type='topic', durable=True)

result=channel.queue_declare(exclusive=True)

queue_name=result.method.queue

channel.queue_bind(exchange='amq.topic'
                      queue=queue_name,
                      routing_key="outTopic")

def callback(ch, method, properties, body):
    print(" [x] Received %r" % body)

channel.basic_consume(callback,
                      queue=queue_name,
                      no_ack=True)

print(' [*] Waiting for messages. To exit press CTRL+C')
channel.start_consuming()


ESP12-MQTT-example01.ino 

/*
 Basic ESP8266 MQTT example

 This sketch demonstrates the capabilities of the pubsub library in combination
 with the ESP8266 board/library.

 It connects to an MQTT server then:
  - publishes "hello world" to the topic "outTopic" every two seconds
  - subscribes to the topic "inTopic", printing out any messages
    it receives. NB - it assumes the received payloads are strings not binary
  - If the first character of the topic "inTopic" is an 1, switch ON the ESP Led,
    else switch it off

 It will reconnect to the server if the connection is lost using a blocking
 reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to
 achieve the same result without blocking the main loop.

 To install the ESP8266 board, (using Arduino 1.6.4+):
  - Add the following 3rd party board manager under "File -> Preferences -> Additional Boards Manager URLs":
       http://arduino.esp8266.com/stable/package_esp8266com_index.json
  - Open the "Tools -> Board -> Board Manager" and click install for the ESP8266"
  - Select your ESP8266 in "Tools -> Board"

*/

#include <ESP8266WiFi.h>
#include <PubSubClient.h>

// Update these with values suitable for your network.

const char* ssid = "YOUR_SSID";
const char* password = "AP_PASSWORD";
const char* mqtt_server = "192.168.1.28";

WiFiClient espClient;
PubSubClient client(espClient);
long lastMsg = 0;
char msg[50];
int value = 0;

void setup() {
  pinMode(BUILTIN_LED, OUTPUT);     // Initialize the BUILTIN_LED pin as an output
  Serial.begin(115200);
  setup_wifi();
  client.setServer(mqtt_server, 1883);
  client.setCallback(callback);
}

void setup_wifi() {

  delay(10);
  // We start by connecting to a WiFi network
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  for (int i = 0; i < length; i++) {
    Serial.print((char)payload[i]);
  }
  Serial.println();

  // Switch on the LED if an 1 was received as first character
  if ((char)payload[0] == '1') {
    digitalWrite(BUILTIN_LED, LOW);   // Turn the LED on (Note that LOW is the voltage level
    // but actually the LED is on; this is because
    // it is acive low on the ESP-01)
  } else {
    digitalWrite(BUILTIN_LED, HIGH);  // Turn the LED off by making the voltage HIGH
  }

}

void reconnect() {
  // Loop until we're reconnected
  while (!client.connected()) {
    Serial.print("Attempting MQTT connection...");
    // Attempt to connect
    if (client.connect("ESP8266Client", "test", "testpass")) {
      Serial.println("connected");
      // Once connected, publish an announcement...
      client.publish("outTopic", "hello world");
      // ... and resubscribe
      client.subscribe("inTopic");
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      Serial.println(" try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(5000);
    }
  }
}
void loop() {

  if (!client.connected()) {
    reconnect();
  }
  client.loop();

  long now = millis();
  if (now - lastMsg > 2000) {
    lastMsg = now;
    ++value;
    snprintf (msg, 75, "hello world #%ld", value);
    Serial.print("Publish message: ");
    Serial.println(msg);
    client.publish("outTopic", msg);
  }
}

2017년 2월 5일 일요일

rabbitmq ipv4 서비스

rabbitmq 서비스 재시작.

pi@rabbit-pi:/etc/rabbitmq $ sudo systemctl restart rabbitmq-server


최초 실행 시 rabbitmq 는 ipv6 에서 5672 서비스 가능.
pi@rabbit-pi:~/test $ netstat -an|more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:15672           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN     
tcp        0      0 192.168.1.28:22         192.168.1.13:42954      ESTABLISHED
tcp        0      0 192.168.1.28:22         192.168.1.13:43512      ESTABLISHED
tcp        0      0 192.168.1.28:22         192.168.1.13:43500      ESTABLISHED
tcp        0      0 127.0.0.1:40659         127.0.0.1:4369          ESTABLISHED
tcp        0      0 127.0.0.1:4369          127.0.0.1:40659         ESTABLISHED
tcp        0      0 127.0.1.1:4369          127.0.0.1:41022         TIME_WAIT  
tcp6       0      0 :::5672                 :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:6010                :::*                    LISTEN     
tcp6       0      0 ::1:6011                :::*                    LISTEN     
tcp6       0      0 ::1:57068               ::1:5672                ESTABLISHED
tcp6       0      0 ::1:5672                ::1:57068               ESTABLISHED
tcp6       0      0 ::1:57962               ::1:6011                TIME_WAIT  
udp        0      0 0.0.0.0:68              0.0.0.0:*                          
udp        0      0 192.168.1.28:123        0.0.0.0:*                          
udp        0      0 127.0.0.1:123           0.0.0.0:*                          
udp        0      0 0.0.0.0:123             0.0.0.0:*                          
udp        0      0 0.0.0.0:50330           0.0.0.0:*                          
udp        0      0 0.0.0.0:5353            0.0.0.0:*                          
udp6       0      0 :::34779                :::*                               
udp6       0      0 fe80::8aa2:e9e0:b44:123 :::*                               
udp6       0      0 ::1:123                 :::*                               
udp6       0      0 :::123                  :::*                               
udp6       0      0 :::5353                 :::*                               
raw6       0      0 :::58                   :::*                    7          

ipv4 서비스 하기 위해 /etc/rabbitmq/rabbitmq.config 파일 생성(최초 설치 시 없는파일 이므로 만들어 사용).

pi@rabbit-pi:/etc/rabbitmq $ cat /etc/rabbitmq/rabbitmq.config 
[
  {rabbit, [
    {tcp_listeners, [{"0.0.0.0", 5672},
                     {"::1",       5672}]}
  ]}
].

서비스 restart
pi@rabbit-pi:/etc/rabbitmq $ sudo systemctl restart rabbitmq-server


network 서비스 확인

pi@rabbit-pi:/etc/rabbitmq $ netstat -an|more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:5672            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:15672           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:43999         127.0.1.1:25672         TIME_WAIT  
tcp        0      0 127.0.0.1:4369          127.0.0.1:46258         TIME_WAIT  
tcp        0      0 127.0.0.1:33074         127.0.0.1:4369          ESTABLISHED
tcp        0      0 192.168.1.28:22         192.168.1.13:42954      ESTABLISHED
tcp        0      0 127.0.0.1:44711         127.0.0.1:4369          TIME_WAIT  
tcp        0      0 127.0.0.1:4369          127.0.0.1:33074         ESTABLISHED
tcp        0      0 192.168.1.28:22         192.168.1.13:43512      ESTABLISHED
tcp        0      0 127.0.1.1:4369          127.0.0.1:35267         TIME_WAIT  
tcp        0      0 192.168.1.28:22         192.168.1.13:43500      ESTABLISHED
tcp        0      0 127.0.1.1:4369          127.0.0.1:53111         TIME_WAIT  
tcp        0      0 127.0.0.1:35131         127.0.0.1:4369          TIME_WAIT  
tcp        0      0 127.0.1.1:4369          127.0.0.1:42002         TIME_WAIT  
tcp        0      0 127.0.0.1:60629         127.0.0.1:4369          TIME_WAIT  
tcp        0      0 127.0.1.1:4369          127.0.0.1:35784         TIME_WAIT  
tcp6       0      0 ::1:5672                :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:6010                :::*                    LISTEN     
tcp6       0      0 ::1:6011                :::*                    LISTEN     
udp        0      0 0.0.0.0:68              0.0.0.0:*                          
udp        0      0 192.168.1.28:123        0.0.0.0:*                          
udp        0      0 127.0.0.1:123           0.0.0.0:*                          
udp        0      0 0.0.0.0:123             0.0.0.0:*                          
udp        0      0 0.0.0.0:50330           0.0.0.0:*                          
udp        0      0 0.0.0.0:5353            0.0.0.0:*                          
udp6       0      0 :::34779                :::*                               
udp6       0      0 fe80::8aa2:e9e0:b44:123 :::*                               
udp6       0      0 ::1:123                 :::*                               
udp6       0      0 :::123                  :::*                               
udp6       0      0 :::5353                 :::*                               
raw6       0      0 :::58                   :::*                    7          



2016년 10월 3일 월요일

redhat ceph 1.3 install

subscription-manager repos --enable=rhel-7-server-rhceph-1.3-calamari-rpms --enable=rhel-7-server-rhceph-1.3-installer-rpms --enable=rhel-7-server-rhceph-1.3-tools-rpms --enable=rhel-7-server-rhceph-1.3-mon-rpms --enable=rhel-7-server-rhceph-1.3-osd-rpms


setenforce 0
systemctl disable firewalld
systemctl stop firewalld


sudo yum install yum-utils -y

sudo yum-config-manager --disable epel


yum install ntp -y

systemctl enable ntpd
systemctl restart ntpd

ntpq -p


useradd ceph
passwd ceph

password



cat << EOF >/etc/sudoers.d/ceph
ceph ALL = (root) NOPASSWD:ALL
Defaults:ceph !requiretty
EOF

sudo chmod 0440 /etc/sudoers.d/ceph

su - ceph


ssh-keygen

ssh-copy-id ceph@cephmon01
ssh-copy-id ceph@cephmon02
ssh-copy-id ceph@radosgw01
ssh-copy-id ceph@radosgw02
ssh-copy-id ceph@cephosd01
ssh-copy-id ceph@cephosd02
ssh-copy-id ceph@cephosd03
ssh-copy-id ceph@cephosd04
ssh-copy-id ceph@cephosd05



vi ~/.ssh/config

Host radosgw01
   Hostname radosgw01
   User ceph
Host radosgw02
   Hostname radosgw02
   User ceph
Host cephmon01
   Hostname cephmon01
   User ceph
Host cephmon02
   Hostname cephmon02
   User ceph
Host cephosd01
   Hostname cephosd01
   User ceph
Host cephosd02
   Hostname cephosd02
   User ceph
Host cephosd03
   Hostname cephosd03
   User ceph
Host cephosd04
   Hostname cephosd04
   User ceph
Host cephosd05
   Hostname cephosd05
   User ceph


chmod 600 ~/.ssh/config

sudo yum install ceph-deploy calamari-server calamari-clients -y


mkdir ~/ceph-config
cd ~/ceph-config

ceph-deploy new cephmon01 cephmon02



[global]
fsid = 4652d0b0-5c80-4fb0-9dea-5bb049c5a735
mon_initial_members = cephmon01
mon_host = 10.1.0.236,10.1.0.237
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx

public_network = 10.1.0.0/24
cluster_network = 192.168.200.0/24

journal_size = 10000
osd_pool_default_size = 3
osd_pool_default_min_size = 2

osd_crush_chooseleaf_type = 1
osd_crush_update_on_start = false
max_open_files = 131072



ceph-deploy install --mon cephmon01 cephmon02
ceph-deploy install --rgw radosgw01 radosgw02
ceph-deploy install --osd cephosd01 cephosd02 cephosd03 cephosd04 cephosd05



10.1.0.232 radosgw01
10.1.0.233 radosgw02

10.1.0.236 cephmon01
10.1.0.237 cephmon02

10.1.0.240 cephosd01
10.1.0.241 cephosd02
10.1.0.242 cephosd03
10.1.0.243 cephosd04
10.1.0.244 cephosd05



ceph-deploy mon create-initial
ceph-deploy calamari connect --master cephadmin.time-gate.com cephmon01 cephmon02
ceph-deploy calamari connect --master cephadmin.time-gate.com cephosd01 cephosd02 cephosd03

 


ceph-deploy disk zap cephosd01:vdb cephosd02:vdb cephosd03:vdb cephosd04:vdb cephosd05:vdb

ceph-deploy osd prepare cephosd01:vdb cephosd02:vdb cephosd03:vdb cephosd04:vdb cephosd05:vdb

ceph-deploy osd activate cephosd01:vdb1:vdb2 cephosd02:vdb1:vdb2 cephosd03:vdb1:vdb2 cephosd04:vdb1:vdb2 cephosd05:vdb1:vdb2

ceph-deploy install --cli cephadmin
ceph-deploy admin cephadmin

sudo chmod +r /etc/ceph/ceph.client.admin.keyring

ceph quorum_status --format json-pretty




[ceph@cephadmin ceph-config]$ ceph-deploy rgw create radosgw01 radosgw02


http://10.1.0.232:7480/


####  OSD Purge
ceph-deploy purge cephosd01 cephosd02 cephosd03 cephosd04 cephosd05
ceph-deploy purgedata cephosd01 cephosd02 cephosd03 cephosd04 cephosd05

#### FULL Purge
ceph-deploy purge cephosd01 cephosd02 cephosd03 cephosd04 cephosd05 radosgw01 radosgw02 cephmon01 cephmon02 cephadmin
ceph-deploy purgedata cephosd01 cephosd02 cephosd03 cephosd04 cephosd05 radosgw01 radosgw02 cephmon01 cephmon02 cephadmin





ceph osd lspools

ceph osd pool delete rbd rbd --yes-i-really-really-mean-it

ceph osd pool create rbd 128 128



ceph osd pool set rbd pg_num 128
ceph osd pool set rbd pgp_num 128

##### osd 제거 추가/


1. 5개 각 osd node에서 실행.
/etc/init.d/ceph stop osd


2. admin node 에서

ceph osd pool delete rbd rbd --yes-i-really-really-mean-it


3. 5개 각 osd node에서 실행.
/etc/init.d/ceph start osd

4. 재설치시 인증에러 발생하면 key 삭제 후 다시 activate

[ceph@cephadmin ceph-config]$ ceph auth del osd.0
updated
[ceph@cephadmin ceph-config]$ ceph auth del osd.1
updated
[ceph@cephadmin ceph-config]$ ceph auth del osd.2
updated
[ceph@cephadmin ceph-config]$ ceph auth del osd.3
updated
[ceph@cephadmin ceph-config]$ ceph auth del osd.4
updated




ceph osd down, rm, out 후 다시 activate

sudo ceph osd crush remove osd.4
sudo ceph auth del osd.4
sudo ceph osd rm 4

ceph pg repair 0.2c

ceph osd out 1
ceph osd down 1
ceph osd rm 1



버그 해결 문서
최초 설치 후  rbd pool 제거 하고 다시 설치.
https://access.redhat.com/webassets/avalon/d/Red_Hat_Ceph_Storage-1.3.1-Release_Notes-en-US/Red_Hat_Ceph_Storage-1.3.1-Release_Notes-en-US.pdf


### bucket 구성


ceph osd crush add-bucket tg-center datacenter
ceph osd crush add-bucket mr01 room
ceph osd crush add-bucket row01 row
ceph osd crush add-bucket rack01 rack

ceph osd crush add-bucket cephosd01 host
ceph osd crush add-bucket cephosd02 host
ceph osd crush add-bucket cephosd03 host
ceph osd crush add-bucket cephosd04 host
ceph osd crush add-bucket cephosd05 host

ceph osd crush move tg-center root=default
ceph osd crush move mr01 datacenter=tg-center
ceph osd crush move row01 room=mr01
ceph osd crush move rack01 row=row01

ceph osd crush move cephosd01 rack=rack01
ceph osd crush move cephosd02 rack=rack01
ceph osd crush move cephosd03 rack=rack01
ceph osd crush move cephosd04 rack=rack01
ceph osd crush move cephosd05 rack=rack01


### 모니터 노드에서. crushmap 수정 방법


ceph osd getcrushmap -o crushmap
crushtool -d crushmap -o crushmap.txt

#Devices
device 0 osd.0
device 1 osd.1
device 2 osd.2
device 3 osd.3
device 4 osd.4

를 추가


crushmap 수정 후

crushtool -c crushmap.txt -o crushmap

ceph osd setcrushmap -i crushmap


ceph osd crush set osd.0 1.0 root=default datacenter=tg-center room=mr01 row=row01 rack=rack01 host=cephosd01
ceph osd crush set osd.1 1.0 root=default datacenter=tg-center room=mr01 row=row01 rack=rack01 host=cephosd02
ceph osd crush set osd.2 1.0 root=default datacenter=tg-center room=mr01 row=row01 rack=rack01 host=cephosd03
ceph osd crush set osd.3 1.0 root=default datacenter=tg-center room=mr01 row=row01 rack=rack01 host=cephosd04
ceph osd crush set osd.4 1.0 root=default datacenter=tg-center room=mr01 row=row01 rack=rack01 host=cephosd05

2016년 9월 26일 월요일

Redhat7 infiniband bonding + bridge

[root@openstack01 network-scripts]# cat ifcfg-ib0
CONNECTED_MODE=yes
TYPE=InfiniBand
BOOTPROTO=no
#DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ib0
UUID=af984bff-db23-4c53-b234-2d52b6029fed
DEVICE=ib0
ONBOOT=yes
HWADDR=80:00:02:0A:FE:80:00:00:00:00:00:00:00:21:28:00:01:CF:56:7F
MTU=65520
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
MASTER=bond1
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no


[root@openstack01 network-scripts]# cat ifcfg-ib1
CONNECTED_MODE=yes
TYPE=InfiniBand
BOOTPROTO=none
#DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ib1
UUID=0a441295-38bb-4407-9f6a-e36a9cc854ef
DEVICE=ib1
ONBOOT=yes
HWADDR=80:00:02:0B:FE:80:00:00:00:00:00:00:00:21:28:00:01:CF:56:80
MTU=65520
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
MASTER=bond1
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
[root@openstack01 network-scripts]#

[root@openstack01 network-scripts]# cat ifcfg-bond1 
NAME=bond1
DEVICE=bond1
BONDING_MASTER=yes
TYPE=Bond
IPADDR=192.168.10.4
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=active-backup miimon=100"
NM_CONTROLLED=no
[root@openstack01 network-scripts]# 

[root@openstack01 network-scripts]# cat ifcfg-virbr1
DEVICE="virbr1"
TYPE=BRIDGE
ONBOOT=yes
BOOTPROTO=none
IPADDR="192.168.10.4"
PREFIX=24
[root@openstack01 network-scripts]#