База знаний
База знаний:
SmartOS: commands notepad
Автор [ADMINGROUP] Oleksandr Usov,
Notice
Undefined index: lastmodifiedby (./__swift/cache/91a994f85f9b0c3e5bee9515d3a61aa7.php:44)
Copy to clipboard:
[ADMINGROUP] Oleksandr Usov на 10 December 2018 07:09 PM

SmartOS delete vnic 'gw0' on etherstub 'switch0'.

dladm delete-etherstub switch0
dladm: vnic deletion failed: link busy

dladm delete-vnic gw0
dladm: vnic deletion failed: link busy

 

Solution:

ipadm delete-if gw0

dladm delete-vnic gw0

dladm delete-etherstub switch0 

 

When problem with 'sysinfo' update status:

rm -fr /tmp/.sysinfo.*

And check again.

 

#Create lan0 vnic on the phys interface with vlan 172:

dladm create-vnic -v 172 -l rge0 lan0

ipadm create-addr -T static -a 172.16.0.1/24 lan0/v4

[root@c8-60-00-df-0e-ca ~]# dladm create-vlan -l rge0 -v 172
[root@c8-60-00-df-0e-ca ~]# dladm create-vnic -l rge0 lan0 -v 172
[root@c8-60-00-df-0e-ca ~]# ipadm create-addr -T static -a 172.16.0.1/24 lan0/v4 

https://gist.github.com/baetheus/5e1e5ab1eb68fae3490d

 

#Changing default GW of created VM

https://wiki.smartos.org/display/DOC/Using+vmadm+to+manage+virtual+machines#Usingvmadmtomanagevirtualmachines-UpdatingaVM
We need to do the same but with gateway
put your current mac address from VM net0 and new gateway

#Настройка отказоусточивой сети с плавающим IP между VM разных физических серверов

https://wiki.smartos.org/display/DOC/Managing+NICs#ManagingNICs-AddingVRRPnicstoVMs

https://wiki.smartos.org/display/DOC/High+Availability+with+Wackamole

 

#Change VM memory size

echo '{"max_physical_memory": 2048}' | vmadm update 0e8f3e94-0914-41d8-bc46-cc0c294c85a7

 

# Изменить источник dataset-ов для fifo

/opt/local/fifo-jingles/dist/scripts/config.js

 

#Дополнительные пакеты для SmartOS

https://pkgsrc.joyent.com/install-on-illumos/

 

Multihomed FiFO + NATed LeoFS
 Если fifo работает на двух интерфейсах - прямом выходе в интернет и локальном (в локальной сети настроены зоны LeoFS), то нужно после первой установки служб fifo, отредактировать параметр s3.host с публичного адреса на внутренний.

[root@fifo-firewall /opt/local/fifo-sniffle/etc]# cat sniffle.conf | grep s3
## Chunk size to upload to s3, please beware that this needs to match
s3image_chunk_size = 5MB
##   - one of: internal, s3
s3.bucket.image = fifo-images
s3.bucket.snapshot = fifo-snapshots
s3.bucket.general = fifo
## s3.access_key = access_key
## s3.secret_key = secret_key
s3.host = 172.16.0.2:8443

 

/opt/fifo-fw.json
{
 "alias": "fifo-firewall",
 "hostname": "fifo-firewall",
  "brand": "joyent",
  "max_physical_memory": 1024,
  "dataset_uuid": "d34c301e-10c3-11e4-9b79-5f67ca448df0",
  "default_gateway": "PU.BL.IC.GW",
  "cpu_cap": 100,
  "quota": "10",

  "resolvers": [
    "8.8.8.8",
    "8.8.4.4"
     ],
  "nics": [
    {
      "nic_tag": "admin",
      "ip": "PU.BL.IC.IP",
      "netmask": "255.255.255.224",
      "mac": "00:50:56:00:5D:07",
      "allow_ip_spoofing": "1",
      "gateway": "PU.BL.IC.GW",
      "primary": "1"
    },
    {
      "nic_tag": "lan",
      "ip": "172.16.0.2",
      "netmask": "255.255.255.0",
      "allow_ip_spoofing": "1",
      "vlan_id": "172"
    }
  ]
}

 

#ipfilter ipnar port range redirect (forward) in illumos/solaris (smartos)

#FreeSWITCH
rdr net0 from any to any port = https -> 172.16.0.21 port 443 tcp
rdr net0 from any to any port = 5060 -> 172.16.0.21 port 5060 udp
rdr net0 from any to any port = 5061 -> 172.16.0.21 port 5061 tcp
rdr net0 from any to any port 16300 >< 18300 -> 172.16.0.21 port 16300 udp

#Install git to SmartOS global zone (based on changing root password: umount /etc/shadow; cp /usbkey/shadow /etc/shadow; passwd root; cp /etc/shadow /usbkey/shadow )

При установке git возникает проблема с установкой зависимости - пакета cyrus-sasl, т.к. невозможно добавить пользователя в read-only систему SmartOS. Добавим пользователя вручную, с теми параметрами, которые рекомендуют разработчики cyrus, а именно:

The following users need to be created for cyrus-sasl-2.1.26nb4:

        cyrus (uid = 977): mail, /nonexistent, /usr/bin/bash

Выполняем:

umount /etc/shadow; cp /usbkey/shadow /etc/shadow;
useradd -u 977 -g mail -d /nonexistent -s /usr/bin/bash cyrus
cp /etc/shadow /usbkey/shadow

pkgin in git

#virtio drivers for Windows KVM guests - most stable

http://pkg.blackdot.be/extras/

http://nbyteam.com/Create-The-Win-VM-In-SMartOS/

 

#проверка логово, связанных с конкретным сервисом (например, ipfilter)

# https://youtu.be/-zRN7XLCRhc?t=54m38s

cat `svcs -L ipfilter`

 

#fifo сервер - проблема после изменения IP в конфиге сервисов с основного интерфейса (автоматически определяется и записывается в конфиги во время установки) на IP интерфейса локальной сети.

Debug: 2015-08-15 19:27:13.937 [error] <0.206.0> gen_server riak_core_capability terminated with reason: no function clause matching orddict:fetch('sniffle@172.16.0.2', [{'sniffle@OLD.IP.HE.RE',[{{riak_core,bucket_types},[true,false]},{{riak_core,fold_req_version},...},...]}]) line 72

Решение: удалить на сервере fifo все файлы /var/db/snarl/ring/riak_core_ring.default* и по аналогии в других подкаталогах /var/db/*/ring/*

 

#ZFS - тесты

iostat -xnz 1

http://www.brendangregg.com/Slides/zfsperftools2012.pdf

KVM does all synchronous write I believe so its gionna be slow anyway
Especially with a mirror write penalty too
For KVM I like to put in a couple of SSD, one for zil and one for l2arc

#SmartOS Zones vs KVM vs XEN

http://dtrace.org/blogs/brendan/2013/01/11/virtualization-performance-zones-kvm-xen/

 

#FusionPBX vs PosgreSQL replication ("The one in the video is the one with call recovery but I do not want that. I just allow the calls the are on to end.")

https://www.youtube.com/watch?v=_3ldDphLPEU

 

#Autoboot (autostart) VM after reboot SmartOS

SmartOS will start after own reboot only VM which was run before rebooting SmartOS ( {"autoboot": true} VM settings will be ignored in this case).

#FiFO - delete dataset command line

sniffle-admin datasets delete 486dbfde-44f3-11e5-bdc1-ab9ecb8f6e3

 

#FiFo creating new VM - failed

Виртуальная машина может не развернуться (provision) во время ее создания, если ей недостаточно выделели ресурсов (слишком слабый пакет по характеристикам CPU, memory, disk space).

 

#SmartosPBX Standalone Upgrade method from DigiDaz at #project-fifo IRC channel

cd /var/www
cp fusionpbx/resources/config.php .
rm -fR fusionpbx
git clone http://git.smartospbx.com/root/fusionpbx.git
cd fusionpbx
git checkout smartospbx-standalone
cp ../config.php resources/config.php
chown -R www:www /var/www

MerlinDMC: just as a pointer ... delegated dataset or a mounted filesystem for all data and then to upgrade use the reprovision function vmadm offers
MerlinDMC: would just need to be sure that the used dataset stored data in a mounted FS or the delegated dataset so the reprovision will not kill valuable data

 

 


Комментарии (0)
Добавить новый комментарий
 
 
Полное имя:
Email:
Комментарии: