Skip to content

Instantly share code, notes, and snippets.

@yuanying
Last active June 22, 2017 07:18
Show Gist options
  • Save yuanying/75e6edcf302d9b91d880f68c4d0e4be1 to your computer and use it in GitHub Desktop.
Save yuanying/75e6edcf302d9b91d880f68c4d0e4be1 to your computer and use it in GitHub Desktop.
Multi Node Devstack

Readme!!

Controller

sudo iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
sudo mkdir - p /etc/neutron
sudo chown -R $USER /etc/neutron
echo "dhcp-option-force=26,1400" >> /etc/neutron/dnsmasq.conf
sudo mkdir /opt/stack
sudo chown -R $USER /opt/stack
cd /opt/stack
mkdir logs
cd logs
mkdir keystone nova cinder glance neutron swift heat octavia
cd ~
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack

Log

  • /etc/octavia/octavia.conf
  • /etc/swift/swift.conf
[[local|localrc]]
MULTI_HOST=True
HOST_IP=192.168.11.198
SERVICE_HOST=192.168.11.197
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
Q_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292
ADMIN_PASSWORD=openstack
MYSQL_PASSWORD=stackdb
RABBIT_PASSWORD=stackqueue
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=tokentoken
DATABASE_TYPE=mysql
# Services
disable_all_services
ENABLED_SERVICES=n-cpu,rabbit,neutron,q-agt,c-vol,placement-client
FLOATING_RANGE=172.16.12.0/24
FIXED_RANGE=10.4.128.0/20
FIXED_NETWORK_SIZE=4096
## Neutron options
PUBLIC_INTERFACE=ens3
FLAT_INTERFACE=ens3
#ENABLE_TENANT_TUNNELS=True
#Q_PLUGIN=ml2
#Q_ML2_TENANT_NETWORK_TYPE=vxlan
NOVA_VNC_ENABLED=True
NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html"
VNCSERVER_LISTEN=$HOST_IP
VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN
SCREEN_LOGDIR=$DEST/logs/screen
LOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2
[[post-config|/etc/neutron/neutron.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(project_id)s %(user_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/neutron
[[post-config|/etc/nova/nova.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(project_id)s %(user_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/nova
[[local|localrc]]
MULTI_HOST=True
HOST_IP=192.168.11.197
FLOATING_RANGE=172.16.12.0/24
FIXED_RANGE=10.4.128.0/20
FIXED_NETWORK_SIZE=4096
PUBLIC_NETWORK_GATEWAY=172.16.12.1
# Neutron
#ENABLE_TENANT_TUNNELS=True
#Q_PLUGIN=ml2
#Q_ML2_TENANT_NETWORK_TYPE=vxlan
ADMIN_PASSWORD=openstack
MYSQL_PASSWORD=stackdb
RABBIT_PASSWORD=stackqueue
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=tokentoken
disable_service n-net
disable_service n-cpu
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service neutron
enable_service s-proxy
enable_service s-object
enable_service s-container
enable_service s-account
# Disable LBaaS(v1) service
disable_service q-lbaas
# Enable LBaaS(v2) services
enable_service q-lbaasv2
enable_service octavia
enable_service o-cw
enable_service o-hk
enable_service o-hm
enable_service o-api
enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas
enable_plugin octavia https://git.openstack.org/openstack/octavia
OCTAVIA_MGMT_SUBNET=172.16.13.0/24
OCTAVIA_MGMT_SUBNET_START=172.16.13.2
OCTAVIA_MGMT_SUBNET_END=172.16.13.200
VOLUME_BACKING_FILE_SIZE=20G
enable_plugin heat https://git.openstack.org/openstack/heat
SCREEN_LOGDIR=$DEST/logs/screen
LOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2
[[post-config|/etc/neutron/dhcp_agent.ini]]
[DEFAULT]
dnsmasq_config_file = /etc/neutron/dnsmasq.conf
[[post-config|/etc/nova/nova.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(project_id)s %(user_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/nova
[[post-config|/etc/glance/glance-api.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/glance
[[post-config|/etc/glance/glance-cache.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/glance
[[post-config|/etc/glance/glance-registry.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/glance
[[post-config|/etc/heat/heat.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/heat
[[post-config|/etc/keystone/keystone.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/keystone
[[post-config|/etc/neutron/neutron.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(project_id)s %(user_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/neutron
[[post-config|/etc/cinder/cinder.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(project_id)s %(user_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/cinder
[[post-config|/etc/octavia/octavia.conf]]
[DEFAULT]
logging_exception_prefix =
logging_debug_format_suffix = from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s %(instance)s%(message)s
logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(project_id)s %(user_id)s] %(instance)s%(message)s
log_dir = /opt/stack/logs/octavia
input {
file {
path => "/opt/stack/logs/nova/*.log"
start_position => beginning
type => nova
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
file {
path => "/opt/stack/logs/neutron/*.log"
start_position => beginning
type => neutron
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
}
filter {
grok {
match => [
"message", "%{TIMESTAMP_ISO8601:datetime} %{NUMBER:pid} %{LOGLEVEL:level} %{NOTSPACE:label} (\[req-%{UUID:reqid} %{UUID:project_id} %{UUID:user_id}\] )?%{GREEDYDATA:data}"
]
}
date {
match => [ "datetime" , "yyyy-MM-dd HH:mm:ss.SSS"]
target => "@logdate"
timezone => "Asia/Tokyo"
}
}
output {
elasticsearch { hosts => ['es'] }
}
input {
file {
path => "/opt/stack/logs/nova/*.log"
start_position => beginning
type => nova
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
file {
path => "/opt/stack/logs/glance/*.log"
start_position => beginning
type => glance
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
file {
path => "/opt/stack/logs/cinder/*.log"
start_position => beginning
type => cinder
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
file {
path => "/opt/stack/logs/neutron/*.log"
start_position => beginning
type => neutron
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
file {
path => "/opt/stack/logs/heat/*.log"
start_position => beginning
type => heat
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
file {
path => "/opt/stack/logs/keystone/*.log"
start_position => beginning
type => keystone
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
file {
path => "/opt/stack/logs/octavia/*.log"
start_position => beginning
type => octavia
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
file {
path => "/opt/stack/logs/swift/*.log"
start_position => beginning
type => swift
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601} "
negate => true
what => previous
}
}
}
filter {
grok {
match => [
"message", "%{TIMESTAMP_ISO8601:datetime} %{NUMBER:pid} %{LOGLEVEL:level} %{NOTSPACE:label} (\[req-%{UUID:reqid} %{UUID:project_id} %{UUID:user_id}\] )?%{GREEDYDATA:data}"
]
}
date {
match => [ "datetime" , "yyyy-MM-dd HH:mm:ss.SSS"]
target => "@logdate"
timezone => "Asia/Tokyo"
}
}
output {
elasticsearch { hosts => ['es'] }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment