[openstack-dev] [Openstack] [TROVE] Manual Installation Again

2014-03-06 Thread Mark Kirkwood
I've been looking at setting up Trove manually, and of course the first 
document I stumbled on was:


http://docs.openstack.org/developer/trove/dev/manual_install.html

Now, while this proved to be very handy, there are some points where it 
is wrong, and others where it is errm...lean. So in the spirit of trying 
to improve things here I go.


The wrong concerns the action given to trove-manage in the "Prepare 
Database" section:


$ trove-manage --config-file= image_update mysql
`nova --os-username trove --os-password trove --os-tenant-name trove
--os-auth-url http://:5000/v2.0 image-list | awk 
'/trove-image/ {print $2}'`


This should probably be:

$ trove-manage --config-file= datastore_version_update 
mysql mysql-5.5 mysql

`nova --os-username trove --os-password trove --os-tenant-name trove
--os-auth-url http://:5000/v2.0 image-list | awk 
'/trove-image/ {print $2}'` 1


...which is a bit of a mouthful - might be better to break it into 2 steps.


The lean area concerns the stuff in "Prepare Image". It seems to me that 
more needs to be done than simply converting to qcow2. After spending a 
while reading stuff in trove-integration/scripts repo I suspect that 
something like following is needed:


1/ setup relevant os user (e.g trove or stack) for what follows
2/ install mysql 5.5 in the image (or arrange it to be installed on 1st 
boot)
3/ setup keys so guest can rsync the trove client software (or install 
it in the image to avoid the need)
4/ configure the trove guest agent service to start (otherwise db 
instance stays stuck in 'BUILD' state forever)


I note that the trove-integration repo uses diskimage-builder and triplo 
to do all these mods to the initial base image.


Now I understand that some of this area is gonna be in flux (e.g use of 
first-boot.d in the tripleo elements), but some mention of what 
customizations to the base image are needed would be most excellent.


regards

Mark

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Openstack] [TROVE] Manual Installation Again

2014-03-06 Thread Mark Kirkwood

On 07/03/14 18:03, Mark Kirkwood wrote:



The wrong concerns the action given to trove-manage in the "Prepare
Database" section:

$ trove-manage --config-file= image_update mysql
 `nova --os-username trove --os-password trove --os-tenant-name trove
 --os-auth-url http://:5000/v2.0 image-list | awk
'/trove-image/ {print $2}'`

This should probably be:

$ trove-manage --config-file= datastore_version_update
mysql mysql-5.5 mysql
 `nova --os-username trove --os-password trove --os-tenant-name trove
 --os-auth-url http://:5000/v2.0 image-list | awk
'/trove-image/ {print $2}'` 1

...which is a bit of a mouthful - might be better to break it into 2 steps.




...and I got it wrong too - forgot the package arg, sorry:

$ trove-manage --config-file= datastore_version_update 
mysql mysql-5.5 mysql

`nova --os-username trove --os-password trove --os-tenant-name trove
--os-auth-url http://:5000/v2.0 image-list | awk 
'/trove-image/ {print $2}'` mysql-server-5.5 1


Especially in the light of the above I think a less confusing 
presentation would be:


$ nova --os-username trove --os-password trove --os-tenant-name trove
--os-auth-url http://:5000/v2.0 image-list | awk 
'/trove-image/ {print $2}'



$ trove-manage --config-file= datastore_version_update 
mysql mysql-5.5 mysql  mysql-server-5.5 1



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Openstack] [TROVE] Manual Installation Again

2014-03-06 Thread Anne Gentle
On Thu, Mar 6, 2014 at 11:03 PM, Mark Kirkwood <
mark.kirkw...@catalyst.net.nz> wrote:

> I've been looking at setting up Trove manually, and of course the first
> document I stumbled on was:
>
> http://docs.openstack.org/developer/trove/dev/manual_install.html
>
> Now, while this proved to be very handy, there are some points where it is
> wrong, and others where it is errm...lean. So in the spirit of trying to
> improve things here I go.
>
> The wrong concerns the action given to trove-manage in the "Prepare
> Database" section:
>
> $ trove-manage --config-file= image_update mysql
> `nova --os-username trove --os-password trove --os-tenant-name trove
> --os-auth-url http://:5000/v2.0 image-list | awk
> '/trove-image/ {print $2}'`
>
> This should probably be:
>
> $ trove-manage --config-file= datastore_version_update
> mysql mysql-5.5 mysql
> `nova --os-username trove --os-password trove --os-tenant-name trove
> --os-auth-url http://:5000/v2.0 image-list | awk
> '/trove-image/ {print $2}'` 1
>
> ...which is a bit of a mouthful - might be better to break it into 2 steps.
>
>
> The lean area concerns the stuff in "Prepare Image". It seems to me that
> more needs to be done than simply converting to qcow2. After spending a
> while reading stuff in trove-integration/scripts repo I suspect that
> something like following is needed:
>
> 1/ setup relevant os user (e.g trove or stack) for what follows
> 2/ install mysql 5.5 in the image (or arrange it to be installed on 1st
> boot)
> 3/ setup keys so guest can rsync the trove client software (or install it
> in the image to avoid the need)
> 4/ configure the trove guest agent service to start (otherwise db instance
> stays stuck in 'BUILD' state forever)
>
> I note that the trove-integration repo uses diskimage-builder and triplo
> to do all these mods to the initial base image.
>
> Now I understand that some of this area is gonna be in flux (e.g use of
> first-boot.d in the tripleo elements), but some mention of what
> customizations to the base image are needed would be most excellent.
>

Hi Mark,
Great observations, at the Trove midcycle meetup we identified this as an
area to be documented. I heard at least 2 people want to work on it so I
hope they're drafting furiously and soon! I think it should eventually go
into the Virtual Machine Image Guide, but may just need to be part of their
install guide right away. Thanks for asking, it helps shape the docs.
Anne


>
> regards
>
> Mark
>
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Openstack] [TROVE] Manual Installation Again

2014-03-17 Thread tattabbum
Hi Mark,
have you some news about the right steps (Prepare Image) that are needed
perform in order to launch a trove instance with a correctly configured
trove-guest agent?

As you, I have read all the trove-integration/script/redstack script to find
the right commands to perform a manual trove installatio, and I have
realized the gerrit review https://review.openstack.org/#/c/78608/.
I would be happy if you could contribute to the review, particularly for the
"Prepare Image" steps.

Thank you,
Giuseppe





--
View this message in context: 
http://openstack.10931.n7.nabble.com/Openstack-TROVE-Manual-Installation-Again-tp34470p35366.html
Sent from the Developer mailing list archive at Nabble.com.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Openstack] [TROVE] Manual Installation Again

2014-03-23 Thread Mark Kirkwood
I've outlined two methods here, both assume you are using devstack, so 
would need some editorializing for an actual deployment (userids, paths 
etc):


1/ diskimage builder + triplo

This essentially copies how trove-integration does it.

2/ Do it yourself install of required software in base image

This was my hope for a simpler method that needed fewer extra tools - it 
ended up being about a similar level of complexity I fear.


One difference between the two methods: 1/ installs mysql but rsyncs the 
trove software on 1st boot. 2/ installs mysql and trove in the image (so 
it starts up quicker). I guess an addition 3/ is possible where we 
install mysql on 1st boot and also the python deps + rsync trove 
software then too. This might make more sense when we have official pkgs 
for trove that we can just apt-get (and will pull in the right deps at 
that point).


I'm happy to add this to the review, but the text is quite bulky and 
maybe we need to decide which method is best (at the moment anyway)!


Cheers

Mark


On 17/03/14 22:37, tattabbum wrote:

Hi Mark,
have you some news about the right steps (Prepare Image) that are needed
perform in order to launch a trove instance with a correctly configured
trove-guest agent?

As you, I have read all the trove-integration/script/redstack script to find
the right commands to perform a manual trove installatio, and I have
realized the gerrit review https://review.openstack.org/#/c/78608/.
I would be happy if you could contribute to the review, particularly for the
"Prepare Image" steps.



Method 1 - Building our own vm via diskimage builder and tripleo


Generate keys:

$ ssh-keygen [no passphrase]
$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys

Get custom tripleo elements for various db builds;

$ git clone https://github.com/openstack/trove-integration.git 
$ cp -rp trove-integration/scripts/files ~/scripts
$ rm -rf trove-integration

$ vi scripts/files/elements/fedora-guest/extra-data.d/20-guest-upstart
$ vi scripts/files/elements/ubuntu-guest/extra-data.d/20-guest-upstart 
[ s/REDSTACK_SCRIPTS/CUSTOM_SCRIPTS ]

Check out diskimage-builder and tripleo-image-elements,
so after ./stack.sh has run do:

$ cd /opt/stack
$ git clone git://git.openstack.org/openstack/diskimage-builder.git
$ git clone git://git.openstack.org/openstack/tripleo-image-elements.git

$ export CUSTOM_SCRIPTS=/home/stack/scripts
$ export 
ELEMENTS_PATH=$CUSTOM_SCRIPTS/files/elements:/opt/stack/tripleo-image-elements/elements
$ export HOMEDIR=/home/stack
$ export SSH_DIR=${HOMEDIR}/.ssh
$ export GUEST_USERNAME=stack
$ export HOST_USERNAME=stack
$ export NETWORK_GATEWAY=10.0.0.1
$ export SERVICE_TYPE=mysql
$ export GUEST_LOGDIR=/tmp
$ export ESCAPED_GUEST_LOGDIR=`echo $GUEST_LOGDIR | sed 's/\//\//g'`

$ export RELEASE=precise
$ export DIB_RELEASE=$RELEASE
$ export DIB_CLOUD_IMAGES=cloud-images.ubuntu.com

$ export PATH_TROVE=/opt/stack/trove
$ export ESCAPED_PATH_TROVE=`echo $PATH_TROVE | sed 's/\//\//g'`

$ /opt/stack/diskimage-builder/bin/disk-image-create \
-a amd64 -o ubuntu_mysql \
ubuntu vm heat-cfntools ubuntu-guest ubuntu-mysql


Method 2 - building own vm with minimal other tools
---

Generate keys:

$ ssh-keygen [no passphrase]
$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys

Get the ubuntu cloud image and set it up for easy access:

$ sudo apt-get install cloud-utils genisoimage

$ cd images
$ wget 
http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img
$ cat > my-user-data <:/home/stack/.ssh\* home/stack/.ssh
(guest) $ sudo -u stack rsync -a :/opt/stack/trove /home/stack
(guest) $ sudo apt-get install libmysqlclient18 mysql-server-5.5 
mysql-client-5.5 

(guest) $ sudo apt-get install python-dev libxml2-dev libxslt1-dev 
python-setuptools \
 python-pip python-sqlalchemy python-lxml python-routes 
python-eventlet \
 python-webob python-pastedeploy python-paste python-netaddr \
 python-httplib2 python-iso8601 python-pexpect python-mysqldb 
python-migrate

(guest) $ sudo pip install pip\>=1.4
(guest) $ sudo pip install 
http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a3.tar.gz\#egg=oslo.config-1.2.0a3

(guest) $ sudo pip install extras python-novaclient python-swiftclient 
python-cinderclient \
   'kombu>2.4.7' six babel python-heatclient passlib jinja2

(guest) $ sudo vi /etc/sudoers.d/60_trove_guest
(guest) $ cat /etc/sudoers.d/60_trove_guest
stack ALL=(ALL) NOPASSWD:ALL

(guest) $ sudo chmod 440 /etc/sudoers.d/60_trove_guest

(guest) $ sudo vi /etc/init/trove-guest.conf
(guest) $ cat /etc/init/trove-guest.conf
description "Trove Guest"
author "Auto-Gen"

start on (filesystem and net-device-up IFACE!=lo)
stop on runlevel [016]
chdir /var/run
pre-start script
mkdir -p /var/run/trove
chown stack:root /var/run/trove/

mkdir -p /var/lock/trove
chown sta