<div><span><span style="background-color:#ffffff;" title="Процедура настройки репозитория состоит из следующих этапов:
<br>">Creating OpenSolaris 2009.06 repository </span></span></div><div><span><span style="background-color:#ffffff;" title="Процедура настройки репозитория состоит из следующих этапов:
<br>">The procedure for setting the repository consists of the following stages: <br /></span><span style="background-color:#ffffff;" title="- Получение ISO-образа с репозиторием OpenSolaris
<br>">- Preparation of ISO-image from the OpenSolaris repository <br /></span><span style="background-color:#ffffff;" title="- Подготовка файловой системы
<br>">- Preparation of the file system <br /></span><span style="background-color:#ffffff;" title="- Копирование содержимого репозитория из образа
<br>">- Copy the contents of the image repository <br /></span><span style="background-color:#ffffff;" title="- Настройка сервера через сервисы
<br>">- Setting up a server through the services <br /></span><span style="background-color:#ffffff;" title="- Настройка клиента и проверка работоспособности сервера
<br>">- Configure client and server health check <br /></span><span title="- Обновление пакетов и исправление контрольных сумм
<br>">- Upgrading packages and fix checksums <br /></span><span title="- Окончательное тестирование
<br>">- Final testing <br /></span><span style="background-color:#ffffff;" title="Далее рассмотрим, что нужно сделать на каждом этапе.
<br>">Next, consider what to do at each stage. <br /></span><span style="background-color:#ffffff;" title="Получение ISO-образа с репозиторием OpenSolaris
<br>">Obtaining ISO-image with the repository OpenSolaris <br /></span><span style="background-color:#ffffff;" title="Итак для настройки репозитория нам понадобится образ содержащий пакеты репозитория
<br>">So to set up a repository, we need an image repository containing packages <br /></span><span style="background-color:#ffffff;" title="его можно скачать, например на genunix.org или sun.com, а точнее так:
<br>">it can be downloaded, such as genunix.org or sun.com, or more precisely as follows: <br /></span><span style="background-color:#ffffff;" title="# wget http://www.genunix.org/dist/indiana/osol-repo-0906-full.iso
<br>"># Wget http://www.genunix.org/dist/indiana/osol-repo-0906-full.iso <br /></span><span title="или так:
<br>">or as follows: <br /></span><span style="background-color:#ffffff;" title="# wget http://dlc.sun.com.edgesuite.net/osol/opensolaris/2009/06/osol-repo-0906-full.iso
<br>"># Wget http://dlc.sun.com.edgesuite.net/osol/opensolaris/2009/06/osol-repo-0906-full.iso <br /></span><span style="background-color:#ffffff;" title="Репозиторий можно скачать в виде 2-ух образов, которые помещаются на DVD-диск объемом
<br>">The repository can be downloaded in the form of 2-images that fit on a DVD-disk capacity <br /></span><span style="background-color:#ffffff;" title="4,7 Гб, либо в виде одного образа размером около 7,2 Гб.">4.7GB, either as a single image the size of about 7.2 GB. </span><span title="Приведенные выше ссылки
<br>">These links <br /></span><span style="background-color:#ffffff;" title="указывают на репозиторий в единственном образе.">point to the repository in a single image. </span><span title="Впрочем, версию в двух образах можно
<br>">However, the version in two images can be <br /></span><span title="найти рядом.
<br>">found close by. <br /></span><span title="Подготовка файловой системы
<br>">Preparation filesystem <br /></span><span style="background-color:#ffffff;" title="Создадим отдельную файловую систему ZFS для того, что бы разместить на ней
<br>">Create a separate ZFS file system for that would place her <br /></span><span title="репозиторий.">repository. </span><span style="background-color:#ffffff;" title="Отдельная файловая систем а ZFS для репозитория дает нам следующие
<br>">Separate file systems and ZFS repository gives us the following <br /></span><span title="преимущества:
<br>">Advantages: <br /></span><span title="l Достигается лучшая производительность
<br>">l results in better performance <br /></span><span style="background-color:#ffffff;" title="l Возможность установки индивидуальных параметров для файловой системы, таких
<br>">l Ability to set individual parameters for the file system, such <br /></span><span title="как сжатие и обновление времени доступа
<br>">as compression and update access time <br /></span><span style="background-color:#ffffff;" title="l Создание снапшотов и бэкапов файловой системы с репозиторием
<br>">l Create snapshots and backups of the file system to the repository <br /></span><span title="Для экономии дискового пространства применим сжатие(опция compression), а для
<br>">To save disk space applies compression (optional compression), and for <br /></span><span title="увеличения быстродействия отключим обновление времени доступа(опция atime).
<br>">improve performance, disable access time updates (optional atime). <br /></span><span title="Естественно, что все команды здесь и далее должны выполняться с правами
<br>">Naturally, all the team here and should continue to run as <br /></span><span title="суперпользователя.">superuser. </span><span title="Создаем:
<br>">Create: <br /></span><span title="# zfs create -o compression=on -o atime=off rpool/repo
<br>"># Zfs create-o compression = on-o atime = off rpool / repo <br /></span><span style="background-color:#ffffff;" title="Теперь когда у нас есть файловая система для репозитория и собственно сами данные в
<br>">Now we have a file system repository and the actual data itself in <br /></span><span title="образе, нужно скопировать данные из образа на жесткий диск.
<br>">image, copy the data from the image to your hard drive. <br /></span><span title="Копирование содержимого репозитория из образа
<br>">Copying the contents of the image repository <br /></span><span title="Для копирования данных нужно смонтировать образ репозитория, и затем скопировать все
<br>">To copy the data you need to mount the image repository, and then copy all <br /></span><span title="данные в, подготовленное нами на предыдущем шаге, место:
<br>">data prepared in the previous step, place: <br /></span><span title="# mount -F hsfs $(lofiadm -a /downloads/osol-repo-0906-full.iso) /mnt
<br>"># Mount-F hsfs $ (lofiadm-a / downloads/osol-repo-0906-full.iso) / mnt <br /></span><span title="# rsync -aP /mnt/repo /rpool/repo
<br>"># Rsync-aP / mnt / repo / rpool / repo <br /></span><span title="Обратите внимание: отсутствие слэшей в конце путей принципиально (для получения
<br>">Please note: no trailing slash ways fundamentally (for <br /></span><span title="подробностей обращайтесь к man rsync.).">details, refer to the man rsync.). </span><span title="После того, как репозиторий скопирован образ
<br>">Once copied image repository <br /></span><span title="можно отмонтировать:
<br>">can unmount: <br /></span><span title="# umount /mnt
<br>"># Umount / mnt <br /></span><span title="# lofiadm -d /dev/lofi/1
<br>"># Lofiadm-d / dev/lofi/1 <br /></span><span title="В последней строке возможна другая цифра в зависимости от подключенных на данный
<br>">The last line can be different depending on the number of connected active <br /></span><span title="момент устройств.">the devices. </span><span title="Итак, репозиторий получен и скопирован переходим к настройке сервиса.
<br>">So repository obtained and copied proceed to configure the service. <br /></span><span title="Настройка сервера через сервисы
<br>">Setting up the server through the services <br /></span><span title="Теперь нам необходимо настроить сервис обслуживающий репозиторий, его исполняемый
<br>">Now we need to set up housekeeping service repository, its executable <br /></span><span title="файл находиться в /usr/lib и называется pkg.depotd (подробнее смотрите man pkg.depotd).
<br>">The file is located in / usr / lib and called pkg.depotd (for details see man pkg.depotd). <br /></span><span style="background-color:#ffffff;" title="Сначала необходимо указать корневой каталог нашего репозитория, который мы подготовили
<br>">Please specify the root directory of our repository which we have prepared <br /></span><span title="ранее:
<br>">previously: <br /></span><span title="# svccfg -s pkg/server setprop pkg/inst_root=/rpool/repo/repo
<br>"># Svccfg-s pkg / server setprop pkg / inst_root = / rpool / repo / repo <br /></span><span title="Опционально можно указать порт (по умолчанию 80).">Optionally, you can specify the port (default is 80). </span><span title="Установим его значение равным 10000:
<br>">Set the value to 10000: <br /></span><span title="# svccfg -s pkg/server setprop pkg/port=10000
<br>"># Svccfg-s pkg / server setprop pkg / port = 10000 <br /></span><span style="background-color:#ffffff;" title="Копируем конфигурационный файл и указываем путь к нему для сервиса:
<br>">Copy the configuration file and specify the path for the service: <br /></span><span title="# cp -p /rpool/repo/repo/cfg_cache /rpool/repo/
<br>"># Cp-p / rpool / repo / repo / cfg_cache / rpool / repo / <br /></span><span title="# svccfg -s pkg/server setprop pkg/cfg_file=/rpool/repo/cfg_cache
<br>"># Svccfg-s pkg / server setprop pkg / cfg_file = / rpool / repo / cfg_cache <br /></span><span title="Далее правим конфигурационный файл:
<br>">Next, we correct the configuration file: <br /></span><span title="# vi /rpool/repo/cfg_cache
<br>"># Vi / rpool / repo / cfg_cache <br /></span><span title="Нужно поменять значение параметра origins и указать адрес репозитория, на доступное по
<br>">Need to change the setting origins and specify the address of the repository for available for <br /></span><span title="сети имя, например http://sunadm.spb.su:10000.">network name, such http://sunadm.spb.su:10000. </span><span title="Необязательно, но можно поменять некоторые
<br>">Optional, but you can change some <br /></span><span title="другие параметры и добавить туда например название вашей организации.
<br>">other settings and add the name of your organization eg. <br /></span><span title="Далее можно проверить правильно ли мы изменили настойки:
<br>">Then you can check if we changed the tincture: <br /></span><span title="# svcadm refresh application/pkg/server
<br>"># Svcadm refresh application / pkg / server <br /></span><span title="# svcprop pkg/server
<br>"># Svcprop pkg / server <br /></span><span title="И посмотреть в выводе последней команды внесены ли наши изменения.">And see in the output of the last command made whether our changes. </span><span title="Если все в порядке
<br>">If everything is in order <br /></span><span title="запускаем сервис:
<br>">run the service: <br /></span><span title="# svcadm restart application/pkg/server
<br>"># Svcadm restart application / pkg / server <br /></span><span title="# svcadm enable application/pkg/server
<br>"># Svcadm enable application / pkg / server <br /></span><span title="На этом настройка репозитория закончена.">The configuration repository is finished. </span><span title="Далее мы настроим клиента на использование
<br>">Then configure the client to use <br /></span><span title="нашего репозитория и проверим его работоспособность, затем обновим репозиторий и
<br>">our repository and verify that it is working, and then update the repository and <br /></span><span title="проведем окончательную проверку.
<br>">carry out a final check. <br /></span><span title="Настройка клиента и проверка работоспособности сервера
<br>">To configure the client and server health check <br /></span><span title="Клиент может использовать наш репозиторий либо как основной репозиторий, либо как
<br>">The client can use our repository or as the main repository or as <br /></span><span title="зеркало репозитория pkg.opensolaris.org.">mirror repository pkg.opensolaris.org. </span><span title="При использовании нашего репозитория, как зеркала
<br>">When using our repository as a mirror <br /></span><span title="мы теряем автономность.">we lose autonomy. </span><span title="В этом случае клиент производит поиск и другие операции с
<br>">In this case, the client performs the search and other operations <br /></span><span title="метаданными используя основной сервер pkg.opensolaris.org, при установке пакета, если он
<br>">metadata using the primary server pkg.opensolaris.org, when you install the package if it <br /></span><span title="присутствует на нашем зеркале он скачивается с него.">present on our mirror he downloaded from him. </span><span title="При недоступном основном сервере
<br>">When you reach the main server <br /></span><span title="наша система не будет работать.">our system will not work. </span><span title="При использовании нашего репозитория как основного, все
<br>">When using our repository as the core, all <br /></span><span title="взаимодействие производиться только с ним и наша система обретет автономность.">interaction only be with him and our system will gain autonomy. </span><span title="Но в
<br>">But <br /></span><span title="таком случае, если наш репозиторий не обновлен нам не будут доступны последние версии
<br>">Then, if our repository is not updated we will not be the latest version available <br /></span><span title="пакетов.">packets. </span><span title="Для установки нашего репозитория как зеркала pkg.opensolaris.org следует
<br>">To install our repository as mirrors should pkg.opensolaris.org <br /></span><span title="выполнить на клиенте:
<br>">execute on the client: <br /></span><span title="# pkg set-publisher -m http://sunadm.spb.su:10000 opensolaris.org
<br>"># Pkg set-publisher-m http://sunadm.spb.su:10000 opensolaris.org <br /></span><span title="для установки как основного репозитория:
<br>">to set as the main repository: <br /></span><span title="# pkg set-publisher -PO http://sunadm.spb.su:10000 vniira.spb.su
<br>"># Pkg set-publisher-PO http://sunadm.spb.su:10000 vniira.spb.su <br /></span><span title="После того, как репозиторий настроен и подключен можем его проверить.">Once the repository is set up and connected can check it. </span><span title="Например обновим
<br>">For example update <br /></span><span title="наши данные о репозитории, попробуем обновить систему, если есть такая возможность и
<br>">Our data repository, try to update the system, if possible and <br /></span><span title="установим пакет, например nmap:
<br>">install the package, such as nmap: <br /></span><span title="# pkg refresh —full
<br>"># Pkg refresh-full <br /></span><span title="# pkg image-update
<br>"># Pkg image-update <br /></span><span title="# pkg search nmap
<br>"># Pkg search nmap <br /></span><span title="# pkg install SUNWnmap
<br>"># Pkg install SUNWnmap <br /></span><span title="Если все прошло успешно, значит репозиторий нормально функционирует.
<br>">If all goes well, then the repository is functioning normally. <br /></span><span title="К сожалению версия репозитория из образа ISO достаточно стара и не актуальна поэтому
<br>">Unfortunately repository version of the ISO image is old enough and therefore not relevant <br /></span><span title="встает вопрос об ее обновлении, переходим к следующему шагу.
<br>">raises the question of updating it, proceed to the next step. <br /></span><span title="Обновление пакетов и исправление контрольных сумм
<br>">Update packages and fix checksums <br /></span><span title="Для того, что бы иметь текущую версию репозитория теоретически существует 3 пути
<br>">In order to have the current version of the repository in theory there are 3 ways <br /></span><span title="(может и больше):
<br>">(Maybe more): <br /></span><span style="background-color:#ffffff;" title="- Настройка репозитория с выкачиванием всех пакетов с помощью pkgrecv/pkgsend
<br>">- Setting repository pumping out all packages through pkgrecv / pkgsend <br /></span><span style="background-color:#ffffff;" title="(http://developers.sun.ru/content/view/338/31/)
<br>">(Http://developers.sun.ru/content/view/338/31/) <br /></span><span title="- Синхронизация с помощью rsync, у меня на практике так и не заработало.">- Synchronization via rsync, I have to practice and did not work. </span><span title="Либо были
<br>">Or were <br /></span><span title="забиты все 8 возможных соединений, либо удаленный сервер вообще не отвечал на
<br>">crammed all 8 possible connections or remote server does not answer <br /></span><span title="данном порту
<br>">this port <br /></span><span style="background-color:#ffffff;" title="- Синхронизация с помощью сценария на языке Python ips-mirror.py написанный Andrzej
<br>">- Synchronization with a script language Python ips-mirror.py written by Andrzej <br /></span><span style="background-color:#ffffff;" title="Szeszo и выложенный в его блоге по адресу http://aszeszo.blogspot.com/2009/07/ipsrepository-
<br>">Szeszo and laid out in his blog at http://aszeszo.blogspot.com/2009/07/ipsrepository- <br /></span><span title="mirror-script_27.html
<br>">mirror-script_27.html <br /></span><span style="background-color:#ffffff;" title="В данном руководстве мы рассмотрим 3-ий способ, для этого понадобиться два сценария ipsmirror.
<br>">In this tutorial, we will look at the third method, you will need two script ipsmirror. <br /></span><span style="background-color:#ffffff;" title="py для синхронизации и ips_check.py для устранения проблем с контрольными
<br>">py for synchronization and ips_check.py to troubleshoot control <br /></span><span title="суммами.
<br>">sums. <br /></span><span style="background-color:#ffffff;" title="Скачиваем их и копируем в корневой каталог нашего репозитория:
<br>">Download them and copy to the root of our repository: <br /></span><span style="background-color:#ffffff;" title="# wget http://aszeszo.googlepages.com/ips-mirror.py
<br>"># Wget http://aszeszo.googlepages.com/ips-mirror.py <br /></span><span style="background-color:#ffffff;" title="# wget http://github.com/seisen/opensolaris-scripts/raw/master/ips/ips_check.py
<br>"># Wget http://github.com/seisen/opensolaris-scripts/raw/master/ips/ips_check.py <br /></span><span style="background-color:#ffffff;" title="# cp ips-mirror.py /rpool/repo/repo
<br>"># Cp ips-mirror.py / rpool / repo / repo <br /></span><span style="background-color:#ffffff;" title="# cp ips_check.py /rpool/repo/repo
<br>"># Cp ips_check.py / rpool / repo / repo <br /></span><span title="Теперь запускаем ips-mirror.py, например так:
<br>">Now run ips-mirror.py, like this: <br /></span><span title="# cd /rpool/repo/repo
<br>"># Cd / rpool / repo / repo <br /></span><span style="background-color:#ffffff;" title="# python ips-mirror.py -l -a i386 http://pkg.opensolaris.org/release
<br>"># Python ips-mirror.py-l-a i386 http://pkg.opensolaris.org/release <br /></span><span style="background-color:#ffffff;" title="Сценарий проверит содержимое репозитория OpenSolaris, проверит содержимое вашего
<br>">The script will check the contents of the repository OpenSolaris, check the contents of your <br /></span><span style="background-color:#ffffff;" title="репозитория, обновит манифесты и пакеты, удалит старые пакеты.
<br>">repository, update the manifest and packages remove the older versions. <br /></span><span style="background-color:#ffffff;" title="Ключ -l указывает на то, что нам необходимы только последние версии пакетов, а ключ -a
<br>">The-l switch indicates that we need only the latest packages and the key-a <br /></span><span title="архитектуру.">architecture. </span><span title="Для просмотра полного списка ключей запустите сценарий без параметров.
<br>">For a complete list of keys, run the script with no parameters. <br /></span><span style="background-color:#ffffff;" title="Зачастую получается так, что в ходе скачивания и обновления репозитория некоторые пакеты
<br>">Often it turns out that in the course of downloading and updating some packages repository <br /></span><span title="повреждаются и в результате при попытке, что либо установить можно увидеть примерно
<br>">damaged and as a result when you try that either set can be seen around <br /></span><span title="такую ошибку:
<br>">this error: <br /></span><span title="pkg: Maximum number of network retries exceeded during download.">pkg: Maximum number of network retries exceeded during download. </span><span title="Details follow:
<br>">Details follow: <br /></span><span title="Invalid content for action with path usr/lib/python2.4/vendorpackages/
<br>">Invalid content for action with path usr/lib/python2.4/vendorpackages / <br /></span><span title="radialnet/gui/HostsViewer.py chash failure: expected:
<br>">radialnet / gui / HostsViewer.py chash failure: expected: <br /></span><span title="4a28ca3c93af77363b82a1aa442f9f88b49b7d65 computed:
<br>">4a28ca3c93af77363b82a1aa442f9f88b49b7d65 computed: <br /></span><span title="a71f073fa1949496173dcf69675ee8d1f8f67262.">a71f073fa1949496173dcf69675ee8d1f8f67262. </span><span title="(happened 4 times)
<br>">(Happened 4 times) <br /></span><span title="В ее исправлении нам поможет сценарий ips_check.py, запускаем его так:
<br>">It will help us correcting script ips_check.py, run it like this: <br /></span><span title="# cd /rpool/repo/repo
<br>"># Cd / rpool / repo / repo <br /></span><span title="# python ips_check.py --dir=./
<br>"># Python ips_check.py - dir =. / <br /></span><span title="Данный сценарий проверит все контрольные суммы и удалит пакеты для которых она не
<br>">This script will check all the checksums and remove packages that it does not <br /></span><span title="верна.">true. </span><span title="Соответственно после того как он завершиться, если были сообщения об испорченных
<br>">Accordingly, after he completed if there were reports of damaged <br /></span><span title="пакетах следует снова запустить сценарий ips-mirror.py с такими же параметрами, как и
<br>">packages should run the script again ips-mirror.py with the same parameters as <br /></span><span title="прежде для получения недостающих пакетов.">primarily for missing packets. </span><span title="Затем снова проверяем с помощью
<br>">Then check again with the help of <br /></span><span title="ips_check.py, что все в порядке.
<br>">ips_check.py, that's all right. <br /></span><span title="Теперь нужно запустить сервер один раз с ключем –rebuild для того, что бы он пересоздал
<br>">Now you need to run the server once with the key-rebuild for what he recreates <br /></span><span title="каталог.">catalog. </span><span style="background-color:#ffffff;" title="Так же стоит перестроить индексы поиска, после чего можем активировать сервер в
<br>">As it is necessary to rebuild the search indexes, and then can activate the server <br /></span><span title="обычном режиме через сервисы.">normally through the services. </span><span title="Делаем это все так:
<br>">Making it all the way: <br /></span><span title="# cd /rpool/repo/repo
<br>"># Cd / rpool / repo / repo <br /></span><span title="# /usr/lib/pkg.depotd -d $(pwd) -p 10000 —rebuild
<br>"># / Usr / lib / pkg.depotd-d $ (pwd)-p 10000-rebuild <br /></span><span title="ждем пока он окончательно запуститься затем нажимаем , далее:
<br>">wait until he finally start then push further: <br /></span><span title="# rm -rf ./index/*
<br>"># Rm-rf. / Index / * <br /></span><span title="# /usr/lib/pkg.depotd -d $(pwd) -p 10000 —refresh-index
<br>"># / Usr / lib / pkg.depotd-d $ (pwd)-p 10000-refresh-index <br /></span><span title="снова ждем пока он окончальено запуститься затем нажимаем , далее:
<br>">wait again until he okonchaleno then click Start, then: <br /></span><span title="# svcadm enable pkg/server
<br>"># Svcadm enable pkg / server <br /></span><span style="background-color:#ffffff;" title="На этом обновление сервера завершено, проверяем его как и в предыдущий раз:
<br>">On this server upgrade is complete, check it as the previous time: <br /></span><span title="# pkg refresh --full
<br>"># Pkg refresh - full <br /></span><span title="# pkg image-update
<br>"># Pkg image-update <br /></span><span title="# pkg search nmap
<br>"># Pkg search nmap <br /></span><span title="# pkg install SUNWnmap
<br>"># Pkg install SUNWnmap <br /></span><span style="background-color:#ffffff;" title="Теперь у вас есть свой обновленный репозиторий OpenSolaris.">Now you have your new repository OpenSolaris. </span><span title="Дальнейшее обновление
<br>">Further Update <br /></span><span style="background-color:#ffffff;" title="можно проводить по той же схеме.">can be carried out by the same scheme. </span><span title="Также репозиторий можно записать в файл и затем на
<br>">Repository also can be written to a file and then <br /></span><span style="background-color:#ffffff;" title="диск (как указано здесь http://developers.sun.ru/content/view/338/31/), что бы с кем нибудь
<br>">disk (as defined herein http://developers.sun.ru/content/view/338/31/), that would be with someone <br /></span><span title="поделиться или просто иметь резервную копию:
<br>">share or just to have a backup: <br /></span><span style="background-color:#ffffff;" title="# zfs snapshot rpool/repo@distrib
<br>"># Zfs snapshot rpool / repo @ distrib <br /></span><span style="background-color:#ffffff;" title="# zfs send rpool/repo@distrib > repo.distrib.zfs
<br>"># Zfs send rpool / repo @ distrib> repo.distrib.zfs <br /></span><span title="Если все работает, то на этом все.">If everything works, then that's it.</span></span></div><div> </div><div>-- <br />http://www.arhipkin.com<br /><br />Я на Facebook: http://www.facebook.com/ilya.arhipkin<br /><br />Я на Facebook: http://www.facebook.com/profile.php?id=100000965843704</div>