google / seesaw

Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.
Apache License 2.0
5.63k stars 511 forks source link

Unable to start seesaw #33

Open tehseensagar opened 7 years ago

tehseensagar commented 7 years ago

I have successfully installed seesaw with out any error and Im sharing it here hope it will help other beginners like me.

Installing Go

apt-get update
apt-get install libnl-3-dev libnl-genl-3-dev
apt-get install curl git gcc make
apt-get install libcap2-bin
apt-get install protobuf-compiler
apt-get install golang

After Installing golan run following command

go env

Follwong output:

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/lib/go-1.6"
GOTOOLDIR="/usr/lib/go-1.6/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

Fixing Path issue:

This path GOPATH="" should not be empty to fix this use following

export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

For permanant path fix:

vi /root/.bashrc

Paste the following line at the end of file:

export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Now, It has to install Go packages in your GOPATH and in my case path is: /root/go

Settingup-Go

go get -u golang.org/x/crypto/ssh
go get -u github.com/dlintw/goconf
go get -u github.com/golang/glog
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u github.com/miekg/dns
go get -u github.com/kylelemons/godebug/pretty
go get -u github.com/google/seesaw

Compiling Seesaw Code:

cd /root/go/src/github.com/google/seesaw/
make test
make install

Copy Installation-Script

copy seesaw_install.sh script and paste it into following path

cd /root/go/bin
chmod +x seesaw_install.sh
./seesaw_install.sh

Modified the Install Script:

SEESAW_BIN="/usr/local/seesaw"
SEESAW_ETC="/etc/seesaw"
SEESAW_LOG="/var/log/seesaw"

INIT=`ps -p 1 -o comm=`

install -d "${SEESAW_BIN}" "${SEESAW_ETC}" "${SEESAW_LOG}"

install "${GOPATH}/bin/seesaw_cli" /usr/bin/seesaw

for component in {ecu,engine,ha,healthcheck,ncc,watchdog}; do
install "${GOPATH}/bin/seesaw_${component}" "${SEESAW_BIN}"
done

if [ $INIT = "init" ]; then
#install "etc/init/seesaw_watchdog.conf" "/etc/init"
install "/root/go/src/github.com/google/seesaw/etc/init/seesaw_watchdog.conf" "/etc/init"
#elif [ $INIT = "systemd" ]; then
#install "etc/systemd/system/seesaw_watchdog.service" "/etc/systemd/system"
#systemctl --system daemon-reload
fi
#install "etc/seesaw/watchdog.cfg" "${SEESAW_ETC}"
install "/root/go/src/github.com/google/seesaw/etc/seesaw/watchdog.cfg" "${SEESAW_ETC}"
install "/root/go/src/github.com/google/seesaw/pb/config/config.proto" "${SEESAW_ETC}" 
install "/root/go/src/github.com/google/seesaw/etc/seesaw/seesaw.cfg.example" "${SEESAW_ETC}"
install "/root/go/src/github.com/google/seesaw/etc/seesaw/cluster.pb.example" "${SEESAW_ETC}"
/bin/mv /etc/seesaw/seesaw.cfg.example /etc/seesaw/seesaw.cfg
/bin/mv /etc/seesaw/cluster.pb.example /etc/seesaw/cluster.pb
#Enable CAP_NET_RAW for seesaw binaries that require raw sockets.
/sbin/setcap cap_net_raw+ep "${SEESAW_BIN}/seesaw_ha"
/sbin/setcap cap_net_raw+ep "${SEESAW_BIN}/seesaw_healthcheck"

Now I'm stuck where to get start with , Ive made following changes in seesaw.cfg and cluster.pb file.

Seesaw_cfg_file:

[cluster]
anycast_enabled = false
name = au-syd
node_ipv4 = 192.168.27.251
peer_ipv4 = 192.168.27.252
vip_ipv4 = 192.168.254.2

[config_server]
primary = seesaw-host1.com
secondary = seesaw-host2.com
#tertiary = seesaw-config3.example.com

[interface]
node = ens33  #Ethernet-1 on seesaw server
lb = ens34   #Ehetrnet-2 on seesaw server

Cluster_pb_file:

seesaw_vip: <
  fqdn: "seesaw-vip1.hostlb.com." #seesaw-server name
  ipv4: "192.168.254.2/24" #ip on seesaw-server  eth2
  status: PRODUCTION
>
node: <
  fqdn: "seesaw-host1.com." #vm-machine-1
  ipv4: "192.168.27.251" #ip on vm-machine eth1
  status: PRODUCTION
>
node: <
  fqdn: "seesaw-host2.com." #vm-machine-2
  ipv4: "192.168.27.252" #ip on vm-machine eth1
  status: PRODUCTION
>
healthcheck: <
    type: HTTP
    interval: 4
    timeout: 1
    port: 11000
    send: "/healthz"
    tls_verify: false
  >

Can any one guide me hwo to set itup furhter and run this? I'm lost

Regards Tehseen

baptr commented 7 years ago

You should be able to service seesaw_watchdog start to run the binaries. Their logs should point you towards any simple fixups.

To see it do anything useful, you'll need to add a vserver with some backends to your cluster.pb (see https://github.com/google/seesaw/blob/master/etc/seesaw/cluster.pb.example).

Let me know if you have other specific questions.

driftavalii commented 7 years ago

Also trying to set this up but need some clarification on the cluster.pb.example entries.

  1. What does the vserver_entry refer to precisely, the service being offered? If so, why does the ventry ipv4 address not point to the vip address, does it have any significance, I assume the backend are the actual servers being load balanced against?
  2. The healthcheck for the ventry entry is a different one from the healthcheck entry after the backends?

Is there any place where all the options are documented? Gained some insight from the Find file Copy pathseesaw/pb/config/config.proto file but not a lot.

Thanks.

Oga

baptr commented 7 years ago

A vserver_entry maps most directly to an ipvs virtual service. A vserver provides the IP. vserver_entries add protocol and port (and other load balancing configuration)

vserver and ventry healthchecks are additive. vserver healthchecks apply to each ventry.

The proto is the right place for the documentation, but you're right that it's a bit lacking in that high level detail.

driftavalii commented 7 years ago

I ran into issues after installing, the service seems not to start, and trying to run seesaw results into an error: Failed to connect to engine: Dial failed: dial unix /var/run/seesaw/engine/engine.sock: connect: no such file or directory checking the logs shows multiple files that seem to be associated with the compiled files (seesaw_ha, seesaw_engine, seesaw_ha, seesaw_healthcheck), which one of these can I look into for guidance? thanks.

driftavalii commented 7 years ago

Is there any way to validate cluster.pb, running into this error: F0706 20:15:35.836574 1850 core.go:127] config.NewNotifier() failed: Notifier.bootstrap: Failed to load any cluster config, despite having a cluster.pb file in /usr/local/seesaw. My cluster.pb content is below:

seesaw_vip: <
  fqdn: "apiserver.homelab.local"
  ipv4: "10.0.0.50/24"
  status: PRODUCTION
>
node: <
  fqdn: "seesaw-1.homelab.local."
  ipv4: "10.0.0.11/24"
  status: PRODUCTION
>
node: <
  fqdn: "seesaw-2.homelab.local."
  ipv4: "10.0.0.12/24"
  status: PRODUCTION
>
vserver: <
  name: "vserver-admin@homelab.local"
  entry_address: <
    fqdn: "apiserver.homelab.local."
    ipv4: "10.0.0.50/24"
    status: PRODUCTION
  >
  rp: "vserver-admin@homelab.local"
  vserver_entry: <
    protocol: TCP
    port: 443
    scheduler: WRR
    persistence: 120
    >
  >
  backend: <
    host: <
      fqdn: "controller0.homelab.local."
      ipv4: "10.0.0.20/24"
      status: PRODUCTION
    >
    weight: 1
  >
  backend: <
    host: <
      fqdn: "controller1.homelab.local."
      ipv4: "10.0.0.21/24"
      status: PRODUCTION
    >
    weight: 1
  >
  backend: <
    host: <
      fqdn: "controller2.homelab.local."
      ipv4: "10.0.0.22/24"
      status: PRODUCTION
    >
    weight: 1
  >
>
metadata: <
  last_updated: 1447906527
>
dedicated_vip_subnet: "10.0.0.0/24"
bseenu commented 7 years ago

Even i am facing the above issue, I have placed my cluster.pb in /etc/seesaw directory

Is there any way i can vaidate my cluster.pb is good, what else can cause this?

-srini

bseenu commented 7 years ago

Ok i was able to fix, there was a typo in the file. But now seesaw is up But unable to list any virtual servers, Here is my config


ubuntu@ip-172-31-8-43:/var/log/seesaw$ cat /etc/seesaw/seesaw.cfg [cluster] anycast_enabled = false name = rtmp-pool node_ipv4 = 172.31.8.43 vip_ipv4 = 172.31.6.176

[interface] node = eth0 lb = eth1

ubuntu@ip-172-31-8-43:/var/log/seesaw$ cat /etc/seesaw/cluster.pb seesaw_vip: < fqdn: "ec2-xx-xx-xx-xx.us-west-1.compute.amazonaws.com" status: TESTING

node: < fqdn: "ec2-xx-xx-xx-xx.us-west-1.compute.amazonaws.com" status: TESTING

vserver: < name: "RTMP" entry_address: < fqdn : "ec2-xx-xx-xx-xx.us-west-1.compute.amazonaws.com" status: TESTING

rp: "test@test.com" vserver_entry: < protocol : TCP port: 1935 scheduler : RR healthcheck: < type: TCP port: 1935 mode: DSR

backend: < host: < fqdn: "ec2-xx-xx-xx-xx.us-west-1.compute.amazonaws.com" status: TESTING

ubuntu@ip-172-31-8-43:/var/log/seesaw$ sudo seesaw -c "show vservers" No vservers found

baptr commented 7 years ago

There should be some information in /var/log/seesaw/seesaw_engine.INFO to help.

bseenu commented 6 years ago

I am seeing the following in the log

E1004 22:00:06.548921 11873 core.go:367] Manager failed to determine haConfig: node <> not configured E1004 22:00:06.548939 11873 core.go:376] Manager failed to identify local node: node < not configured

tiepnv-viosoft commented 6 years ago

I'm planning to test performance of the seesaw but it's difficult for me to figure out the topology. Could you show me the topology to setup a test environment? For example: https://github.com/iqiyi/dpvs/blob/master/doc/pics/fnat-two-arm.png

Thanks, TiepNV